diff --git a/Podfile b/Podfile index 017173f1a3..e71ea5ec3a 100644 --- a/Podfile +++ b/Podfile @@ -22,7 +22,8 @@ abstract_target 'novawalletAll' do pod 'Charts' pod 'SwiftRLP', :git => 'https://github.com/ERussel/SwiftRLP.git' pod 'Starscream', :git => 'https://github.com/ERussel/Starscream.git', :tag => '4.0.5' - + pod 'CDMarkdownKit', :git => 'https://github.com/nova-wallet/CDMarkdownKit.git', :tag => '2.4.0' + target 'novawalletTests' do inherit! :search_paths diff --git a/Podfile.lock b/Podfile.lock index 15528c2987..1a436d7332 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,8 +1,10 @@ PODS: - BigInt (5.2.0) - - Charts (3.6.0): - - Charts/Core (= 3.6.0) - - Charts/Core (3.6.0) + - CDMarkdownKit (2.3.0) + - Charts (4.1.0): + - Charts/Core (= 4.1.0) + - Charts/Core (4.1.0): + - SwiftAlgorithms (~> 1.0) - CocoaLumberjack (3.7.2): - CocoaLumberjack/Core (= 3.7.2) - CocoaLumberjack/Core (3.7.2) @@ -114,6 +116,7 @@ PODS: - xxHash-Swift (~> 1.0.0) - SVGKit (2.1.0): - CocoaLumberjack (~> 3.0) + - SwiftAlgorithms (1.0.0) - SwiftFormat/CLI (0.47.13) - SwiftLint (0.43.1) - SwiftRLP (1.1): @@ -123,6 +126,7 @@ PODS: - xxHash-Swift (1.0.13) DEPENDENCIES: + - CDMarkdownKit (from `https://github.com/nova-wallet/CDMarkdownKit.git`, tag `2.4.0`) - Charts - CommonWallet/Core (from `https://github.com/ERussel/Capital-iOS.git`, tag `1.16.0`) - Cuckoo @@ -164,6 +168,7 @@ SPEC REPOS: - SoraFoundation - SoraKeystore - Sourcery + - SwiftAlgorithms - SwiftFormat - SwiftLint - SwiftyBeaver @@ -171,6 +176,9 @@ SPEC REPOS: - xxHash-Swift EXTERNAL SOURCES: + CDMarkdownKit: + :git: https://github.com/nova-wallet/CDMarkdownKit.git + :tag: 2.4.0 CommonWallet: :git: https://github.com/ERussel/Capital-iOS.git :tag: 1.16.0 @@ -190,6 +198,9 @@ EXTERNAL SOURCES: :git: https://github.com/ERussel/SwiftRLP.git CHECKOUT OPTIONS: + CDMarkdownKit: + :git: https://github.com/nova-wallet/CDMarkdownKit.git + :tag: 2.4.0 CommonWallet: :git: https://github.com/ERussel/Capital-iOS.git :tag: 1.16.0 @@ -211,7 +222,8 @@ CHECKOUT OPTIONS: SPEC CHECKSUMS: BigInt: f668a80089607f521586bbe29513d708491ef2f7 - Charts: b1e3a1f5a1c9ba5394438ca3b91bd8c9076310af + CDMarkdownKit: 9154c4e31f105e6a83b726412787d85e56edba46 + Charts: 354f86803d11d9c35de280587fef50d1af063978 CocoaLumberjack: b7e05132ff94f6ae4dfa9d5bce9141893a21d9da CommonWallet: 59fdbf5511d6fcdc38496db4baf425dd0cf29274 Cuckoo: 9e258d68137c411df47c6390f72901d5276b4f03 @@ -233,6 +245,7 @@ SPEC CHECKSUMS: Starscream: 8cc648110705c09a15f0de84352c7f9595b7cb05 SubstrateSdk: 6923efefde7463684701e9f4f5b0216eb6578a71 SVGKit: 132b010efbf57ec345309fe4a7f627c0a40c5d63 + SwiftAlgorithms: 38dda4731d19027fdeee1125f973111bf3386b53 SwiftFormat: 73573b89257437c550b03d934889725fbf8f75e5 SwiftLint: 99f82d07b837b942dd563c668de129a03fc3fb52 SwiftRLP: f58417bfceecd45394fc619ccad14cf16e4ae6c1 @@ -240,6 +253,6 @@ SPEC CHECKSUMS: TweetNacl: 3abf4d1d2082b0114e7a67410e300892448951e6 xxHash-Swift: 30bd6a7507b3b7348a277c49b1cb6346c2905ec7 -PODFILE CHECKSUM: 4d0db693ac4524f7e22cfc95b6546c23edf7f2d1 +PODFILE CHECKSUM: f0266fabfe6e7f6dfb62690262b3b1c8ab02bfba COCOAPODS: 1.11.3 diff --git a/novawallet.xcodeproj/project.pbxproj b/novawallet.xcodeproj/project.pbxproj index 20236fcf76..1493c3e982 100644 --- a/novawallet.xcodeproj/project.pbxproj +++ b/novawallet.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 003063A17B04BA6327EA355F /* ReferendumVotersProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6FE9E98CB265815986BE909 /* ReferendumVotersProtocols.swift */; }; 006BEDBD2F98FF54DB993D8C /* DAppAddFavoriteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 057EF626183878DD2C9E7BC7 /* DAppAddFavoriteViewController.swift */; }; 0119531FAE0D22EA9464F84D /* ParaStkYourCollatorsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128EA612020D98F3B0D0FA96 /* ParaStkYourCollatorsProtocols.swift */; }; 012AE9F8BDA682C691B6F9FD /* ParitySignerWelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78CF6E3E64F7608EF6C28399 /* ParitySignerWelcomeViewController.swift */; }; @@ -17,6 +18,7 @@ 042799797DF7E6FD02D1D1E6 /* ParitySignerTxScanPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 408CF7752F4F638FA29DFE4A /* ParitySignerTxScanPresenter.swift */; }; 049DA9A36A72CB6F8401769C /* WalletsListWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F404EE82BC45BFE0F42E0A4 /* WalletsListWireframe.swift */; }; 04B85867D67D56994D99FF14 /* NftListProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89CFED2E01AB638656E251AF /* NftListProtocols.swift */; }; + 04D86D5341406305E60F6D18 /* ReferendumVoteSetupInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 024B7E67C0603C53981EC394 /* ReferendumVoteSetupInteractor.swift */; }; 054C4BCDEC29ED5F74A36E8B /* ExportMnemonicPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61EBE466BDCF77E65FDCDF81 /* ExportMnemonicPresenter.swift */; }; 06590486EED4050BADDD32C5 /* AccountManagementPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2B676982F60C55530BDD569 /* AccountManagementPresenter.swift */; }; 0678271BE1BA5BBC084F478A /* RecommendedValidatorListWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57C624E71FCE0FFF8EAD5BA9 /* RecommendedValidatorListWireframe.swift */; }; @@ -25,6 +27,7 @@ 09A6D92CE47636723DFC91F4 /* MessageSheetViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57535268534B154B42ED51CE /* MessageSheetViewFactory.swift */; }; 0AAFEFA17F249F4BEF051F6B /* ControllerAccountConfirmationPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FB887490A8B33890B4E0E4 /* ControllerAccountConfirmationPresenter.swift */; }; 0B2B9C6E2BA2E924D6A54F4B /* CrowdloanListInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4E78D69E8EBC3EB4D01F8EF /* CrowdloanListInteractor.swift */; }; + 0B48B02E973CB304B765BBC9 /* ReferendumDetailsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3ABAD23C0039AFA8351C650 /* ReferendumDetailsProtocols.swift */; }; 0C2AA829B5CB89B39E0FA95E /* CrowdloanContributionConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF01941105BCD02536538362 /* CrowdloanContributionConfirmProtocols.swift */; }; 0CA307BC2F570941CD22C9AA /* ExportMnemonicConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF4688AF0658F8BB7A90C2BE /* ExportMnemonicConfirmViewFactory.swift */; }; 0CD1F4D100ED82D137AB9834 /* ParaStkStakeSetupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD2F1EEBF48485F02BF690A4 /* ParaStkStakeSetupViewController.swift */; }; @@ -33,32 +36,40 @@ 0DF1E0D0CCEDC1340B7A47D7 /* TransferConfirmOnChainViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 899686C7351A2600FFA08371 /* TransferConfirmOnChainViewFactory.swift */; }; 0E364B6F05D390069D049CC2 /* DAppTxDetailsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1039AA3654461114FBB86844 /* DAppTxDetailsPresenter.swift */; }; 0E6C2939AFB3D125C760D5A0 /* CrowdloanContributionSetupProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7484BA696561262926D87FE5 /* CrowdloanContributionSetupProtocols.swift */; }; + 0E71EA5AE04940824AEA01C7 /* GovernanceUnlockSetupViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2E14458DEC3317602A17527 /* GovernanceUnlockSetupViewLayout.swift */; }; 0F3E58FC800ED8722589F89E /* ReferralCrowdloanPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C503100478AB56E903598A78 /* ReferralCrowdloanPresenter.swift */; }; 0F5539A29F404F98DF6B2463 /* DAppAuthConfirmViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 301287CBBF23EF58186A7BB5 /* DAppAuthConfirmViewLayout.swift */; }; 0FB6781AB0186A1ED474CAD6 /* StakingUnbondConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADD348E749EC6A7E3BB069DE /* StakingUnbondConfirmProtocols.swift */; }; 1062C095BC566A1EA8DE1C06 /* CrowdloanContributionSetupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C71DEF78B69F017DF460AB7 /* CrowdloanContributionSetupViewController.swift */; }; 106CC4BFC48B6BFFF31434A9 /* LedgerWalletConfirmPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BC1402B34E341312ABB378 /* LedgerWalletConfirmPresenter.swift */; }; 11C6F4CD5B167DE4E9E7F654 /* DAppPhishingWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 518305BB475DE40E94DCBD5D /* DAppPhishingWireframe.swift */; }; + 1269C0103216CDBDA25A5101 /* ReferendumFullDetailsWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = C80D934D47929D2331111AD7 /* ReferendumFullDetailsWireframe.swift */; }; 12734D7CC6ACA5B657F44519 /* DAppAddFavoriteViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73DA8D51B588486D304F1B73 /* DAppAddFavoriteViewFactory.swift */; }; 135CEEC5363BE34130958578 /* ControllerAccountConfirmationInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B8473AA386E1AD6F0F0C964 /* ControllerAccountConfirmationInteractor.swift */; }; 135E979B52DC1BD29A5FC389 /* ParaStkRedeemProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E1179D4A18F46C75B19CAC2 /* ParaStkRedeemProtocols.swift */; }; 13CF38563E1849EAF1B4E4B6 /* ParitySignerAddConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E2CF76ABE7BC9A99724D393 /* ParitySignerAddConfirmViewFactory.swift */; }; 148748ACAE23B7D15144015B /* DAppAuthSettingsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F23EDFB699CAEEADC9263A0D /* DAppAuthSettingsViewFactory.swift */; }; 1550A6E8789263C0D734091A /* StakingUnbondSetupWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC5083A5751A1A3CC95F4F6F /* StakingUnbondSetupWireframe.swift */; }; + 16098DABB1C9C058C1965F1D /* GovernanceUnlockSetupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC9F0E50317E1583EA8E345 /* GovernanceUnlockSetupViewController.swift */; }; 1633E4E12AF8B5C16F141944 /* DAppAuthSettingsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 812BCD9B7B25BCA02E32452E /* DAppAuthSettingsInteractor.swift */; }; + 163709FEE6203813261DD771 /* ReferendumVoteConfirmViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3531B386DEF40108C34E7232 /* ReferendumVoteConfirmViewLayout.swift */; }; 16FAE3C58B34D700D8A7A217 /* DAppListWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6E41F045986002E1E26C12 /* DAppListWireframe.swift */; }; 1710F415F6AC7BBC622F4BD2 /* ParaStkSelectCollatorsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC320A5EC0D18B6F443BB2E /* ParaStkSelectCollatorsInteractor.swift */; }; + 1752940C07D7BA41801E3853 /* ReferendumFullDescriptionInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E47548C4A216327B05A63C /* ReferendumFullDescriptionInteractor.swift */; }; 1795E946F1E386442E96E2BC /* StakingPayoutConfirmationPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17C0AC11A4A195BB697578CE /* StakingPayoutConfirmationPresenter.swift */; }; 1812D5012A1765CB38D32A4A /* WalletsListPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D6E67AD564867E121601F18 /* WalletsListPresenter.swift */; }; 187C300E406092FA5F682A61 /* LedgerPerformOperationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FD612D8F897463726CDD033 /* LedgerPerformOperationViewController.swift */; }; 19A29027666EB5388CBFAD61 /* StakingRewardDetailsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D613E20E96E7BA5B8F4B9799 /* StakingRewardDetailsInteractor.swift */; }; 19D3739A3C7800A5A18DA41C /* LedgerNetworkSelectionInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56C015A20B918DF75C499FFF /* LedgerNetworkSelectionInteractor.swift */; }; + 1A029717AD309487B70FFD02 /* ReferendumDetailsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F2F90150AD2DD3CDF7F4EDA /* ReferendumDetailsViewFactory.swift */; }; + 1A3608A12079F00796FA9718 /* ReferendumVotersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42594560B2928C79B87275D8 /* ReferendumVotersViewController.swift */; }; 1B1402BB29CFF6D9FB944B2D /* CreateWatchOnlyViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA9DD724F02DA0A174D875A8 /* CreateWatchOnlyViewLayout.swift */; }; 1BEADE77C6236CB3BF719A47 /* CrowdloanContributionSetupViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C96E41F878ED0A0A6F469D3 /* CrowdloanContributionSetupViewFactory.swift */; }; 1BFC90E1D8646F7429FFD5E6 /* ExportMnemonicProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF3AD755B2B3DCFB3D14DF91 /* ExportMnemonicProtocols.swift */; }; 1C8D1041448B8FB9DD9BBCF1 /* YourWalletsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62C5AF7E89A8C6CFF5AE03B1 /* YourWalletsProtocols.swift */; }; 1D1DC32EFF13F41677A084B7 /* DAppOperationConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = E675B4C5BE36C0004564105B /* DAppOperationConfirmProtocols.swift */; }; 1EE4FBB79EE6015D7D3EBDC1 /* ParitySignerTxScanWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F8B46E3BAB48A2D2E1D2EF4 /* ParitySignerTxScanWireframe.swift */; }; + 1F496969FEE3E160BABDAC66 /* ReferendumVoteSetupProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5159EA2661A6CBE123CCF891 /* ReferendumVoteSetupProtocols.swift */; }; 1F88F3DBFA0BD6D0FDF558F3 /* SelectValidatorsConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975DECE71DE70DFD866B8E23 /* SelectValidatorsConfirmViewFactory.swift */; }; 20B2942A4241F6713A1C70D9 /* StakingRewardDetailsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2377F8FB07B47637346249F5 /* StakingRewardDetailsViewFactory.swift */; }; 211725E26764530359F53A38 /* ParitySignerTxQrInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7859654B7C1FAC269CA61E71 /* ParitySignerTxQrInteractor.swift */; }; @@ -66,6 +77,7 @@ 21B297239CC294307EF20B58 /* ParaStkYieldBoostSetupInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78A5A3C9077FCE262224B832 /* ParaStkYieldBoostSetupInteractor.swift */; }; 22403E58019260719055E122 /* AdvancedWalletWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0DB5EA5195D9433A4B90793 /* AdvancedWalletWireframe.swift */; }; 2262277544A1D9CB46EF087A /* ParaStkYieldBoostStopProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD0DBD280596DBBC5CE5A8F /* ParaStkYieldBoostStopProtocols.swift */; }; + 2272FB0A01000A46D097634E /* GovernanceUnlockConfirmWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E067006C1BC9DFCA5E8DB86 /* GovernanceUnlockConfirmWireframe.swift */; }; 233CB11F486DE1953D977295 /* WalletsListViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7073BBC153295FF46FD06FB3 /* WalletsListViewLayout.swift */; }; 2368E8BFA569B8D007F6244F /* AssetsManageWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBFC5052A062548D20D232DA /* AssetsManageWireframe.swift */; }; 237AD34CD1C2778834D7B330 /* AnalyticsValidatorsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6F8BBBA9EABA266B288333F /* AnalyticsValidatorsViewFactory.swift */; }; @@ -76,7 +88,6 @@ 25993E2E536DE682E1DFC9AD /* ParaStkCollatorsSearchInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841C1EE99F5EA1713BA3F313 /* ParaStkCollatorsSearchInteractor.swift */; }; 270C21973CB61F0BF3D2D1E3 /* CrowdloanListProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02ACCC85B2CCF3D9392CA9B4 /* CrowdloanListProtocols.swift */; }; 2736BAABAE1389260A0B28D6 /* AssetListViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B754B68D6F1D1ED5C8577A5 /* AssetListViewFactory.swift */; }; - 278F5341DC043EBED7C0733D /* CrowdloanListViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = E70C8A9C6BF8AE46CAE1CB61 /* CrowdloanListViewFactory.swift */; }; 2793D406FD618A892D54EA84 /* CrowdloanContributionConfirmViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C92E3ED704CB0BBAB3A669F /* CrowdloanContributionConfirmViewLayout.swift */; }; 27FA1D57A06AA3A030D226B6 /* StakingUnbondConfirmWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = A84638893DC99974E098719E /* StakingUnbondConfirmWireframe.swift */; }; 286577D8FE44D1F9E7BBDCA9 /* DAppSearchViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE0F7D4389B932A1F2E17361 /* DAppSearchViewLayout.swift */; }; @@ -115,12 +126,14 @@ 2AFF4BA2274D1E5C00D790B4 /* UsernameSetupViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFF4BA1274D1E5C00D790B4 /* UsernameSetupViewLayout.swift */; }; 2B0FC94B4AE9AFE9532F493F /* ReferralCrowdloanViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71285CF636B32ACD8EB5519E /* ReferralCrowdloanViewFactory.swift */; }; 2B1E63AF98584341D670FB40 /* MoonbeamTermsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDB66DA5010441586327E139 /* MoonbeamTermsViewController.swift */; }; + 2B287EEF431ED9FE9510BAA4 /* ReferendumFullDetailsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33DFAA0EEEA7F99C6D1CF4B1 /* ReferendumFullDetailsPresenter.swift */; }; 2B682D343F75EBEB8A1E65BD /* DAppAuthSettingsViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5C144CEF4852B97149A1848 /* DAppAuthSettingsViewLayout.swift */; }; 2BB0D54988107FA0C484C530 /* ParaStkSelectCollatorsWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53BE9DEF100A373868EDD03F /* ParaStkSelectCollatorsWireframe.swift */; }; 2BBA744323AA0BF6FE53C212 /* ParaStkSelectCollatorsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20878E303E9332322655F008 /* ParaStkSelectCollatorsProtocols.swift */; }; 2BBD2FAA29C71DC6E0C8A845 /* ParaStkYieldBoostStopPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B15579DAD0DD84AEDA7D01 /* ParaStkYieldBoostStopPresenter.swift */; }; 2C3124A5EBC1AD57C01EEA17 /* SelectValidatorsStartInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEFED3DAA18BCEF0BFA15728 /* SelectValidatorsStartInteractor.swift */; }; 2C9A416905C692DCFA74A0D6 /* DAppListInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 750C8C7940C944DA4C8CB95F /* DAppListInteractor.swift */; }; + 2CEFF4C2574F0AABE0E9BF89 /* ReferendumVoteSetupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53A058D4A585F253CBF2968D /* ReferendumVoteSetupViewController.swift */; }; 2CF2F93AF862CF54FC46B560 /* PurchaseInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91D44421CCD7AD220A05CD0E /* PurchaseInteractor.swift */; }; 2EC610DC06643A00876BED6E /* AssetListWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B249C5D43CB86CF62C165F8 /* AssetListWireframe.swift */; }; 2F21134DE157A4B98ED309E2 /* AssetsSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 611FBB25D55CF56F36026074 /* AssetsSearchViewController.swift */; }; @@ -138,6 +151,7 @@ 3250F2C0E12ED42A355853BE /* SelectValidatorsStartProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = EED9939B17C4224C8E153F8A /* SelectValidatorsStartProtocols.swift */; }; 3349B35F5D5DDD2D46FF2E48 /* LedgerInstructionsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1F9B478321689D963F51C4E /* LedgerInstructionsViewFactory.swift */; }; 33B0D1D29AB3FC3CA23567B6 /* LedgerWalletAccountConfirmationWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DEC8CCF0671304A658AD606 /* LedgerWalletAccountConfirmationWireframe.swift */; }; + 3403F3DCDE932B9F9C6D32B6 /* ReferendumDetailsViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1565588CB7E044C02B091FB /* ReferendumDetailsViewLayout.swift */; }; 340AC2484415B10F247C135E /* AnalyticsValidatorsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7320E1CD9EA1A33EA29D0700 /* AnalyticsValidatorsPresenter.swift */; }; 352B75BEB10A48CC6CE64D4A /* Pods_novawalletAll_novawallet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1313BBDD3A28AC9786B5B00E /* Pods_novawalletAll_novawallet.framework */; }; 355476A5AECD2FFE4ED3DE39 /* MessageSheetViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A719A9FC28373296AB195CB /* MessageSheetViewLayout.swift */; }; @@ -145,7 +159,9 @@ 36177C077867DBAEAA2675F7 /* TransferSetupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85D8B7BE70A9F907F8B43BFC /* TransferSetupViewController.swift */; }; 37E1E9782B9752BC50AF2476 /* YourValidatorListViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE8644A4F6DED808248A0FE /* YourValidatorListViewFactory.swift */; }; 37E229641DCDF64AC5AF1DCD /* DAppBrowserPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF860B3465854DCBC02DFB3 /* DAppBrowserPresenter.swift */; }; + 38D0977931828C7894579968 /* GovernanceUnlockSetupInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFA54AB88E24A2053F289D74 /* GovernanceUnlockSetupInteractor.swift */; }; 39218CF5AA701518BD3B0103 /* ExportMnemonicInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 200C6B2C85846AED8CA9451A /* ExportMnemonicInteractor.swift */; }; + 3A4743C7C74BE4F74F6390F6 /* ReferendumFullDescriptionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = D087F5710630FCC968B65FB5 /* ReferendumFullDescriptionViewLayout.swift */; }; 3AD7635AFA1F7E66A3C00F56 /* ParitySignerAddressesInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF715CEF29477B59119520F1 /* ParitySignerAddressesInteractor.swift */; }; 3B6F50061AD9FC31D6712D9F /* ParaStkCollatorsSearchProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CFD9A58CDDA60D9E1204078 /* ParaStkCollatorsSearchProtocols.swift */; }; 3B7EEC888C19F954B5EB1012 /* OnChainTransferSetupWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9871C4FF3B05F6055AF82F14 /* OnChainTransferSetupWireframe.swift */; }; @@ -175,19 +191,23 @@ 433A3C2B0D1E4BA5974D681B /* DAppAddFavoriteWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ACF32611D345B87BCE29FE0 /* DAppAddFavoriteWireframe.swift */; }; 4387FBFF6D4EFF2E6F3A1A5A /* ParaStkYieldBoostStartViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE30B597680295FFB1B7220C /* ParaStkYieldBoostStartViewFactory.swift */; }; 43DB2CC9864CC7F5904A2DBC /* AdvancedWalletViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B243F6751E2277D9FC14481 /* AdvancedWalletViewFactory.swift */; }; + 441FFD82C502D7300B79EE66 /* ReferendumVoteConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE767858B6CF5F6F7C7B418E /* ReferendumVoteConfirmProtocols.swift */; }; 4448B591D4A193DBC9E2E3BF /* AccountCreateInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A7B39A61DB0D2F0F1B1DBA1 /* AccountCreateInteractor.swift */; }; 4453EA83AD59FFD0EF894D58 /* LedgerNetworkSelectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2915C2DF1B65C5CA6009AC28 /* LedgerNetworkSelectionViewLayout.swift */; }; 44D9F74D7851B874F2045E7E /* LedgerInstructionsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = B14E9691A7628B66958F8744 /* LedgerInstructionsProtocols.swift */; }; 4541F886953E046C16E42997 /* LedgerWalletConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96340EDDE0EAA7F9B6D33E96 /* LedgerWalletConfirmInteractor.swift */; }; 454D41CC5C7CC2FDAB778026 /* CreateWatchOnlyInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D9C85AB0C9D53B522DCF3C5 /* CreateWatchOnlyInteractor.swift */; }; + 46298240F3528B5C62AEC29E /* GovernanceUnlockSetupWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 856BF961EACEB9703B2B37C7 /* GovernanceUnlockSetupWireframe.swift */; }; 47FA7B2E0D9A87E694DA9217 /* LedgerAccountConfirmationProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7E4D8E59F0976D412FF0B10 /* LedgerAccountConfirmationProtocols.swift */; }; 487A912B697604FE3367FAEC /* CrowdloanYourContributionsViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FDF20DCECDEA61E1BDE780B /* CrowdloanYourContributionsViewLayout.swift */; }; + 488E4467895040EA85FDCC79 /* ReferendumDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B727587201B9D6F91A28428A /* ReferendumDetailsViewController.swift */; }; 48D5EFA462A597368024E9ED /* DAppAuthSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97612D61A441A32665C51D23 /* DAppAuthSettingsViewController.swift */; }; 493A9637BE5A1BF4B0744A4C /* ChangeWatchOnlyInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5E4CD58A9006CEB045E8977 /* ChangeWatchOnlyInteractor.swift */; }; 4A520B7081BE2D7604B69354 /* AccountImportWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85F45A5C6145F863760F4409 /* AccountImportWireframe.swift */; }; 4B4189889DEFAF917332D41C /* ChangeWatchOnlyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FECFFBAB264397F9B2646CE /* ChangeWatchOnlyViewController.swift */; }; 4BC33C8DE172AE573AEEDA4F /* WalletsListProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FC21B4670E7B22B787357D /* WalletsListProtocols.swift */; }; 4C165167688A2791643AC667 /* LedgerDiscoverProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A9B9D741BABBCE6C70BE45 /* LedgerDiscoverProtocols.swift */; }; + 4D44B178F1F57FD8607E8095 /* ReferendumVotersViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8602E65CC4E81A7BE1727CE3 /* ReferendumVotersViewLayout.swift */; }; 4E184FFD1532C293BDF6D7C1 /* DAppAuthSettingsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE72F2B6612508D4783A507 /* DAppAuthSettingsProtocols.swift */; }; 4E262D60ACAF44A1FD18FD1D /* TransferConfirmWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF34514F17CE47AF0C5A66F6 /* TransferConfirmWireframe.swift */; }; 4E5CD7B8821FA5298EA1598E /* CrowdloanContributionSetupWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3574BADE9CF77599048C7010 /* CrowdloanContributionSetupWireframe.swift */; }; @@ -212,7 +232,6 @@ 577918C3D4AA22D887F605B5 /* ParaStkStakeSetupPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1AC788C6E0A621B6D88D1BC /* ParaStkStakeSetupPresenter.swift */; }; 57E20F0723C4748D576C4882 /* StakingUnbondSetupViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = A82E373FFFBF708D7CF0973E /* StakingUnbondSetupViewFactory.swift */; }; 5869563D0EA593FBD02C169C /* StakingPayoutConfirmationProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52F8D055D0481469073AA859 /* StakingPayoutConfirmationProtocols.swift */; }; - 5888936B3D13D92F1534E08B /* CrowdloanListViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63F4BE52D0625CD8C21D2460 /* CrowdloanListViewLayout.swift */; }; 58D5B4F17DA37C241FF96A5F /* ParaStkRebondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FDF5963FA924F8C815F3BCF /* ParaStkRebondViewController.swift */; }; 58F693958EF69F59D7C9760E /* StakingRewardPayoutsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4191E0055768541F6A3D8A61 /* StakingRewardPayoutsInteractor.swift */; }; 59745D3C9602745E1417D2F6 /* AssetSelectionInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83AB0AD3A7CECD061611F60C /* AssetSelectionInteractor.swift */; }; @@ -221,6 +240,7 @@ 5B54978244C37502DD592486 /* NftListPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A092ADC09DA0429548EBC08 /* NftListPresenter.swift */; }; 5C796EF8ED29F564B5D1126B /* CrowdloanContributionConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F75722D2F921FD1C2D4105D /* CrowdloanContributionConfirmViewController.swift */; }; 5DDD2206DF795CF205610455 /* AccountExportPasswordPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31226053044986BC828AA912 /* AccountExportPasswordPresenter.swift */; }; + 5E3B1E6B9E94848B186FD4D1 /* ReferendumDetailsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AC65A04352405327BFE946 /* ReferendumDetailsInteractor.swift */; }; 5E621A350A6DDD78597CC9E5 /* CrowdloanYourContributionsWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = B38A4CCD27081CF017AFCD18 /* CrowdloanYourContributionsWireframe.swift */; }; 5E6D69D84220119BA5362358 /* OperationDetailsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F2670E15D23CF30931389E3 /* OperationDetailsProtocols.swift */; }; 5FD7B3463822BC69AF5E3C72 /* ParaStkUnstakeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F711415F7C805D43E83644C6 /* ParaStkUnstakeViewController.swift */; }; @@ -231,6 +251,8 @@ 61B9688494251703A6373A1B /* StakingAmountWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6216F6F1B91F798F07695FB6 /* StakingAmountWireframe.swift */; }; 61E0DC83C1D60D677274D7CE /* AccountExportPasswordViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = E11575D8B4F64C2E805372A5 /* AccountExportPasswordViewFactory.swift */; }; 623474C49445578F030291B0 /* ParaStkStakeSetupWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0B2C32E11E2F7F3D4A1D3AB /* ParaStkStakeSetupWireframe.swift */; }; + 62649D3FB6AACB508872C67A /* GovernanceUnlockConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9638E6EDBA41A5772E0033AE /* GovernanceUnlockConfirmInteractor.swift */; }; + 62B2298F132DB0CE0794DD7A /* ReferendumFullDescriptionWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57E6825E525785A1A12C62E7 /* ReferendumFullDescriptionWireframe.swift */; }; 63185C6D67EAEB2867069AB9 /* ParitySignerWelcomeProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CBB8745F8C36BB107625E8F /* ParitySignerWelcomeProtocols.swift */; }; 640A79BD1335394818E70366 /* WalletHistoryFilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6884DFC1AA1B995C21C274C /* WalletHistoryFilterViewController.swift */; }; 641D7CF89F37B1890516015E /* ParitySignerTxScanProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F10F130391C4B3652FE8F59 /* ParitySignerTxScanProtocols.swift */; }; @@ -259,6 +281,7 @@ 6D315EFF2B664235D297674E /* AccountImportProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = B29514E516CEAAB159851D95 /* AccountImportProtocols.swift */; }; 6D47EAB127FAB7559A9FA107 /* StakingPayoutConfirmationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BACB7E24BC87F9218DBBC4 /* StakingPayoutConfirmationViewController.swift */; }; 6D5851FB5F830D55EFDB8B7D /* StakingUnbondSetupProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23A74BDB54D503FA2BFBEF35 /* StakingUnbondSetupProtocols.swift */; }; + 6D603098CCF0B65AA726AD38 /* GovernanceUnlockConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01B2EBE8C02491A06121705A /* GovernanceUnlockConfirmViewController.swift */; }; 6D61E43A79BDF5EA6CA9E85D /* CrowdloanListWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = C191A3875F3255B72E01FA92 /* CrowdloanListWireframe.swift */; }; 6D622CD4A83EEC1F135B66A8 /* ParitySignerAddConfirmWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC216C4DBF86A9F3ADB3AECF /* ParitySignerAddConfirmWireframe.swift */; }; 6D6C6FD2F13603BCE83CFC65 /* ExportMnemonicConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CC566D6EACB81469B926611 /* ExportMnemonicConfirmInteractor.swift */; }; @@ -270,12 +293,14 @@ 6FDC1CD23BEAF8D4FAF9982D /* NftDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8C4C48E50DC14085258AB6D /* NftDetailsViewController.swift */; }; 7050A26051FE62DB06B695F1 /* ParaStkStakeSetupInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28AD18C155A1278B9B53CFDB /* ParaStkStakeSetupInteractor.swift */; }; 70C0E48EE41B4C7229F5946C /* DAppBrowserViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5278A5F4178922A240590334 /* DAppBrowserViewLayout.swift */; }; + 71533ED31DD45841CA8296A3 /* ReferendumVoteConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD1CAB4467C76E4139ECB1B7 /* ReferendumVoteConfirmViewFactory.swift */; }; 716F0819BAB14322E34E416C /* CrowdloanYourContributionsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF4ED0EE2A3EF620DC51870B /* CrowdloanYourContributionsPresenter.swift */; }; 72EA1D180E99C6C78B87B820 /* LedgerInstructionsViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6747B9F68F9E92845122D8D2 /* LedgerInstructionsViewLayout.swift */; }; 72EF67BA5380D1CDBB73E23F /* ParaStkYieldBoostStartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6475F9C6C6B095B9C5026CE9 /* ParaStkYieldBoostStartViewController.swift */; }; 73B9C322A5033A4534238B25 /* AssetsSearchViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 367393F8CA6157A999F69573 /* AssetsSearchViewLayout.swift */; }; 7401E7CAEEE6890BE74ACCE1 /* CustomValidatorListViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2956D0C69019DDCDAB2EB34 /* CustomValidatorListViewLayout.swift */; }; 7489BDA1D23D8DF73E7EB9BC /* UsernameSetupWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65AD15693E21C869DE1FDD17 /* UsernameSetupWireframe.swift */; }; + 74F470AE889B0E49D9808802 /* ReferendumFullDetailsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 369C65964F4D7E8D02EEC5EC /* ReferendumFullDetailsViewFactory.swift */; }; 7580D432F22904C8F71441FE /* ParitySignerTxScanInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72FEB9C65F32B7A4FD27C9EB /* ParitySignerTxScanInteractor.swift */; }; 7584B6DC2C7F8B2B6671908F /* ParaStkYieldBoostStopViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFF58EC3A44E4DDDFB4B5C84 /* ParaStkYieldBoostStopViewLayout.swift */; }; 75DAB313623E900EC475E215 /* LedgerTxConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCBCB7C3ABB6C06CD4681D44 /* LedgerTxConfirmViewFactory.swift */; }; @@ -290,15 +315,19 @@ 7C93FA82996A426E7B8CA06E /* AccountExportPasswordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27D5AF2F7609ADE855308089 /* AccountExportPasswordViewController.swift */; }; 7CBE9FFAF8394786CA131D4D /* CustomValidatorListProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = F28EDDF9277242505FDDECA1 /* CustomValidatorListProtocols.swift */; }; 7D281FEA78E2E5F44990C184 /* AccountImportPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB8605FD90D8C3553A9897B4 /* AccountImportPresenter.swift */; }; + 7D2906130F25492872637EFC /* ReferendumDetailsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78536852751EF56F58C5691E /* ReferendumDetailsPresenter.swift */; }; 7D707DDD180999C63FD0C4ED /* AssetListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCE26599B4E43DC4CE520528 /* AssetListViewController.swift */; }; 7D7D40581C276D60713822E9 /* ParaStkCollatorFiltersPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39503B664F159E5D07FF6281 /* ParaStkCollatorFiltersPresenter.swift */; }; + 7DB7E81CC2F880E4736DE062 /* GovernanceUnlockConfirmViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE81AE154A736A93FF3812B /* GovernanceUnlockConfirmViewLayout.swift */; }; 7E1A03082260E0D31AD394CA /* StakingRewardDetailsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF891BE39D442C2D06DDF3BB /* StakingRewardDetailsProtocols.swift */; }; + 7E2800371BE3B166F3475E90 /* ReferendumVoteSetupPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6CCACED8D5AFA6543845B7 /* ReferendumVoteSetupPresenter.swift */; }; 7E5ACF8DDF17C054E6E1B3D5 /* ParaStkYieldBoostSetupWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C2B3C9875FDA7EE8D168900 /* ParaStkYieldBoostSetupWireframe.swift */; }; 7F5B03517FD0144F7EDE1015 /* YourWalletsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF7A019F89C6CD418AEEE79C /* YourWalletsPresenter.swift */; }; 7FF2D6FEDD352AC51E1DBB3B /* OperationDetailsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2A26EC9537BD4275A03272 /* OperationDetailsPresenter.swift */; }; 800FCAF66DC8A24020D16A9C /* AccountExportPasswordInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 194C9BFEE9BA8C9E448D79AA /* AccountExportPasswordInteractor.swift */; }; 8027EA456C0C13F6DA73D540 /* MoonbeamTermsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 837E9D1F8096A0E9CA0E0CEB /* MoonbeamTermsPresenter.swift */; }; 80E265DD62D96597E4EAA44A /* Pods_novawalletTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D79EAD799CBB1ABB9541A232 /* Pods_novawalletTests.framework */; }; + 811096BAAA6BD237DF2769EA /* ReferendumVoteSetupViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF755EE09598254BB5E59CC2 /* ReferendumVoteSetupViewFactory.swift */; }; 81544BD01F6AD0197588D3C5 /* OperationDetailsWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DC6917929E4A752B79FE554 /* OperationDetailsWireframe.swift */; }; 821518375113295E41E0481C /* ParitySignerTxQrViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B56BDC7E6221DE292498D3A /* ParitySignerTxQrViewFactory.swift */; }; 8217DCBEB74527D57AC82070 /* ParaStkStakeConfirmViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10E27EB6FF31F9D247DEFABB /* ParaStkStakeConfirmViewLayout.swift */; }; @@ -322,8 +351,14 @@ 8401AEC82642A71D000B03E3 /* StakingRebondConfirmationProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8401AEBF2642A71D000B03E3 /* StakingRebondConfirmationProtocols.swift */; }; 8401F24F24E524900081D8F8 /* String+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8401F24E24E524900081D8F8 /* String+Helpers.swift */; }; 8402CC9C275B92AC00E5BF30 /* ControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8402CC9B275B92AC00E5BF30 /* ControlView.swift */; }; - 8402CC9E275B946100E5BF30 /* DAppItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8402CC9D275B946100E5BF30 /* DAppItemView.swift */; }; + 8402CC9E275B946100E5BF30 /* DAppItemViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8402CC9D275B946100E5BF30 /* DAppItemViewCell.swift */; }; + 840302DE292CE3EA0013F356 /* StorageEntryMetadata+TypeCheck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840302DD292CE3EA0013F356 /* StorageEntryMetadata+TypeCheck.swift */; }; + 840302E0292CE4030013F356 /* CodingFactory+TypeCheck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840302DF292CE4030013F356 /* CodingFactory+TypeCheck.swift */; }; + 840302E4292CFCF90013F356 /* AssetSelectionBasePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840302E3292CFCF90013F356 /* AssetSelectionBasePresenter.swift */; }; + 840302E8292D00380013F356 /* GovernanceAssetSelectionPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840302E7292D00380013F356 /* GovernanceAssetSelectionPresenter.swift */; }; 84031C17263EC95C008FD9D4 /* SetPayeeCall.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84031C16263EC95C008FD9D4 /* SetPayeeCall.swift */; }; + 84033055290FD745009C18E6 /* ReferendumsUnlocksViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84033054290FD745009C18E6 /* ReferendumsUnlocksViewModel.swift */; }; + 84033057290FD8AB009C18E6 /* ReferendumsUnlocksTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84033056290FD8AB009C18E6 /* ReferendumsUnlocksTableViewCell.swift */; }; 84038FEC26FFBA4D00C73F3F /* PriceLocalStorageSubscriber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84038FEB26FFBA4D00C73F3F /* PriceLocalStorageSubscriber.swift */; }; 84038FEE26FFBA6200C73F3F /* PriceLocalSubscriptionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84038FED26FFBA6200C73F3F /* PriceLocalSubscriptionHandler.swift */; }; 84038FF026FFBE0600C73F3F /* JsonLocalStorageSubscriber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84038FEF26FFBE0600C73F3F /* JsonLocalStorageSubscriber.swift */; }; @@ -397,6 +432,12 @@ 8411707A285B10F5006F4DFB /* XcmAssetTransferFee.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84117079285B10F5006F4DFB /* XcmAssetTransferFee.swift */; }; 8411707C285B1214006F4DFB /* XcmTransfers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8411707B285B1214006F4DFB /* XcmTransfers.swift */; }; 8411707F285B15E0006F4DFB /* XcmTransfersSyncService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8411707E285B15E0006F4DFB /* XcmTransfersSyncService.swift */; }; + 8412219B28F04EA600715C82 /* GovMetadataLocalSubscriptionFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8412219A28F04EA600715C82 /* GovMetadataLocalSubscriptionFactory.swift */; }; + 8412219E28F0514400715C82 /* ReferendumsMetadataPreviewProviderSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8412219D28F0514400715C82 /* ReferendumsMetadataPreviewProviderSource.swift */; }; + 841221A028F051EE00715C82 /* GovMetadataLocalStorageSubscriber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8412219F28F051EE00715C82 /* GovMetadataLocalStorageSubscriber.swift */; }; + 841221A228F0520300715C82 /* GovMetadataLocalStorageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841221A128F0520300715C82 /* GovMetadataLocalStorageHandler.swift */; }; + 841221A428F0A3F200715C82 /* ReferendumAccountVoteLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841221A328F0A3F200715C82 /* ReferendumAccountVoteLocal.swift */; }; + 841221A628F13BA100715C82 /* GovernanceServiceFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841221A528F13BA100715C82 /* GovernanceServiceFactory.swift */; }; 8412AF992789AB76008A6C22 /* PolkadotExtensionMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8412AF982789AB76008A6C22 /* PolkadotExtensionMetadata.swift */; }; 8412AF9B2789ABBC008A6C22 /* PolkadotExtensionMetadataResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8412AF9A2789ABBC008A6C22 /* PolkadotExtensionMetadataResponse.swift */; }; 841493DC2604C144000D8D1A /* SubscanRewardData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841493DB2604C144000D8D1A /* SubscanRewardData.swift */; }; @@ -487,6 +528,14 @@ 84243095265B1888003E07EC /* CrowdloanMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84243094265B1888003E07EC /* CrowdloanMetadata.swift */; }; 8424A8C7262EC0E50091BFB1 /* PayoutInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8424A8C6262EC0E50091BFB1 /* PayoutInfo.swift */; }; 8424DB0B26B8466A008C834F /* ValidatorOperationFactoryProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8424DB0A26B8466A008C834F /* ValidatorOperationFactoryProtocol.swift */; }; + 8425D0E028FE738D003B782A /* ReferendumVoteSetupInteractorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425D0DF28FE738D003B782A /* ReferendumVoteSetupInteractorError.swift */; }; + 8425D0E328FE766B003B782A /* ReferendumVoteProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425D0E228FE766B003B782A /* ReferendumVoteProtocols.swift */; }; + 8425D0E628FE82CB003B782A /* ReferendumVoteInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425D0E528FE82CB003B782A /* ReferendumVoteInteractor.swift */; }; + 8425D0E828FE8356003B782A /* ReferendumVoteInteractorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425D0E728FE8356003B782A /* ReferendumVoteInteractorError.swift */; }; + 8425D0EA28FE9A45003B782A /* GovernanceExtrinsicFactoryProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425D0E928FE9A45003B782A /* GovernanceExtrinsicFactoryProtocol.swift */; }; + 8425D0EC28FE9ACB003B782A /* Gov2ExtrinsicFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425D0EB28FE9ACB003B782A /* Gov2ExtrinsicFactory.swift */; }; + 8425D0EE28FE9BF1003B782A /* ReferendumVoteAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425D0ED28FE9BF1003B782A /* ReferendumVoteAction.swift */; }; + 8425D0F028FE9CF0003B782A /* ConvictionVoting+Call.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425D0EF28FE9CF0003B782A /* ConvictionVoting+Call.swift */; }; 8425EA8B25EA7AF200C307C9 /* UnappliedSlashes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425EA8A25EA7AF200C307C9 /* UnappliedSlashes.swift */; }; 8425EA9025EA7E5800C307C9 /* ElectedValidatorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425EA8F25EA7E5800C307C9 /* ElectedValidatorInfo.swift */; }; 8425EA9525EA82CE00C307C9 /* AccountIdentity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8425EA9425EA82CE00C307C9 /* AccountIdentity.swift */; }; @@ -498,6 +547,10 @@ 84264EE1285B6C6700BF6D4A /* XcmTransfersSyncTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84264EE0285B6C6700BF6D4A /* XcmTransfersSyncTests.swift */; }; 84265E042523D20A005EEE2D /* WalletBaseAmountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84265E032523D20A005EEE2D /* WalletBaseAmountView.swift */; }; 84265E062523D7BE005EEE2D /* WalletInputAmountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84265E052523D7BE005EEE2D /* WalletInputAmountView.swift */; }; + 8427495128FEB6E500B2B70B /* GovernanceLockState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8427495028FEB6E500B2B70B /* GovernanceLockState.swift */; }; + 8427495328FEB8C800B2B70B /* ReferendumNewVote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8427495228FEB8C800B2B70B /* ReferendumNewVote.swift */; }; + 8427495528FEB92700B2B70B /* GovernanceLockStateFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8427495428FEB92700B2B70B /* GovernanceLockStateFactory.swift */; }; + 8427495728FEBFA400B2B70B /* ConvictionVoting+ConstantPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8427495628FEBFA400B2B70B /* ConvictionVoting+ConstantPath.swift */; }; 84274B8127A19AFF00A26657 /* OrmlTokenTransfer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84274B8027A19AFF00A26657 /* OrmlTokenTransfer.swift */; }; 842806F32847A51400702F3A /* AccountDetailsSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842806F22847A51400702F3A /* AccountDetailsSelectionView.swift */; }; 842806F52847A82500702F3A /* StackAccountSelectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842806F42847A82500702F3A /* StackAccountSelectionCell.swift */; }; @@ -647,6 +700,12 @@ 843461CD26E2596E00DCE0CD /* WalletRemoteHistoryFiltering.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461CC26E2596E00DCE0CD /* WalletRemoteHistoryFiltering.swift */; }; 843461CF26E25AD400DCE0CD /* SubscanHistoryItem+Wallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461CE26E25AD400DCE0CD /* SubscanHistoryItem+Wallet.swift */; }; 843461D126E2641500DCE0CD /* SubqueryRewardOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461D026E2641500DCE0CD /* SubqueryRewardOperationFactory.swift */; }; + 843461E8290BF14400379936 /* ReferendumsSorting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461E7290BF14400379936 /* ReferendumsSorting.swift */; }; + 843461EA290C04C400379936 /* Gov2OperationFactory+Protocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461E9290C04C400379936 /* Gov2OperationFactory+Protocol.swift */; }; + 843461EC290D0D9400379936 /* GovernanceUnlockSchedule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461EB290D0D9400379936 /* GovernanceUnlockSchedule.swift */; }; + 843461F5290E4A1C00379936 /* GovernanceUnlocksCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461F4290E4A1C00379936 /* GovernanceUnlocksCalculator.swift */; }; + 843461F7290E4AF500379936 /* GovUnlocksCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461F6290E4AF500379936 /* GovUnlocksCalculator.swift */; }; + 843461FA290E55D100379936 /* GovernanceUnlocksTestBuilding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843461F9290E55D100379936 /* GovernanceUnlocksTestBuilding.swift */; }; 8434C9E425401EF3009E4191 /* TransactionHistoryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8434C9E325401EF3009E4191 /* TransactionHistoryItem.swift */; }; 8434C9E625403686009E4191 /* CDTransactionHistoryItem+CoreDataDecodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8434C9E525403686009E4191 /* CDTransactionHistoryItem+CoreDataDecodable.swift */; }; 8434C9EA2540AE51009E4191 /* ExtrinsicEraTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8434C9E92540AE51009E4191 /* ExtrinsicEraTests.swift */; }; @@ -688,6 +747,7 @@ 8436EDE225895804004D9E97 /* RampProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8436EDE125895804004D9E97 /* RampProvider.swift */; }; 8436EDE725895846004D9E97 /* PurchaseProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8436EDE625895846004D9E97 /* PurchaseProvider.swift */; }; 8436EDEF25896722004D9E97 /* PurchaseAggregator+Default.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8436EDEE25896722004D9E97 /* PurchaseAggregator+Default.swift */; }; + 8438432E2913B3150048595C /* Gov1OperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8438432D2913B3150048595C /* Gov1OperationFactory.swift */; }; 8438C45B2655AC2600047E3F /* runtime-rococo.json in Resources */ = {isa = PBXBuildFile; fileRef = 8438C45A2655AC2600047E3F /* runtime-rococo.json */; }; 8438E1D224BFAAD2001BDB13 /* JSONRPCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8438E1D124BFAAD2001BDB13 /* JSONRPCTests.swift */; }; 843910B0253ED36C00E3C217 /* ChainStorageItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843910AF253ED36C00E3C217 /* ChainStorageItem.swift */; }; @@ -714,6 +774,7 @@ 843A2C7326A8641400266F53 /* MultiValueView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843A2C7226A8641400266F53 /* MultiValueView.swift */; }; 843A2C7726A86FD000266F53 /* TitleStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843A2C7626A86FD000266F53 /* TitleStatusView.swift */; }; 843B1D7A263EED5C00AF8957 /* StakingUnbondConfirmLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843B1D79263EED5C00AF8957 /* StakingUnbondConfirmLayout.swift */; }; + 843B6F4F28EEEF610086D4E0 /* Gov2OperationFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843B6F4E28EEEF610086D4E0 /* Gov2OperationFactoryTests.swift */; }; 843C49D824DD98CC00B71DDA /* DerivationPathConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843C49D724DD98CC00B71DDA /* DerivationPathConstants.swift */; }; 843C49DB24DF373000B71DDA /* AccountImportRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843C49DA24DF373000B71DDA /* AccountImportRequest.swift */; }; 843C49DF24DF3CB300B71DDA /* AccountImportMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843C49DE24DF3CB300B71DDA /* AccountImportMetadata.swift */; }; @@ -738,6 +799,19 @@ 844138EC2830106C00AFEF6D /* ParaStkNetworkInfoViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844138EB2830106B00AFEF6D /* ParaStkNetworkInfoViewModelFactory.swift */; }; 844138EE28303A2E00AFEF6D /* ParaStkStateViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844138ED28303A2E00AFEF6D /* ParaStkStateViewModelFactory.swift */; }; 84415BCA26E783EB005A3683 /* PayoutValidatorsForNominatorFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84415BC926E783EB005A3683 /* PayoutValidatorsForNominatorFactory.swift */; }; + 8442002028E6FDBE00C49C4A /* CrowdloanListViewManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442001F28E6FDBE00C49C4A /* CrowdloanListViewManager.swift */; }; + 8442002328E6FE1E00C49C4A /* ReferendumsViewManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442002228E6FE1E00C49C4A /* ReferendumsViewManager.swift */; }; + 8442002528E6FEEE00C49C4A /* ReferendumsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442002428E6FEEE00C49C4A /* ReferendumsProtocols.swift */; }; + 8442002728E6FFBA00C49C4A /* VoteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442002628E6FFBA00C49C4A /* VoteViewController.swift */; }; + 8442002928E7004B00C49C4A /* VoteViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442002828E7004B00C49C4A /* VoteViewLayout.swift */; }; + 8442002B28E9ACDB00C49C4A /* VotePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442002A28E9ACDB00C49C4A /* VotePresenter.swift */; }; + 8442002D28E9ADB500C49C4A /* VoteInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442002C28E9ADB500C49C4A /* VoteInteractor.swift */; }; + 8442002F28E9AEFB00C49C4A /* VoteWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442002E28E9AEFB00C49C4A /* VoteWireframe.swift */; }; + 8442003428E9BD3200C49C4A /* VoteChildPresenterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442003328E9BD3200C49C4A /* VoteChildPresenterFactory.swift */; }; + 8442003628EA9DF100C49C4A /* VoteViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442003528EA9DF100C49C4A /* VoteViewFactory.swift */; }; + 8442003828EAA16600C49C4A /* ReferendumsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442003728EAA16600C49C4A /* ReferendumsPresenter.swift */; }; + 8442003A28EAA2D400C49C4A /* ReferendumsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442003928EAA2D300C49C4A /* ReferendumsInteractor.swift */; }; + 8442003C28EAA2E400C49C4A /* ReferendumsWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8442003B28EAA2E400C49C4A /* ReferendumsWireframe.swift */; }; 844384AC28538D3000611CE2 /* RewardCalculatorEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844384AB28538D3000611CE2 /* RewardCalculatorEngine.swift */; }; 844384AE28538F4700611CE2 /* UniformCurveRewardEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844384AD28538F4700611CE2 /* UniformCurveRewardEngine.swift */; }; 844384B0285391D800611CE2 /* RewardCalculatorEngineFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844384AF285391D800611CE2 /* RewardCalculatorEngineFactory.swift */; }; @@ -789,6 +863,7 @@ 8446F5F6281916D300B7A86C /* StakingRewardsHeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8446F5F5281916D300B7A86C /* StakingRewardsHeaderCell.swift */; }; 8446F5F82819235B00B7A86C /* AssetIconView+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8446F5F72819235B00B7A86C /* AssetIconView+Style.swift */; }; 8446F5FA28192FF500B7A86C /* ListLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8446F5F928192FF500B7A86C /* ListLoadingView.swift */; }; + 8448148128E46881007F64FF /* ConvictionVotingLocks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8448148028E46881007F64FF /* ConvictionVotingLocks.swift */; }; 8448221826B1624E007F4492 /* SelectValidatorsConfirmViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8448221726B1624E007F4492 /* SelectValidatorsConfirmViewLayout.swift */; }; 8448221C26B1850D007F4492 /* TitleIconViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8448221B26B1850D007F4492 /* TitleIconViewModel.swift */; }; 8448336727FAAF780077FB55 /* TransakProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8448336627FAAF780077FB55 /* TransakProvider.swift */; }; @@ -855,8 +930,15 @@ 8452585127ABC531004F9082 /* AssetsManageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8452585027ABC531004F9082 /* AssetsManageViewModel.swift */; }; 8452585327ABCA07004F9082 /* HideZeroBalancesChanged.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8452585227ABCA07004F9082 /* HideZeroBalancesChanged.swift */; }; 8452585527ABF270004F9082 /* AssetListEmptyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8452585427ABF270004F9082 /* AssetListEmptyCell.swift */; }; + 84532D5D28E41D8500EF4ADC /* ConvictionVoting+StoragePath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84532D5C28E41D8500EF4ADC /* ConvictionVoting+StoragePath.swift */; }; + 84532D5F28E4210E00EF4ADC /* ConvictionVotesFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84532D5E28E4210E00EF4ADC /* ConvictionVotesFetchTests.swift */; }; + 84532D6128E4234700EF4ADC /* ConvictionVotingForKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84532D6028E4234700EF4ADC /* ConvictionVotingForKey.swift */; }; 845353BB2886E3B4006C871A /* OnboardingMainViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845353BA2886E3B4006C871A /* OnboardingMainViewLayout.swift */; }; 845353BD2886EB1A006C871A /* ButtonLargeControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845353BC2886EB1A006C871A /* ButtonLargeControl.swift */; }; + 8453DE5528FD24FF0055345C /* GovernanceSubscriptionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8453DE5428FD24FF0055345C /* GovernanceSubscriptionProtocol.swift */; }; + 8453DE5728FD27390055345C /* Gov2SubscriptionFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8453DE5628FD27390055345C /* Gov2SubscriptionFactory.swift */; }; + 8453DE5928FD32780055345C /* NotEqualWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8453DE5828FD32780055345C /* NotEqualWrapper.swift */; }; + 8453DE5B28FD32B50055345C /* StorageSubscriptionObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8453DE5A28FD32B50055345C /* StorageSubscriptionObserver.swift */; }; 8454C21D2632A78900657DAD /* EventRecord.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454C21C2632A78900657DAD /* EventRecord.swift */; }; 8454C2652632B0EF00657DAD /* EventCodingPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454C2642632B0EF00657DAD /* EventCodingPath.swift */; }; 8454C26A2632B8CE00657DAD /* BalanceDepositEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454C2692632B8CE00657DAD /* BalanceDepositEvent.swift */; }; @@ -864,6 +946,8 @@ 8454C2832632FC2500657DAD /* ExtrinsicProcessingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454C2822632FC2500657DAD /* ExtrinsicProcessingTests.swift */; }; 845532D02684690D00C2645D /* ParachainSlotLease.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845532CF2684690D00C2645D /* ParachainSlotLease.swift */; }; 845532D226846B6800C2645D /* ParachainLeaseInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845532D126846B6800C2645D /* ParachainLeaseInfo.swift */; }; + 8455AB4528F7F05400974E88 /* ReferendumStatusViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8455AB4428F7F05400974E88 /* ReferendumStatusViewModelFactory.swift */; }; + 8455AB4A28F80D9300974E88 /* ReferendumTrackType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8455AB4928F80D9300974E88 /* ReferendumTrackType.swift */; }; 84563D0924F46B7F0055591D /* ManagedAccountItemMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84563D0824F46B7F0055591D /* ManagedAccountItemMapperTests.swift */; }; 8456C08227CF9DC9001282DE /* RemoteNftModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8456C08127CF9DC9001282DE /* RemoteNftModel.swift */; }; 8456C08427CFA4A7001282DE /* ImagePlaceholderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8456C08327CFA4A7001282DE /* ImagePlaceholderView.swift */; }; @@ -872,6 +956,37 @@ 8459A9C827469E4B000D6278 /* AcalaContributionSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8459A9C727469E4B000D6278 /* AcalaContributionSource.swift */; }; 8459A9CA2746A1BC000D6278 /* CrowdloanOffchainSubscriber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8459A9C92746A1BC000D6278 /* CrowdloanOffchainSubscriber.swift */; }; 8459A9CC2746A1E9000D6278 /* CrowdloanOffchainSubscriptionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8459A9CB2746A1E9000D6278 /* CrowdloanOffchainSubscriptionHandler.swift */; }; + 845AADA12902D02400B5AE96 /* TitleValueDiffView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845AADA02902D02400B5AE96 /* TitleValueDiffView.swift */; }; + 845AADA32902D1EB00B5AE96 /* StackTitleValueDiffCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845AADA22902D1EA00B5AE96 /* StackTitleValueDiffCell.swift */; }; + 845AADA62903B32E00B5AE96 /* ReferendumVoteConfirmError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845AADA52903B32E00B5AE96 /* ReferendumVoteConfirmError.swift */; }; + 845B07EB29159190005785D3 /* Democracy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07EA29159190005785D3 /* Democracy.swift */; }; + 845B07ED291594E1005785D3 /* DemocracyReferendum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07EC291594E1005785D3 /* DemocracyReferendum.swift */; }; + 845B07EF2915951A005785D3 /* DemocracyVoteThreshold.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07EE2915951A005785D3 /* DemocracyVoteThreshold.swift */; }; + 845B07F129159AE7005785D3 /* DemocracyVoting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07F029159AE7005785D3 /* DemocracyVoting.swift */; }; + 845B07F329159C15005785D3 /* Democracy+CodingPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07F229159C15005785D3 /* Democracy+CodingPath.swift */; }; + 845B07F5291627A3005785D3 /* Gov1OperationFactory+Protocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07F4291627A3005785D3 /* Gov1OperationFactory+Protocol.swift */; }; + 845B07F729162AB3005785D3 /* Democracy+ConstantPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07F629162AB3005785D3 /* Democracy+ConstantPath.swift */; }; + 845B07F929162D24005785D3 /* Gov1LocalMappingFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07F829162D24005785D3 /* Gov1LocalMappingFactory.swift */; }; + 845B07FD291634D4005785D3 /* DemocracyDecidingFunctionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07FC291634D4005785D3 /* DemocracyDecidingFunctionProtocol.swift */; }; + 845B07FF2916F529005785D3 /* Gov1SubscriptionFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B07FE2916F529005785D3 /* Gov1SubscriptionFactory.swift */; }; + 845B08012918406A005785D3 /* Gov2ActionOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B08002918406A005785D3 /* Gov2ActionOperationFactory.swift */; }; + 845B08042918C308005785D3 /* Gov1ActionOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B08032918C308005785D3 /* Gov1ActionOperationFactory.swift */; }; + 845B08062918C3FB005785D3 /* DemocracyProposalCall.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B08052918C3FB005785D3 /* DemocracyProposalCall.swift */; }; + 845B08082918C8DA005785D3 /* RemoteStorageSizeRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B08072918C8DA005785D3 /* RemoteStorageSizeRequest.swift */; }; + 845B080A2918D381005785D3 /* Gov1ExtrinsicFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B08092918D381005785D3 /* Gov1ExtrinsicFactory.swift */; }; + 845B080D2918D4F8005785D3 /* Democracy+Call.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B080C2918D4F8005785D3 /* Democracy+Call.swift */; }; + 845B08102918D65E005785D3 /* GovernanceExtrinsicFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B080F2918D65E005785D3 /* GovernanceExtrinsicFactory.swift */; }; + 845B08132918FF98005785D3 /* Gov2UnlockReferendum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B08122918FF98005785D3 /* Gov2UnlockReferendum.swift */; }; + 845B081529190056005785D3 /* Gov1UnlockReferendum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B081429190056005785D3 /* Gov1UnlockReferendum.swift */; }; + 845B0817291902CF005785D3 /* Gov2LockStateFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B0816291902CF005785D3 /* Gov2LockStateFactory.swift */; }; + 845B0819291905CA005785D3 /* Gov1LockStateFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B0818291905CA005785D3 /* Gov1LockStateFactory.swift */; }; + 845B811228F429BB0040CE84 /* SupportPallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B811128F429BB0040CE84 /* SupportPallet.swift */; }; + 845B811528F43C350040CE84 /* Treasury.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B811428F43C350040CE84 /* Treasury.swift */; }; + 845B811728F43C730040CE84 /* TreasuryProposal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B811628F43C730040CE84 /* TreasuryProposal.swift */; }; + 845B811928F43D4C0040CE84 /* Treasury+CodingPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B811828F43D4C0040CE84 /* Treasury+CodingPath.swift */; }; + 845B811B28F445E90040CE84 /* Treasury+Calls.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B811A28F445E90040CE84 /* Treasury+Calls.swift */; }; + 845B811D28F44A700040CE84 /* ReferendumActionLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B811C28F44A700040CE84 /* ReferendumActionLocal.swift */; }; + 845B811F28F451A40040CE84 /* GovernanceActionOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B811E28F451A40040CE84 /* GovernanceActionOperationFactory.swift */; }; 845B821526EF657700D25C72 /* PersistentValueSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B821426EF657700D25C72 /* PersistentValueSettings.swift */; }; 845B821726EF7FED00D25C72 /* SelectedWalletSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B821626EF7FED00D25C72 /* SelectedWalletSettings.swift */; }; 845B821926EF808D00D25C72 /* MetaAccountMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845B821826EF808D00D25C72 /* MetaAccountMapper.swift */; }; @@ -968,6 +1083,8 @@ 8467FD5824EFD5C2005D486C /* CDAccountItem+CoreDataDecodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8467FD5724EFD5C2005D486C /* CDAccountItem+CoreDataDecodable.swift */; }; 8467FD5C24EFDCC9005D486C /* UserDataStorageTestFacade.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8467FD5B24EFDCC9005D486C /* UserDataStorageTestFacade.swift */; }; 846802A3265DA5530034F9B5 /* CrowdloanContributionSetupViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846802A2265DA5530034F9B5 /* CrowdloanContributionSetupViewModel.swift */; }; + 8468119428E6234B00BF54F1 /* RoundedSegmentedControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8468119328E6234B00BF54F1 /* RoundedSegmentedControl.swift */; }; + 8468119728E6C90F00BF54F1 /* VoteProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8468119628E6C90F00BF54F1 /* VoteProtocols.swift */; }; 8468B86524F59D1D00B76BC6 /* IconTitleHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8468B86424F59D1D00B76BC6 /* IconTitleHeaderView.swift */; }; 8468B86A24F63CBA00B76BC6 /* AddAccount+AccountImportInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8468B86924F63CBA00B76BC6 /* AddAccount+AccountImportInteractor.swift */; }; 8468B86C24F63CEF00B76BC6 /* AddAccount+AccountConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8468B86B24F63CEF00B76BC6 /* AddAccount+AccountConfirmInteractor.swift */; }; @@ -985,6 +1102,7 @@ 846952A62852A1E60083E0B4 /* AuraStakingDurationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846952A52852A1E60083E0B4 /* AuraStakingDurationFactory.swift */; }; 8469936B26CD1BBE002CC786 /* RuntimePoolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8469936A26CD1BBE002CC786 /* RuntimePoolTests.swift */; }; 8469D5A628F5E8F20074FEE3 /* Staking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8469D5A528F5E8F20074FEE3 /* Staking.swift */; }; + 8469D5A828F683930074FEE3 /* ReferendumDetailsInteractorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8469D5A728F683930074FEE3 /* ReferendumDetailsInteractorError.swift */; }; 846A2601267C768500429A7F /* CrowdloanContributionMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846A2600267C768500429A7F /* CrowdloanContributionMapper.swift */; }; 846A2606267C792000429A7F /* CrowdloanContributionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846A2605267C792000429A7F /* CrowdloanContributionResponse.swift */; }; 846A2C4325271CDE00731018 /* TransactionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846A2C4225271CDE00731018 /* TransactionType.swift */; }; @@ -1051,6 +1169,11 @@ 847119D5262EF95A00716580 /* PayoutInfoFactoryProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847119D4262EF95A00716580 /* PayoutInfoFactoryProtocol.swift */; }; 847119EB262EFF3800716580 /* ValidatorPayoutInfoFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847119EA262EFF3800716580 /* ValidatorPayoutInfoFactory.swift */; }; 8471538D2653B29100CB91D8 /* ChangeRewardDestinationViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8471538C2653B29100CB91D8 /* ChangeRewardDestinationViewModelFactory.swift */; }; + 8471577B2910F0AF00D7D003 /* GovernanceUnlockInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8471577A2910F0AF00D7D003 /* GovernanceUnlockInteractor.swift */; }; + 8471577D2910F18300D7D003 /* GovernanceUnlockProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8471577C2910F18300D7D003 /* GovernanceUnlockProtocols.swift */; }; + 847157802910F30500D7D003 /* GovernanceUnlockInteractorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8471577F2910F30500D7D003 /* GovernanceUnlockInteractorError.swift */; }; + 84715783291132B400D7D003 /* GovernanceUnlockTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84715782291132B400D7D003 /* GovernanceUnlockTableViewCell.swift */; }; + 84715786291136B100D7D003 /* GovernanceUnlocksViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84715785291136B100D7D003 /* GovernanceUnlocksViewModel.swift */; }; 8471825F2846A8E2002C5720 /* ActionManageTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8471825E2846A8E2002C5720 /* ActionManageTableViewCell.swift */; }; 8472072E277C203A00F593DD /* UICollectionView+Reuse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8472072D277C203A00F593DD /* UICollectionView+Reuse.swift */; }; 84720730277C335000F593DD /* DAppListFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8472072F277C335000F593DD /* DAppListFlowLayout.swift */; }; @@ -1087,6 +1210,7 @@ 8473F4B6282BE488007CC55A /* StakingRelaychainProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8473F4B5282BE488007CC55A /* StakingRelaychainProtocols.swift */; }; 8473F4B8282BFFF8007CC55A /* StakingRelaychainInteractor+Subscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8473F4B7282BFFF8007CC55A /* StakingRelaychainInteractor+Subscription.swift */; }; 8473F4BA282C012B007CC55A /* StakingRelaychainInteractor+InputProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8473F4B9282C012B007CC55A /* StakingRelaychainInteractor+InputProtocol.swift */; }; + 84741ADF290F116B00C98E17 /* Gov2UnlockScheduleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84741ADE290F116B00C98E17 /* Gov2UnlockScheduleTests.swift */; }; 847449512891F3B00042FD80 /* WalletSwitchControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847449502891F3B00042FD80 /* WalletSwitchControl.swift */; }; 84744953289268770042FD80 /* WalletSwitchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84744952289268770042FD80 /* WalletSwitchViewModel.swift */; }; 84744955289284F50042FD80 /* StakingMainViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84744954289284F50042FD80 /* StakingMainViewLayout.swift */; }; @@ -1106,6 +1230,10 @@ 8476D39D27F44E73004D9A7A /* PhishingSiteVerifier+Init.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8476D39C27F44E73004D9A7A /* PhishingSiteVerifier+Init.swift */; }; 8476D39F27F4582A004D9A7A /* DAppMetamaskPhishingDetectedState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8476D39E27F4582A004D9A7A /* DAppMetamaskPhishingDetectedState.swift */; }; 8476D3A127F4598D004D9A7A /* DAppBrowserPhishingDetectedState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8476D3A027F4598D004D9A7A /* DAppBrowserPhishingDetectedState.swift */; }; + 84770F25291F72D700852A33 /* ReferendumVotingInitData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84770F24291F72D700852A33 /* ReferendumVotingInitData.swift */; }; + 84770F27291F7CD400852A33 /* ReferendumDetailsInitData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84770F26291F7CD400852A33 /* ReferendumDetailsInitData.swift */; }; + 84770F2A291F864500852A33 /* GovernanceUnlockInitData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84770F29291F864500852A33 /* GovernanceUnlockInitData.swift */; }; + 84770F2C291F893200852A33 /* GovernanceUnlockConfirmInitData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84770F2B291F893200852A33 /* GovernanceUnlockConfirmInitData.swift */; }; 8477DAA32888329800129B45 /* watchOnlyPreset.json in Resources */ = {isa = PBXBuildFile; fileRef = 8477DAA22888329800129B45 /* watchOnlyPreset.json */; }; 8477DAA6288832CB00129B45 /* WatchOnlyPresetRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8477DAA5288832CB00129B45 /* WatchOnlyPresetRepository.swift */; }; 84786DA825F9F58E0089DFF7 /* EraValidatorService+Fetch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84786DA725F9F58E0089DFF7 /* EraValidatorService+Fetch.swift */; }; @@ -1128,6 +1256,10 @@ 847A25BB28D7BB92006AC9F5 /* ExtrinsicProcessor+Events.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A25BA28D7BB92006AC9F5 /* ExtrinsicProcessor+Events.swift */; }; 847A25BD28D7C0E7006AC9F5 /* TokenTransferedEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A25BC28D7C0E7006AC9F5 /* TokenTransferedEvent.swift */; }; 847A25BF28D7C2A2006AC9F5 /* AccountIdCodingWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A25BE28D7C2A2006AC9F5 /* AccountIdCodingWrapper.swift */; }; + 847A25C328D84A9C006AC9F5 /* ReferendumFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A25C228D84A9C006AC9F5 /* ReferendumFetchTests.swift */; }; + 847A25C628D84BE2006AC9F5 /* Referenda.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A25C528D84BE2006AC9F5 /* Referenda.swift */; }; + 847A25C828D84C0A006AC9F5 /* Referenda+CodingPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A25C728D84C0A006AC9F5 /* Referenda+CodingPath.swift */; }; + 847A25CA28D85204006AC9F5 /* ReferendumInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A25C928D85204006AC9F5 /* ReferendumInfo.swift */; }; 847A6C0928817DC700477F77 /* AssetListBaseInteractorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A6C0828817DC700477F77 /* AssetListBaseInteractorProtocol.swift */; }; 847A6C0B28817E4000477F77 /* AssetListBaseInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A6C0A28817E4000477F77 /* AssetListBaseInteractor.swift */; }; 847ABE3128532E1B00851218 /* ConsesusType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847ABE3028532E1B00851218 /* ConsesusType.swift */; }; @@ -1168,7 +1300,16 @@ 8482F62F280C618B0006C3A0 /* DAppAuthSettingsTableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8482F62E280C618B0006C3A0 /* DAppAuthSettingsTableCell.swift */; }; 8482F63128101FB10006C3A0 /* DAppEthereumSignBytesInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8482F63028101FB10006C3A0 /* DAppEthereumSignBytesInteractor.swift */; }; 8482F633281024B80006C3A0 /* Data+EthereumSign.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8482F632281024B80006C3A0 /* Data+EthereumSign.swift */; }; + 8483B15128F93A080048B295 /* ReferendumVotersType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8483B15028F93A080048B295 /* ReferendumVotersType.swift */; }; + 8483B15328F940080048B295 /* ReferendumVotersModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8483B15228F940080048B295 /* ReferendumVotersModel.swift */; }; + 8483B15528F9406C0048B295 /* ReferendumVotersInteractorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8483B15428F9406C0048B295 /* ReferendumVotersInteractorError.swift */; }; + 8483B15828F98C9F0048B295 /* ReferendumVotersViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8483B15728F98C9F0048B295 /* ReferendumVotersViewModel.swift */; }; + 8483B15B28F991550048B295 /* ReferendumVotersTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8483B15A28F991550048B295 /* ReferendumVotersTableViewCell.swift */; }; + 8483B15D28FA79620048B295 /* ReferendumDisplayStringFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8483B15C28FA79620048B295 /* ReferendumDisplayStringFactory.swift */; }; 8485D924277E16C400767243 /* DAppBrowserScriptHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485D923277E16C400767243 /* DAppBrowserScriptHandler.swift */; }; + 8487010A2907055900F2C0C3 /* ReferendumTimelineViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848701092907055900F2C0C3 /* ReferendumTimelineViewModelFactory.swift */; }; + 8487010C2907AA9B00F2C0C3 /* ReferendumMetadataViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8487010B2907AA9B00F2C0C3 /* ReferendumMetadataViewModelFactory.swift */; }; + 8487010E2907DF2F00F2C0C3 /* MultiValueView+Styles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8487010D2907DF2F00F2C0C3 /* MultiValueView+Styles.swift */; }; 84873AFF26028E2B000A83EE /* StakingStateMachine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84873AFE26028E2B000A83EE /* StakingStateMachine.swift */; }; 84873B0426029B75000A83EE /* StakingEstimationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84873B0326029B75000A83EE /* StakingEstimationViewModel.swift */; }; 84873B0926029CBD000A83EE /* StakingStateViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84873B0826029CBD000A83EE /* StakingStateViewModelFactory.swift */; }; @@ -1188,6 +1329,10 @@ 8487584727F1816300495306 /* QRExtractionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8487584627F1816200495306 /* QRExtractionService.swift */; }; 8487584927F1830D00495306 /* QRImageUploadDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8487584827F1830D00495306 /* QRImageUploadDelegate.swift */; }; 8487584B27F1834E00495306 /* ImageGalleryPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8487584A27F1834E00495306 /* ImageGalleryPresentable.swift */; }; + 84880C4029016F1500CADB06 /* ReferendumLockChangeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84880C3F29016F1500CADB06 /* ReferendumLockChangeViewModel.swift */; }; + 84880C42290172C300CADB06 /* ReferendumLockChangeViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84880C41290172C300CADB06 /* ReferendumLockChangeViewModelFactory.swift */; }; + 84880C4429026C3E00CADB06 /* ReferendumDelegatingLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84880C4329026C3E00CADB06 /* ReferendumDelegatingLocal.swift */; }; + 84880C462902781E00CADB06 /* ReferendumVotingLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84880C452902781E00CADB06 /* ReferendumVotingLocal.swift */; }; 848841C128D1229000D750E9 /* ParaStkYieldBoostStopError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848841C028D1229000D750E9 /* ParaStkYieldBoostStopError.swift */; }; 84884B5F27A1336500FAC549 /* OrmlAssetExtras.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84884B5E27A1336500FAC549 /* OrmlAssetExtras.swift */; }; 8488ECD7258CDCBC004591CC /* PurchaseCompletionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8488ECD6258CDCBC004591CC /* PurchaseCompletionHandler.swift */; }; @@ -1226,6 +1371,11 @@ 848B59C228BCC1E60009543C /* LedgerAddAccountConfirmationInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848B59C128BCC1E60009543C /* LedgerAddAccountConfirmationInteractor.swift */; }; 848B59C428BCD1BD0009543C /* MessageSheetContentLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848B59C328BCD1BD0009543C /* MessageSheetContentLabel.swift */; }; 848C3D0926248A3B005481C3 /* TransferCall.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848C3D0826248A3B005481C3 /* TransferCall.swift */; }; + 848CC93B28D9F6A5009EB4B0 /* OnChainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CC93A28D9F6A5009EB4B0 /* OnChainScheduler.swift */; }; + 848CC93D28D9F6D8009EB4B0 /* OnChainDispatchTime.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CC93C28D9F6D8009EB4B0 /* OnChainDispatchTime.swift */; }; + 848CC93F28D9F90D009EB4B0 /* ReferendaDeposit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CC93E28D9F90D009EB4B0 /* ReferendaDeposit.swift */; }; + 848CC94428D9FBDA009EB4B0 /* ConvictionVoting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CC94328D9FBDA009EB4B0 /* ConvictionVoting.swift */; }; + 848CC94628D9FC46009EB4B0 /* ConvictionVotingTally.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CC94528D9FC46009EB4B0 /* ConvictionVotingTally.swift */; }; 848CCB442832EE9B00A1FD00 /* GeneralStorageSubscriptionFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CCB432832EE9B00A1FD00 /* GeneralStorageSubscriptionFactory.swift */; }; 848CCB462832EF3400A1FD00 /* GeneralLocalStorageSubscriber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CCB452832EF3400A1FD00 /* GeneralLocalStorageSubscriber.swift */; }; 848CCB482832EF4400A1FD00 /* GeneralLocalStorageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CCB472832EF4400A1FD00 /* GeneralLocalStorageHandler.swift */; }; @@ -1358,6 +1508,7 @@ 8493D0E326FF571D00A28008 /* PriceProviderFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8493D0E226FF571D00A28008 /* PriceProviderFactory.swift */; }; 8493D3E62705994200157009 /* StakingSharedState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8493D3E52705994200157009 /* StakingSharedState.swift */; }; 8493D3E927059B6700157009 /* StakingServiceFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8493D3E827059B6700157009 /* StakingServiceFactory.swift */; }; + 8493FF38291A59D800F09F1B /* ReferendumMetadataMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8493FF37291A59D800F09F1B /* ReferendumMetadataMapper.swift */; }; 8494424A265306BD0016E7BD /* ChangeRewardDestinationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84944249265306BD0016E7BD /* ChangeRewardDestinationViewModel.swift */; }; 84948C36287DD1C800E6DD3E /* NftListRMRKV2ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84948C35287DD1C800E6DD3E /* NftListRMRKV2ViewModel.swift */; }; 84948C38287E0B4F00E6DD3E /* FilterImageProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84948C37287E0B4F00E6DD3E /* FilterImageProcessor.swift */; }; @@ -1381,11 +1532,12 @@ 8496ADDA276AFF4600306B24 /* DAppBrowserScript.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8496ADD9276AFF4600306B24 /* DAppBrowserScript.swift */; }; 8496ADDE276B123200306B24 /* PolkadotExtentionMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8496ADDD276B123200306B24 /* PolkadotExtentionMessage.swift */; }; 8496ADE0276B152500306B24 /* NSDictionary+Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8496ADDF276B152500306B24 /* NSDictionary+Map.swift */; }; + 849707A128F3E0AC00DD0A02 /* ReferendumVoterLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849707A028F3E0AC00DD0A02 /* ReferendumVoterLocal.swift */; }; 8497FC6026317783002FEAA7 /* AccountInfoViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8497FC5F26317783002FEAA7 /* AccountInfoViewModel.swift */; }; 84981CC32666D95F00C4C691 /* GradientButton+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84981CC22666D95F00C4C691 /* GradientButton+Style.swift */; }; 849842E626587573006BBB9F /* MultilineTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849842E526587573006BBB9F /* MultilineTableViewCell.swift */; }; 849842FE26592C2B006BBB9F /* StatusSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849842FD26592C2B006BBB9F /* StatusSectionView.swift */; }; - 8498430326592D29006BBB9F /* CrowdloanStatusSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8498430226592D29006BBB9F /* CrowdloanStatusSectionView.swift */; }; + 8498430326592D29006BBB9F /* VoteStatusSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8498430226592D29006BBB9F /* VoteStatusSectionView.swift */; }; 8498430926592E5D006BBB9F /* CrowdloansViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8498430826592E5D006BBB9F /* CrowdloansViewModel.swift */; }; 849976B327B2430300B14A6C /* DAppMetamaskTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849976B227B2430300B14A6C /* DAppMetamaskTransport.swift */; }; 849976B827B24BCB00B14A6C /* DAppPolkadotExtensionTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849976B727B24BCB00B14A6C /* DAppPolkadotExtensionTransport.swift */; }; @@ -1454,6 +1606,10 @@ 849B563527A70DDE007D5528 /* ExtrinsicProcessor+Matching.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849B563427A70DDE007D5528 /* ExtrinsicProcessor+Matching.swift */; }; 849C066F2765140B00394C82 /* AnyCancellableCleaning.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849C066E2765140B00394C82 /* AnyCancellableCleaning.swift */; }; 849C0671276516F900394C82 /* BaseOperation+Cancellable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849C0670276516F900394C82 /* BaseOperation+Cancellable.swift */; }; + 849D3220291C26BA00D25839 /* GovernanceDAppList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849D321F291C26BA00D25839 /* GovernanceDAppList.swift */; }; + 849D3223291CC43D00D25839 /* MarkdownText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849D3222291CC43D00D25839 /* MarkdownText.swift */; }; + 849D3225291CC4A500D25839 /* MarkdownParsingOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849D3224291CC4A500D25839 /* MarkdownParsingOperationFactory.swift */; }; + 849D3227291CE25E00D25839 /* MarkdownViewContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849D3226291CE25E00D25839 /* MarkdownViewContainer.swift */; }; 849D755B2756910A007726C3 /* RoundedView+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849D755A2756910A007726C3 /* RoundedView+Style.swift */; }; 849D755D27577602007726C3 /* AccountExportPasswordViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849D755C27577602007726C3 /* AccountExportPasswordViewLayout.swift */; }; 849DEBD425ED015C00C64C19 /* SelectValidatorsConfirmViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849DEBD325ED015C00C64C19 /* SelectValidatorsConfirmViewModel.swift */; }; @@ -1481,6 +1637,9 @@ 849FA21628A26CB500F83EAA /* CountdownTimerMediator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849FA21528A26CB500F83EAA /* CountdownTimerMediator.swift */; }; 84A04622277DE83E000B24DA /* DAppListErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A04621277DE83E000B24DA /* DAppListErrorView.swift */; }; 84A15489262888CA0050D557 /* IdentityOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A15488262888CA0050D557 /* IdentityOperationFactory.swift */; }; + 84A1742428ED3CF70096F943 /* ReferendumLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A1742328ED3CF70096F943 /* ReferendumLocal.swift */; }; + 84A1742728ED607B0096F943 /* GovernanceOperationProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A1742628ED607B0096F943 /* GovernanceOperationProtocols.swift */; }; + 84A1742928ED625D0096F943 /* Gov2OperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A1742828ED625D0096F943 /* Gov2OperationFactory.swift */; }; 84A2A60A26B82B35000C6C6C /* ValidatorOperationFactory+Protocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A2A60926B82B35000C6C6C /* ValidatorOperationFactory+Protocol.swift */; }; 84A2C90224E07E440020D3B7 /* CryptoType+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A2C90124E07E440020D3B7 /* CryptoType+Utils.swift */; }; 84A2C90424E07F400020D3B7 /* AccountOperationFactoryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A2C90324E07F400020D3B7 /* AccountOperationFactoryError.swift */; }; @@ -1499,8 +1658,12 @@ 84A58FD928A10ABD003F6ABF /* MultipartQrOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A58FD828A10ABD003F6ABF /* MultipartQrOperationFactory.swift */; }; 84A6171B2625AC3E007B75E1 /* CallCodingPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A6171A2625AC3E007B75E1 /* CallCodingPath.swift */; }; 84A617262625AF51007B75E1 /* RuntimeMetadata+Internal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A617252625AF51007B75E1 /* RuntimeMetadata+Internal.swift */; }; + 84A6AB5E290AA7DF001B57B2 /* ReferendumFullDetailsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A6AB5D290AA7DF001B57B2 /* ReferendumFullDetailsViewModel.swift */; }; + 84A6AB64290B021E001B57B2 /* CopyPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A6AB63290B021E001B57B2 /* CopyPresentable.swift */; }; 84A8FD8E265FDA76002ADB58 /* CrowdloanContributionConfirmData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A8FD8D265FDA76002ADB58 /* CrowdloanContributionConfirmData.swift */; }; 84A90489288EA0E500DFC8E2 /* NoKeysCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A90488288EA0E500DFC8E2 /* NoKeysCommand.swift */; }; + 84A9ECC1291292900094C763 /* GovernanceUnlockConfirmInteractorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A9ECC0291292900094C763 /* GovernanceUnlockConfirmInteractorError.swift */; }; + 84A9ECC429129FF10094C763 /* GovernanceRemainedLockViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A9ECC329129FF10094C763 /* GovernanceRemainedLockViewModel.swift */; }; 84AA004326C5DFD800BCB4DC /* RuntimeSyncServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AA004226C5DFD800BCB4DC /* RuntimeSyncServiceTests.swift */; }; 84AA004526C6A04A00BCB4DC /* CommonTypesSyncService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AA004426C6A04A00BCB4DC /* CommonTypesSyncService.swift */; }; 84AC0B6A28C0D8CE00FA5B5D /* NoLedgerSupportCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AC0B6928C0D8CE00FA5B5D /* NoLedgerSupportCommand.swift */; }; @@ -1529,9 +1692,12 @@ 84B018AE26E03FB500C75E28 /* NominatorStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B018AD26E03FB500C75E28 /* NominatorStateView.swift */; }; 84B018B026E0450F00C75E28 /* ValidatorStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B018AF26E0450F00C75E28 /* ValidatorStateView.swift */; }; 84B28FC428C54441007A1006 /* OnChainTransferAmount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B28FC328C54441007A1006 /* OnChainTransferAmount.swift */; }; + 84B4E12C28EC038C00AC4FA8 /* ChainModelMapperV2V3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B4E12B28EC038C00AC4FA8 /* ChainModelMapperV2V3.swift */; }; 84B5DE53283F7BE500193ED3 /* CollatorsSortType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B5DE52283F7BE500193ED3 /* CollatorsSortType.swift */; }; 84B5DE56283F7C8500193ED3 /* CollatorSelectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B5DE55283F7C8500193ED3 /* CollatorSelectionCell.swift */; }; 84B5DE59283F8B5400193ED3 /* CollatorSelectionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B5DE58283F8B5400193ED3 /* CollatorSelectionViewModel.swift */; }; + 84B6349D28F4A06D00503306 /* Preimage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B6349C28F4A06D00503306 /* Preimage.swift */; }; + 84B6349F28F5575900503306 /* PreimageRequestStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B6349E28F5575900503306 /* PreimageRequestStatus.swift */; }; 84B64E3F2704567700914E88 /* StakingLocalStorageSubscriber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B64E3E2704567700914E88 /* StakingLocalStorageSubscriber.swift */; }; 84B64E412704569D00914E88 /* StakingLocalSubscriptionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B64E402704569D00914E88 /* StakingLocalSubscriptionHandler.swift */; }; 84B66A0B26FDB70F0038B963 /* CrowdloansListInteractor+Protocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84B66A0A26FDB70F0038B963 /* CrowdloansListInteractor+Protocols.swift */; }; @@ -1678,6 +1844,8 @@ 84C3F77B2601F08B00D47501 /* NominationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C3F77A2601F08B00D47501 /* NominationViewModel.swift */; }; 84C3F7832602086100D47501 /* StakingViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C3F7822602086100D47501 /* StakingViewState.swift */; }; 84C3F78C26020DE800D47501 /* StakingStateMachineProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C3F78B26020DE800D47501 /* StakingStateMachineProtocols.swift */; }; + 84C41F3628EDADE000DB1CD3 /* ReferendaTrackInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C41F3528EDADE000DB1CD3 /* ReferendaTrackInfo.swift */; }; + 84C41F3828EDB80700DB1CD3 /* ReferendaCurve.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C41F3728EDB80700DB1CD3 /* ReferendaCurve.swift */; }; 84C4C2D7255D2B780045B582 /* PinChangeWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C4C2D6255D2B780045B582 /* PinChangeWireframe.swift */; }; 84C4C2F9255DB9510045B582 /* PinChangeInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C4C2F8255DB9510045B582 /* PinChangeInteractor.swift */; }; 84C515FB26D84F8C000DBA45 /* AccountImportWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C515FA26D84F8C000DBA45 /* AccountImportWrapper.swift */; }; @@ -1709,6 +1877,9 @@ 84C7DA5425EE2DF000F8C318 /* StakingErrorPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C7DA5325EE2DF000F8C318 /* StakingErrorPresentable.swift */; }; 84C91FAA261E724F002796B9 /* SwitchTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C91FA9261E724F002796B9 /* SwitchTableViewCell.swift */; }; 84C91FAF261E7CDD002796B9 /* WalletHistoryFilterEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C91FAE261E7CDD002796B9 /* WalletHistoryFilterEditor.swift */; }; + 84C9CF3B291AE328002BF328 /* PolkassemblyOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C9CF3A291AE328002BF328 /* PolkassemblyOperationFactory.swift */; }; + 84C9CF3D291AF1B1002BF328 /* GovernanceOffchainApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C9CF3C291AF1B1002BF328 /* GovernanceOffchainApi.swift */; }; + 84C9CF3F291AF4B2002BF328 /* ReferendumMetadataDetailsProviderSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C9CF3E291AF4B2002BF328 /* ReferendumMetadataDetailsProviderSource.swift */; }; 84CA68CF26BD6872003B9453 /* RuntimeSyncService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CA68CE26BD6872003B9453 /* RuntimeSyncService.swift */; }; 84CA68D126BE99ED003B9453 /* RuntimeProviderFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CA68D026BE99ED003B9453 /* RuntimeProviderFactory.swift */; }; 84CA68D326BE9A35003B9453 /* RuntimeProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CA68D226BE9A35003B9453 /* RuntimeProvider.swift */; }; @@ -1738,6 +1909,10 @@ 84CEAAF526D7ADF20021B881 /* KeystoreMigrator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CEAAF426D7ADF20021B881 /* KeystoreMigrator.swift */; }; 84CEAAF726D7B8010021B881 /* SettingsMigrator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CEAAF626D7B8010021B881 /* SettingsMigrator.swift */; }; 84CEEDE2284E3DCE0039364A /* AccountDetailsNavigationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CEEDE1284E3DCE0039364A /* AccountDetailsNavigationCell.swift */; }; + 84CEF288290462C300BA25BB /* GovernanceValidatorFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CEF287290462C300BA25BB /* GovernanceValidatorFactory.swift */; }; + 84CEF28A290466A800BA25BB /* GovernanceErrorPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CEF289290466A800BA25BB /* GovernanceErrorPresentable.swift */; }; + 84CEF28C290509D600BA25BB /* GovernanceVoteValidatingParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CEF28B290509D600BA25BB /* GovernanceVoteValidatingParams.swift */; }; + 84CEF28E29050A3300BA25BB /* DataValidationRunner+GovVote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CEF28D29050A3300BA25BB /* DataValidationRunner+GovVote.swift */; }; 84CF00C327F6C1E4004DB322 /* CustomAssetMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CF00C227F6C1E4004DB322 /* CustomAssetMapper.swift */; }; 84CFBC6528756CCB00E93EDA /* EthereumError+Presentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CFBC6428756CCB00E93EDA /* EthereumError+Presentable.swift */; }; 84CFF1E326526FBC00DB7CF7 /* StakingBondMoreProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CFF1CF26526FBC00DB7CF7 /* StakingBondMoreProtocols.swift */; }; @@ -1797,6 +1972,11 @@ 84D6D7FC27A7F4B40094FC33 /* AssetListNetworkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D6D7FB27A7F4B40094FC33 /* AssetListNetworkView.swift */; }; 84D6D7FE27A7F4CD0094FC33 /* AssetListChainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D6D7FD27A7F4CD0094FC33 /* AssetListChainView.swift */; }; 84D6E2FA283AE6590031D6FD /* ExtrinsicSubmissionPresenting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D6E2F9283AE6590031D6FD /* ExtrinsicSubmissionPresenting.swift */; }; + 84D8753A28EB0A93004065BD /* GovernanceChainSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8753928EB0A93004065BD /* GovernanceChainSettings.swift */; }; + 84D8753D28EB17B2004065BD /* GovernanceSharedState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8753C28EB17B2004065BD /* GovernanceSharedState.swift */; }; + 84D8754028EB1A59004065BD /* ReferendumsInteractorError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8753F28EB1A59004065BD /* ReferendumsInteractorError.swift */; }; + 84D8754228EB5D66004065BD /* ChainBalanceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8754128EB5D66004065BD /* ChainBalanceViewModel.swift */; }; + 84D8754428EB5E6D004065BD /* ChainBalanceViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8754328EB5E6D004065BD /* ChainBalanceViewModelFactory.swift */; }; 84D8F15524D80CA100AF43E9 /* ModalPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8F15424D80CA100AF43E9 /* ModalPickerViewController.swift */; }; 84D8F15724D80D5500AF43E9 /* ModalPickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84D8F15624D80D5500AF43E9 /* ModalPickerViewController.xib */; }; 84D8F15B24D8136700AF43E9 /* ModalPickerCellProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8F15A24D8136700AF43E9 /* ModalPickerCellProtocol.swift */; }; @@ -1810,6 +1990,7 @@ 84D8F16D24D82C7E00AF43E9 /* ModalPickerConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8F16C24D82C7E00AF43E9 /* ModalPickerConfiguration.swift */; }; 84D8F16F24D8451F00AF43E9 /* CryptoType+ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8F16E24D8451F00AF43E9 /* CryptoType+ViewModel.swift */; }; 84D8F17124D856D300AF43E9 /* SNAddressType+ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D8F17024D856D300AF43E9 /* SNAddressType+ViewModel.swift */; }; + 84D911AA292C923D0032EF33 /* Data+Fill.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D911A9292C923D0032EF33 /* Data+Fill.swift */; }; 84D97EC82520D32000F07405 /* PolkadotIcon+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D97EC72520D32000F07405 /* PolkadotIcon+Image.swift */; }; 84D97ECF2521CA2F00F07405 /* WalletBaseTokenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D97ECE2521CA2F00F07405 /* WalletBaseTokenView.swift */; }; 84D97ED12521CA5200F07405 /* WalletTokenView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84D97ED02521CA5200F07405 /* WalletTokenView.xib */; }; @@ -1843,6 +2024,9 @@ 84DC3CE52796768A0038E2ED /* SubqueryHistoryContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DC3CE42796768A0038E2ED /* SubqueryHistoryContext.swift */; }; 84DC3CE7279679230038E2ED /* SubqueryHistory+Wallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DC3CE6279679230038E2ED /* SubqueryHistory+Wallet.swift */; }; 84DC5A1328BAA8020014E081 /* LedgerInvaliDataPolkadotReason.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DC5A1228BAA8020014E081 /* LedgerInvaliDataPolkadotReason.swift */; }; + 84DD49F428EE91ED00B804F3 /* Gov2LocalMappingFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DD49F328EE91ED00B804F3 /* Gov2LocalMappingFactory.swift */; }; + 84DD49F628EE974B00B804F3 /* ReferendumDecidingFunctionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DD49F528EE974B00B804F3 /* ReferendumDecidingFunctionProtocol.swift */; }; + 84DD49F828EEAFFF00B804F3 /* DecimalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DD49F728EEAFFF00B804F3 /* DecimalTests.swift */; }; 84DD5F21263CB6BE00425ACF /* UnbondCall.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DD5F20263CB6BE00425ACF /* UnbondCall.swift */; }; 84DD5F26263D72C400425ACF /* ExtrinsicFeeProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DD5F25263D72C400425ACF /* ExtrinsicFeeProxy.swift */; }; 84DD5F30263D84F300425ACF /* RuntimeConstantFetching.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DD5F2F263D84F300425ACF /* RuntimeConstantFetching.swift */; }; @@ -1869,6 +2053,12 @@ 84DF21AD25363D28005454AE /* WalletAssetId+Chain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DF21AC25363D28005454AE /* WalletAssetId+Chain.swift */; }; 84DF21B12536DDC1005454AE /* TransferConfirmCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DF21B02536DDC1005454AE /* TransferConfirmCommand.swift */; }; 84DF21B525388B35005454AE /* Scheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DF21B425388B35005454AE /* Scheduler.swift */; }; + 84E0EE04292D336C008B2953 /* GovernanceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E0EE03292D336C008B2953 /* GovernanceType.swift */; }; + 84E0EE06292D3A58008B2953 /* AssetSelectionBaseProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E0EE05292D3A58008B2953 /* AssetSelectionBaseProtocols.swift */; }; + 84E0EE08292D3C2D008B2953 /* GovernanceAssetSelectionProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E0EE07292D3C2D008B2953 /* GovernanceAssetSelectionProtocols.swift */; }; + 84E0EE0A292D3CB4008B2953 /* GovernanceAssetSelectionWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E0EE09292D3CB4008B2953 /* GovernanceAssetSelectionWireframe.swift */; }; + 84E0EE0C292D402C008B2953 /* GovernanceAssetSelectionViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E0EE0B292D402C008B2953 /* GovernanceAssetSelectionViewFactory.swift */; }; + 84E0EE0E292D69A9008B2953 /* CallMetadata+TypeCheck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E0EE0D292D69A9008B2953 /* CallMetadata+TypeCheck.swift */; }; 84E172CF28BE468D00DC85B6 /* MessageSheetPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E172CE28BE468D00DC85B6 /* MessageSheetPresentable.swift */; }; 84E172D128BF383B00DC85B6 /* Array+Dictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E172D028BF383B00DC85B6 /* Array+Dictionary.swift */; }; 84E1CCF5260DCB91001E81B5 /* SwitchAccount+WalletManagementWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E1CCF4260DCB91001E81B5 /* SwitchAccount+WalletManagementWireframe.swift */; }; @@ -1897,6 +2087,7 @@ 84E4932727325D4E000534F2 /* AssetListViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E4932627325D4E000534F2 /* AssetListViewModelFactory.swift */; }; 84E58C7D275E125100BD441A /* PublicSans-ExtraLight.otf in Resources */ = {isa = PBXBuildFile; fileRef = 84E58C7C275E124A00BD441A /* PublicSans-ExtraLight.otf */; }; 84E5D14227E32E8B00D27B1E /* AccountInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E5D14127E32E8B00D27B1E /* AccountInputView.swift */; }; + 84E63C1728FFC69A0093534A /* DiscreteGradientSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E63C1628FFC69A0093534A /* DiscreteGradientSlider.swift */; }; 84E6D57C262E2CE8000EA3F5 /* OperationCombiningService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E6D57B262E2CE8000EA3F5 /* OperationCombiningService.swift */; }; 84E731C326652B5C00D5B15A /* AttributedString+Crowdloan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E731C226652B5C00D5B15A /* AttributedString+Crowdloan.swift */; }; 84E83AA2286328660000B418 /* XcmOrmlTransfer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E83AA1286328660000B418 /* XcmOrmlTransfer.swift */; }; @@ -1905,6 +2096,7 @@ 84E8AC7527BB975700402635 /* RMRKV1OperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E8AC7427BB975700402635 /* RMRKV1OperationFactory.swift */; }; 84E8AC7727BBC8E400402635 /* NFTIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E8AC7627BBC8E400402635 /* NFTIntegrationTests.swift */; }; 84E90BA128D0B51000529633 /* CheckboxControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E90BA028D0B51000529633 /* CheckboxControlView.swift */; }; + 84E9A05028F000AB00551DC4 /* ReferendumMetadataLocal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E9A04F28F000AB00551DC4 /* ReferendumMetadataLocal.swift */; }; 84EA0B2A25E579DF00AFB0DC /* AssetBalanceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84EA0B2925E579DF00AFB0DC /* AssetBalanceViewModel.swift */; }; 84EB6C4E281999E100CFD8B2 /* PayoutTimeViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84EB6C4D281999E100CFD8B2 /* PayoutTimeViewModelFactory.swift */; }; 84EBA4F027AD26A5000AEEAD /* AssetBalanceId.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84EBA4EF27AD26A5000AEEAD /* AssetBalanceId.swift */; }; @@ -1974,6 +2166,10 @@ 84F1CB3C27CF42B80095D523 /* NftListItemWithPriceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F1CB3B27CF42B80095D523 /* NftListItemWithPriceCell.swift */; }; 84F1CB3E27CF4F5A0095D523 /* BorderedLabelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F1CB3D27CF4F5A0095D523 /* BorderedLabelView.swift */; }; 84F1CB4027CF6BEF0095D523 /* UniquesClassDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F1CB3F27CF6BEF0095D523 /* UniquesClassDetails.swift */; }; + 84F1D66B29051A730050F4E3 /* ReferendumLockReuseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F1D66A29051A730050F4E3 /* ReferendumLockReuseViewModel.swift */; }; + 84F1D66D29051F240050F4E3 /* ReferendumReuseLockModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F1D66C29051F240050F4E3 /* ReferendumReuseLockModel.swift */; }; + 84F1D66F29066F740050F4E3 /* ReferendumVotesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F1D66E29066F740050F4E3 /* ReferendumVotesViewModel.swift */; }; + 84F1D67329069FFB0050F4E3 /* governanceDApps.json in Resources */ = {isa = PBXBuildFile; fileRef = 84F1D67229069FFB0050F4E3 /* governanceDApps.json */; }; 84F2FEFA25E797E8008338D5 /* StorageRequestFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F2FEF925E797E8008338D5 /* StorageRequestFactory.swift */; }; 84F2FEFF25E7ADE7008338D5 /* ValidatorPrefs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F2FEFE25E7ADE7008338D5 /* ValidatorPrefs.swift */; }; 84F2FF0725E7AF8F008338D5 /* EraValidatorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F2FF0625E7AF8F008338D5 /* EraValidatorInfo.swift */; }; @@ -2017,6 +2213,8 @@ 84F6B6432619A8480038F10D /* SubscanConcreteExtrinsicsData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F6B6422619A8480038F10D /* SubscanConcreteExtrinsicsData.swift */; }; 84F6B6482619A87C0038F10D /* ExtrinsicIndexWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F6B6472619A87C0038F10D /* ExtrinsicIndexWrapper.swift */; }; 84F6B6502619E1ED0038F10D /* Int+Operations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F6B64F2619E1ED0038F10D /* Int+Operations.swift */; }; + 84F76ED629006A0900D7206C /* ReferendumConvictionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F76ED529006A0900D7206C /* ReferendumConvictionView.swift */; }; + 84F76ED829006BC400D7206C /* DiscreteGradientSlider+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F76ED729006BC400D7206C /* DiscreteGradientSlider+Style.swift */; }; 84F77AAA265EE86B00F54885 /* CrowdloanErrorPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F77AA9265EE86B00F54885 /* CrowdloanErrorPresentable.swift */; }; 84F81318265B9E990043FA1D /* CrowdloansOperationFactoryStub.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F81317265B9E990043FA1D /* CrowdloansOperationFactoryStub.swift */; }; 84F98D8A25E3DD3F0040418E /* StorageCodingPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F98D8925E3DD3F0040418E /* StorageCodingPath.swift */; }; @@ -2089,10 +2287,18 @@ 84FFE45D28620833002432BB /* XcmTransferResolutionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84FFE45C28620833002432BB /* XcmTransferResolutionService.swift */; }; 84FFE505261290830054EA63 /* NetworkInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84FFE504261290830054EA63 /* NetworkInfoView.swift */; }; 85547F698B551ACD387D84E2 /* SelectValidatorsStartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E62CD2831DCF0A2D5DBB08F /* SelectValidatorsStartViewController.swift */; }; + 85600C63BB1BEC76EDFA04CB /* ReferendumFullDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C535E8504943299B3E4A8EB /* ReferendumFullDetailsViewController.swift */; }; 8582395FEF296771447439FF /* AssetsSearchWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6746DDB8F277A968E6B25332 /* AssetsSearchWireframe.swift */; }; 85A093F6055DDD2E2E9253F2 /* ControllerAccountProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = F829E7F8B39EE7D977001510 /* ControllerAccountProtocols.swift */; }; 86EB789787B731691B36C827 /* OnChainTransferSetupPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD1A2F7E5E278FDCC89FE097 /* OnChainTransferSetupPresenter.swift */; }; + 879D493C025963619CFADF4F /* GovernanceUnlockSetupProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4642DD5186EFA940518CCB4 /* GovernanceUnlockSetupProtocols.swift */; }; 87F7556E02F6F5BB6F1B1AEA /* ParitySignerTxQrViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5A5DCA28ABF42D342BBDF9A /* ParitySignerTxQrViewLayout.swift */; }; + 880059D828EEBC0200E87B9B /* SliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880059D728EEBC0200E87B9B /* SliderView.swift */; }; + 880059DA28EF092800E87B9B /* ThumbView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880059D928EF092800E87B9B /* ThumbView.swift */; }; + 880059DC28EF092F00E87B9B /* SegmentedSliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880059DB28EF092F00E87B9B /* SegmentedSliderView.swift */; }; + 880059DF28EF09E100E87B9B /* GovernanceStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880059DE28EF09E100E87B9B /* GovernanceStyle.swift */; }; + 880059E128EF0A5C00E87B9B /* VotingProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880059E028EF0A5C00E87B9B /* VotingProgressView.swift */; }; + 880059E328EF128000E87B9B /* ReferendumInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880059E228EF128000E87B9B /* ReferendumInfoView.swift */; }; 880855ED28D062A9004255E7 /* Array+AddOrReplace.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880855EC28D062A9004255E7 /* Array+AddOrReplace.swift */; }; 880855F028D099F2004255E7 /* CrowdloanOnChainSyncService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880855EF28D099F2004255E7 /* CrowdloanOnChainSyncService.swift */; }; 880855F228D09A0B004255E7 /* CrowdloanContributionData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880855F128D09A0B004255E7 /* CrowdloanContributionData.swift */; }; @@ -2101,7 +2307,14 @@ 880855F828D09DA8004255E7 /* CrowdloanContributionDataMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880855F728D09DA8004255E7 /* CrowdloanContributionDataMapper.swift */; }; 880855FA28D0BAA2004255E7 /* CrowdloanContributionLocalSubscriptionFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880855F928D0BAA2004255E7 /* CrowdloanContributionLocalSubscriptionFactory.swift */; }; 880855FC28D0C3DF004255E7 /* CrowdloansLocalStorageSubscriber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880855FB28D0C3DF004255E7 /* CrowdloansLocalStorageSubscriber.swift */; }; - 8820134828EB04300027CD80 /* SkeletonableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8820134728EB04300027CD80 /* SkeletonableView.swift */; }; + 88107D5F290133F8001AB0B0 /* RoundedView+Styles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88107D5E290133F8001AB0B0 /* RoundedView+Styles.swift */; }; + 88107D6129015FAB001AB0B0 /* TrackTagsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88107D6029015FAB001AB0B0 /* TrackTagsView.swift */; }; + 8824D4222902D92F0022D778 /* ReferendumFullDetailsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8824D4212902D92F0022D778 /* ReferendumFullDetailsInteractor.swift */; }; + 8824D424290324260022D778 /* PrettyPrintedJSONOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8824D423290324260022D778 /* PrettyPrintedJSONOperationFactory.swift */; }; + 8824D42629032B410022D778 /* BlurredView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8824D42529032B410022D778 /* BlurredView.swift */; }; + 8824D42829032BF60022D778 /* ReferendumStateLocal+Presenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8824D42729032BF60022D778 /* ReferendumStateLocal+Presenter.swift */; }; + 882808C829009CA500AE8089 /* DotsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882808C729009CA500AE8089 /* DotsView.swift */; }; + 882808CA29009CDC00AE8089 /* UIView+frame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882808C929009CDC00AE8089 /* UIView+frame.swift */; }; 8828C05828B4A67000555CB6 /* Prism.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8828C05728B4A67000555CB6 /* Prism.swift */; }; 8828C05A28B4A6A800555CB6 /* Samples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8828C05928B4A6A800555CB6 /* Samples.swift */; }; 8828F4F328AD2734009E0B7C /* CrowdloansCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8828F4F228AD2734009E0B7C /* CrowdloansCalculator.swift */; }; @@ -2139,6 +2352,7 @@ 8860F3E4289D50BA00C0BF86 /* Array+SectionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8860F3E3289D50BA00C0BF86 /* Array+SectionProtocol.swift */; }; 8860F3E8289D7CF400C0BF86 /* Atomic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8860F3E7289D7CF400C0BF86 /* Atomic.swift */; }; 886E8CF81EF2566D98D9693E /* ExportSeedViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62FA66143B25AA70B02CE461 /* ExportSeedViewFactory.swift */; }; + 887A717C28FEF03E00B13C7E /* BaselinedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887A717B28FEF03E00B13C7E /* BaselinedView.swift */; }; 887AFC8728BC95F0002A0422 /* MetaAccountChainResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887AFC8628BC95F0002A0422 /* MetaAccountChainResponse.swift */; }; 887AFC8C28BCB314002A0422 /* PolkadotIconDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887AFC8928BCB313002A0422 /* PolkadotIconDetailsView.swift */; }; 887AFC8D28BCB314002A0422 /* SelectableIconSubtitleCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887AFC8A28BCB313002A0422 /* SelectableIconSubtitleCollectionViewCell.swift */; }; @@ -2146,7 +2360,14 @@ 8887813C28B62B0A00E7290F /* FlexibleSpaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8887813B28B62B0A00E7290F /* FlexibleSpaceView.swift */; }; 8887813E28B7AA3100E7290F /* RoundedIconTitleCollectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8887813D28B7AA3100E7290F /* RoundedIconTitleCollectionHeaderView.swift */; }; 8887814028B7AAB700E7290F /* RoundedIconTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8887813F28B7AAB700E7290F /* RoundedIconTitleView.swift */; }; + 888A3B6528F73DC300E15BD2 /* ReferendumVotingStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888A3B6428F73DC300E15BD2 /* ReferendumVotingStatusView.swift */; }; + 888A3B6728F746D200E15BD2 /* ReferendumVotingStatusDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888A3B6628F746D200E15BD2 /* ReferendumVotingStatusDetailsView.swift */; }; + 888B853828ED966600AC9614 /* SkeletonableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888B853728ED966600AC9614 /* SkeletonableView.swift */; }; 8890E51628DDC98C001D3994 /* SubstrateStorageMigrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8890E51528DDC98C001D3994 /* SubstrateStorageMigrationTests.swift */; }; + 8892284828F353A5003F8B9E /* ReferendumsModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8892284728F353A5003F8B9E /* ReferendumsModelFactory.swift */; }; + 8892284A28F35410003F8B9E /* ReferendumsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8892284928F35410003F8B9E /* ReferendumsViewModel.swift */; }; + 889D889528F01E5B00C4320F /* ReferendumTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 889D889428F01E5B00C4320F /* ReferendumTableViewCell.swift */; }; + 889D889728F022AA00C4320F /* UILabel+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 889D889628F022AA00C4320F /* UILabel+Style.swift */; }; 88A0C52128D49A090083A524 /* CrowdloanOffChainSyncService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A0C52028D49A090083A524 /* CrowdloanOffChainSyncService.swift */; }; 88A0E0FF28A284C700A9C940 /* SelectedCurrencyDepending.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A0E0FC28A284C700A9C940 /* SelectedCurrencyDepending.swift */; }; 88A0E10028A284C700A9C940 /* CurrencyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A0E0FD28A284C700A9C940 /* CurrencyManager.swift */; }; @@ -2156,11 +2377,16 @@ 88A5318028B9328E00AF18F5 /* YourWalletsViewSectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A5317F28B9328E00AF18F5 /* YourWalletsViewSectionModel.swift */; }; 88A6BCFF28CA15400047E4C2 /* LocksBalanceViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A6BCFE28CA15400047E4C2 /* LocksBalanceViewModelFactory.swift */; }; 88A6BD0128CA15710047E4C2 /* LocksViewInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A6BD0028CA15710047E4C2 /* LocksViewInput.swift */; }; + 88A95FA628F8664100BE26F3 /* ReferendumTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A95FA528F8664100BE26F3 /* ReferendumTimelineView.swift */; }; + 88A95FA828FAA99D00BE26F3 /* ReferendumDAppView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A95FA728FAA99D00BE26F3 /* ReferendumDAppView.swift */; }; 88AA0FB828B60E6A00931800 /* YourWalletsControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AA0FB728B60E6A00931800 /* YourWalletsControlView.swift */; }; 88AC186128CA3EE100892A9B /* LocksViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AC186028CA3EE100892A9B /* LocksViewLayout.swift */; }; 88AC186328CA3F0000892A9B /* GenericCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AC186228CA3F0000892A9B /* GenericCollectionViewLayout.swift */; }; 88AC186528CA461F00892A9B /* ModalSheetCollectionViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AC186428CA461F00892A9B /* ModalSheetCollectionViewProtocol.swift */; }; 88AF35DE28C21D28003730DA /* LocksSubscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AF35DD28C21D28003730DA /* LocksSubscription.swift */; }; + 88B1862A28EF30A600D49854 /* YourVoteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88B1862928EF30A600D49854 /* YourVoteView.swift */; }; + 88B438E728F6C629001FC08A /* StatusTimeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88B438E628F6C629001FC08A /* StatusTimeViewModel.swift */; }; + 88B560BC28F80DCB00A5EB59 /* VoteRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88B560BB28F80DCB00A5EB59 /* VoteRowView.swift */; }; 88BB21A028D34C660019C6B4 /* DataProviderChange+Identifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88BB219F28D34C660019C6B4 /* DataProviderChange+Identifier.swift */; }; 88C017E628C60A65003B2D28 /* AssetLockMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88C017E528C60A65003B2D28 /* AssetLockMapper.swift */; }; 88C7165428C894510015D1E9 /* CollectionViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88C7165328C894510015D1E9 /* CollectionViewDelegate.swift */; }; @@ -2176,10 +2402,20 @@ 88E8CF5E28E3789600C90112 /* CrowdloanEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88E8CF5D28E3789600C90112 /* CrowdloanEmptyView.swift */; }; 88F19DDE28D8D0A100F6E459 /* Either.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F19DDD28D8D0A100F6E459 /* Either.swift */; }; 88F19DE028D8D0F600F6E459 /* LoadableViewModelState+Addition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F19DDF28D8D0F600F6E459 /* LoadableViewModelState+Addition.swift */; }; + 88F34FD228FF045400712BDE /* BindableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F34FD128FF045400712BDE /* BindableView.swift */; }; + 88F34FD428FFE64400712BDE /* ReferendumDAppCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F34FD328FFE64400712BDE /* ReferendumDAppCellView.swift */; }; + 88F34FD728FFE66E00712BDE /* FullDetailsRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F34FD628FFE66E00712BDE /* FullDetailsRow.swift */; }; + 88F34FD928FFE68B00712BDE /* YourVoteRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F34FD828FFE68B00712BDE /* YourVoteRow.swift */; }; + 88F34FDB28FFE6AA00712BDE /* RequestedAmountRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F34FDA28FFE6AA00712BDE /* RequestedAmountRow.swift */; }; + 88F34FDD28FFE6E400712BDE /* MultiValueView+Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F34FDC28FFE6E400712BDE /* MultiValueView+Model.swift */; }; + 88F34FDF28FFEAE500712BDE /* TimelineRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F34FDE28FFEAE500712BDE /* TimelineRow.swift */; }; + 88F34FE128FFEAFD00712BDE /* VotingDetailsRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F34FE028FFEAFD00712BDE /* VotingDetailsRow.swift */; }; 88F3A9FB9CEA464275F1115E /* ExportMnemonicViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47759907380BE9300E54DC78 /* ExportMnemonicViewFactory.swift */; }; 88F7716028BEA589008C028A /* YourWalletsIconDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F7715F28BEA589008C028A /* YourWalletsIconDetailsView.swift */; }; 88F7716428BF6B59008C028A /* GenericMultiValueView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88F7716328BF6B59008C028A /* GenericMultiValueView.swift */; }; + 88FAE78828FCF8E200130B47 /* ReferendumDetailsTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88FAE78728FCF8E200130B47 /* ReferendumDetailsTitleView.swift */; }; 8916E9179CF5409E65D1B3A6 /* NftDetailsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A46EE888D60C1538A0A3EFC /* NftDetailsProtocols.swift */; }; + 89724EA9F732D0C967253597 /* ReferendumVotersViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF3C1CFECE4340E82837FC4 /* ReferendumVotersViewFactory.swift */; }; 8A19EC93E6A6972327116D80 /* ParaStkStakeConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1139FB38E7D8D25A36726089 /* ParaStkStakeConfirmProtocols.swift */; }; 8A23DD1F4146639EA2F7AEF6 /* LocksViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B81B239BD9C150BFE9A82B0 /* LocksViewFactory.swift */; }; 8AEF593AFE8F59F7DC0A5753 /* CustomValidatorListInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 365CAE2753E7D5F9B9DB7D1F /* CustomValidatorListInteractor.swift */; }; @@ -2193,14 +2429,17 @@ 8EECC23DA32547DAAFC260BE /* ParaStkStakeConfirmPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9925D7FC8A58695700B4A308 /* ParaStkStakeConfirmPresenter.swift */; }; 8F131D86B269B7FAB96CF3B5 /* ParaStkYieldBoostStartWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98096689C3C8541FA585D179 /* ParaStkYieldBoostStartWireframe.swift */; }; 9081D43697D992F51E057ED2 /* CrowdloanContributionSetupPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F7068913923A6DEEE9D8EA0 /* CrowdloanContributionSetupPresenter.swift */; }; + 9097EE6D11E2E023D2637BE5 /* GovernanceUnlockSetupPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B9CC114CB6B28CDC59F99CF /* GovernanceUnlockSetupPresenter.swift */; }; 90A3F46EF181DC2B821CC80C /* CrowdloanContributionConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F791FE1B479CE1DF936F79F /* CrowdloanContributionConfirmViewFactory.swift */; }; 90ACE8690DA095E4F45494E9 /* TransferConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F7865BACFB8591F67D8EE06 /* TransferConfirmProtocols.swift */; }; 90EFE3768F1375470FDBE6F6 /* PurchaseViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AA3BF0C9C1E0E2C67D962F5 /* PurchaseViewFactory.swift */; }; + 91201789084DD9A419CA8CD3 /* ReferendumFullDescriptionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F080BC55D9575EBE4216283C /* ReferendumFullDescriptionViewController.swift */; }; 912ECC319A48CAD09FB694AC /* AssetsSearchProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F9F9E43E296386A7F138326 /* AssetsSearchProtocols.swift */; }; 91530F7301CA39654E008580 /* DAppBrowserInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A4DFCC4236D25A3D59F809 /* DAppBrowserInteractor.swift */; }; 91A1286763617DE022BD495F /* LedgerInstructionsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1B08ACC71BE679A48A7B66E /* LedgerInstructionsPresenter.swift */; }; 921E4891E85C0DC6FDD8A0D0 /* CrowdloanContributionConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1366336078BCA34EFB4C6FF9 /* CrowdloanContributionConfirmInteractor.swift */; }; 93434E8E407A6C63D8862A21 /* AssetSelectionProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DECC58C93DB18E79A03B5A0 /* AssetSelectionProtocols.swift */; }; + 93EB8C73108944E9C576936C /* ReferendumVotersPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9990DF2F0214CD51E5388CE /* ReferendumVotersPresenter.swift */; }; 940DA38E4586A27D7F3E0C67 /* ParitySignerAddressesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3280014154DCC105757E317C /* ParitySignerAddressesViewController.swift */; }; 94B0F0C84AF74B3CD7223C3A /* AccountConfirmPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7306D50F278F6CC90DC88F27 /* AccountConfirmPresenter.swift */; }; 94B234EE404088B077DB6411 /* DAppListProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10F3CCA5BA57C68D5AE2B42F /* DAppListProtocols.swift */; }; @@ -2229,12 +2468,15 @@ 9B6CD060F0EB77C162D90D3E /* ChainAddressDetailsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 781FA4C896AF31B4035AFB38 /* ChainAddressDetailsViewFactory.swift */; }; 9BADFCBF3AF5186094DB8D67 /* DAppTxDetailsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFB4A14C99D151B41F61F474 /* DAppTxDetailsInteractor.swift */; }; 9D5926790B055C56FB74B282 /* AccountManagementProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B5072E250B7277F605855B3 /* AccountManagementProtocols.swift */; }; + 9DE1757D047A4D1E97913774 /* GovernanceUnlockConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D3FE2CE7F9F2836755DBA63 /* GovernanceUnlockConfirmProtocols.swift */; }; + 9DED20EB20A872E682CB402A /* ReferendumFullDetailsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F6DA24E0481A3678F2EF809 /* ReferendumFullDetailsProtocols.swift */; }; 9DFB37659A6B911A4D54623E /* AccountConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E992CCDC1D581F7E9D3F1CA /* AccountConfirmInteractor.swift */; }; 9E15912C35D50C6D738FD04C /* AccountConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5002B8FA2695F470587677D2 /* AccountConfirmProtocols.swift */; }; 9E40464B7687006B1EE75C72 /* LocksProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F9944B0577EFF25A0643FE /* LocksProtocols.swift */; }; 9E4E458C92D12B24D5EAD893 /* ControllerAccountInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 748E0AF1A286016CB220155C /* ControllerAccountInteractor.swift */; }; 9F3E2D64D77BF89B474BF1E3 /* DAppOperationConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43FBC2EA83A121CEBD25549D /* DAppOperationConfirmViewController.swift */; }; 9F4A48B1BE3A1110A0CF9F36 /* ReferralCrowdloanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DDDB2B35CD3299F50613141 /* ReferralCrowdloanViewController.swift */; }; + A05C2B3458F12EFE1633D917 /* ReferendumFullDescriptionPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAEF44ADECD66B49E3430365 /* ReferendumFullDescriptionPresenter.swift */; }; A07A987DE3047AF1A786D511 /* DAppListViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11BB49F165F64A7EF6418EB4 /* DAppListViewLayout.swift */; }; A090FF206B56A0E465C62072 /* CrowdloanListPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86F7A369E31DCB9ABD556EE9 /* CrowdloanListPresenter.swift */; }; A14308E2633921838166C843 /* ParaStkUnstakeConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F2450A063F4D66EFDF6B8A /* ParaStkUnstakeConfirmViewFactory.swift */; }; @@ -2243,6 +2485,7 @@ A2BE8967FC1609D61E4131BE /* ParaStkYieldBoostStopViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2B438707EA6C81C48EAB4CE /* ParaStkYieldBoostStopViewController.swift */; }; A2F7908210A0398EDBBA89BD /* NftDetailsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3CC9CAB00B604CD1AC5B4D8 /* NftDetailsViewFactory.swift */; }; A32E1373E3671D518FFC3BC2 /* YourValidatorListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B90CEC70F101AA25A4C00021 /* YourValidatorListViewController.swift */; }; + A3BDFA01A32B6C7463E6EFFA /* GovernanceUnlockConfirmPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 513A449CCF5A417B67B7067D /* GovernanceUnlockConfirmPresenter.swift */; }; A5880E3789BC9E30835BDCC7 /* TransferSetupViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8202B83B2DF36439CB6449C6 /* TransferSetupViewFactory.swift */; }; A714CEAF7A86292E8D679056 /* ParaStkStakeSetupViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C7955BBDC93BC07D069B8F /* ParaStkStakeSetupViewFactory.swift */; }; A748D64F6048192E16E5BE44 /* ParaStkUnstakeConfirmViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CD36AD8C414F8973CDA8A0F /* ParaStkUnstakeConfirmViewLayout.swift */; }; @@ -2279,6 +2522,7 @@ AE528E4D26852C380058935A /* ValidatorSearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE528E4C26852C380058935A /* ValidatorSearchViewModel.swift */; }; AE528E4F26852E410058935A /* ValidatorSearchViewModelFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE528E4E26852E410058935A /* ValidatorSearchViewModelFactory.swift */; }; AE5A205F26A5A54800925400 /* ExtrinsicOperationFactoryStub.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5A205E26A5A54800925400 /* ExtrinsicOperationFactoryStub.swift */; }; + AE6C737BD94BCD88A06287E2 /* ReferendumFullDescriptionProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 722DC609FE13ACBEE4328873 /* ReferendumFullDescriptionProtocols.swift */; }; AE6DE7322627EA930018D5B5 /* PayoutCall.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6DE7312627EA930018D5B5 /* PayoutCall.swift */; }; AE6F7FDF2685E812002BBC3E /* ValidatorListFilterPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6F7FD82685E812002BBC3E /* ValidatorListFilterPresenter.swift */; }; AE6F7FE02685E812002BBC3E /* ValidatorListFilterProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6F7FD92685E812002BBC3E /* ValidatorListFilterProtocols.swift */; }; @@ -2383,6 +2627,7 @@ B1BB78684B059A113AB3AD30 /* DAppPhishingViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36AE1C39767C4CBE3229089D /* DAppPhishingViewFactory.swift */; }; B1CCC5B7BF30F6ACA309B112 /* StakingRedeemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB7F5F9B54BE4234C5682BDE /* StakingRedeemViewController.swift */; }; B1F86CA723BB4D69C5EF989D /* ParaStkStakeSetupProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D8246CDA02F544AF9DA2B11 /* ParaStkStakeSetupProtocols.swift */; }; + B30FEC6F62918BC6F38396A2 /* ReferendumVoteConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E2C32A42B0084AFF2911F6E /* ReferendumVoteConfirmViewController.swift */; }; B310C3D126C304851A40CFA9 /* ChainAddressDetailsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E1485C7B322E477D445C84 /* ChainAddressDetailsProtocols.swift */; }; B316F0D2BDF0F44AD27F58E0 /* MoonbeamTermsWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4F2B1A2A919663ABEE3367A /* MoonbeamTermsWireframe.swift */; }; B317AB093D99677D292121C4 /* YourWalletsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84ED3A7899C88876AB3DCA5F /* YourWalletsViewController.swift */; }; @@ -2405,7 +2650,6 @@ BEE36A5554B026BD7BCD3199 /* StakingAmountPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40B47961B2254E8A4D8EC588 /* StakingAmountPresenter.swift */; }; BFC8C5A2C95D6EDF97D73732 /* ParaStkCollatorsSearchPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18EBB92677F15F1E41762DE4 /* ParaStkCollatorsSearchPresenter.swift */; }; C01C5F1C8CB67B0D5CBE9FB1 /* StakingMainPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 502D42F4A480889BA226CAD3 /* StakingMainPresenter.swift */; }; - C083E2FC291784BF60EE73BA /* CrowdloanListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D852BF894D6E06EB9A92BC71 /* CrowdloanListViewController.swift */; }; C0A7710415B9C9BA496320E7 /* ParaStkYieldBoostSetupProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C2437D345C3D9B12AEE1E28 /* ParaStkYieldBoostSetupProtocols.swift */; }; C0B0DDF638915E8259B1CD67 /* StakingRedeemPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB2478DE3AF0885A3ED7ED8 /* StakingRedeemPresenter.swift */; }; C102544345E604976BF7AFFC /* LedgerNetworkSelectionWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 935B5118367A118FC86B66C8 /* LedgerNetworkSelectionWireframe.swift */; }; @@ -2421,6 +2665,7 @@ C46EEF6A9A9A601694E72DB1 /* StakingMainWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F09665083031502F9693F8 /* StakingMainWireframe.swift */; }; C4A4D40A08DAB4A71C21C1A8 /* StakingRedeemInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560C48D7A83F51F001622D71 /* StakingRedeemInteractor.swift */; }; C5B6C00F8B0E3D89CBF1A8DB /* ParaStkSelectCollatorsViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2336E4CAF4A1F627C39093FF /* ParaStkSelectCollatorsViewFactory.swift */; }; + C644308270C29AC6F90CFEA6 /* ReferendumDetailsWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E2EB9EE4A87BD4A74040784 /* ReferendumDetailsWireframe.swift */; }; C6E5671768DA68535DA5B1C7 /* ControllerAccountConfirmationViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F02DBCA4A63A5E52E3739374 /* ControllerAccountConfirmationViewFactory.swift */; }; C729BF3E60E6825AEED11383 /* ParaStkRedeemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD16D5FA4115F2A525BDE4F /* ParaStkRedeemViewController.swift */; }; C74B44F382EDAE5CB5A8468F /* ParaStkUnstakeConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99C973B203F72D6233718CD4 /* ParaStkUnstakeConfirmProtocols.swift */; }; @@ -2446,12 +2691,14 @@ CE2792E78B14CE02394D8CF4 /* ReferralCrowdloanViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 594BC61689EC942ED0A64A4A /* ReferralCrowdloanViewLayout.swift */; }; CE4C1344F03A5132C601A594 /* LocksViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4D2E89D40718677685CE1 /* LocksViewController.swift */; }; CE773CEC15A83AA6D0B404B8 /* DAppListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA2BB29AE8E556E6756A4F02 /* DAppListViewController.swift */; }; + D1C4208A89633395AF2FDB74 /* ReferendumVoteSetupViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A3105383F2825940D0105D5 /* ReferendumVoteSetupViewLayout.swift */; }; D1C6EABB48DC3EE254E5A095 /* CrowdloanContributionConfirmPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F5B57A24265C36A5F19B78 /* CrowdloanContributionConfirmPresenter.swift */; }; D344C6DAC1F8BB6152BA8DD0 /* RecommendedValidatorListProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6C6573C52692E4A56E35FF9 /* RecommendedValidatorListProtocols.swift */; }; D3B48F82A875E301D749AC0B /* StakingUnbondConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5674162035C7D9F226FA9964 /* StakingUnbondConfirmViewController.swift */; }; D3F199376DAEBF380C5FFD9D /* DAppAddFavoriteViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8A759A20A4A39B3B0E2A735 /* DAppAddFavoriteViewLayout.swift */; }; D565DB5ED3B8B4D9BCFB4C21 /* CustomValidatorListPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14E3337CDD7C831AEAA4582F /* CustomValidatorListPresenter.swift */; }; D567BAAF620EDB9F4975C800 /* DAppAuthConfirmProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75CFAA1D2D04553B10421C69 /* DAppAuthConfirmProtocols.swift */; }; + D5BB3A36DB9ADD25EE43109F /* GovernanceUnlockConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 358E87C8E90981E6D9515745 /* GovernanceUnlockConfirmViewFactory.swift */; }; D600448CB75095E6873E542F /* DAppTxDetailsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D383344BEDAEDC76A6BE2CE /* DAppTxDetailsProtocols.swift */; }; D6511F7C3E55197F82AB552C /* RecommendedValidatorListViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE4AF0849E32E5B9C72E2ABB /* RecommendedValidatorListViewFactory.swift */; }; D6D9D16440AB588F581AF5BA /* ParaStkYourCollatorsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A6E9A6472158C37D3A62F5 /* ParaStkYourCollatorsPresenter.swift */; }; @@ -2480,12 +2727,14 @@ DCE9FE8A75C2FE7B5CB92CC2 /* LedgerWalletConfirmWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8167536168325942DA6892E1 /* LedgerWalletConfirmWireframe.swift */; }; DD090C2ED91726FF7779F6C7 /* WalletHistoryFilterViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB10C8DA56E92C280D66BE8 /* WalletHistoryFilterViewFactory.swift */; }; DE03CA5AD7F1D0B80DFF13B6 /* DAppBrowserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1855972C88E512AED37FD312 /* DAppBrowserViewController.swift */; }; + DE52F23521D54A07F558EB1B /* ReferendumVoteConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD1A35F4D82F97C9663F1CD4 /* ReferendumVoteConfirmInteractor.swift */; }; DECE047E7BBE2B9251A09353 /* ParaStkUnstakeConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6060CE86A7EA49AD05329C /* ParaStkUnstakeConfirmViewController.swift */; }; DEF53463C2C780D702E9C2CA /* ParaStkSelectCollatorsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36AB8804B896E72AC81879C6 /* ParaStkSelectCollatorsPresenter.swift */; }; E04E3ABA985AA3D89AE20BF5 /* CrowdloanYourContributionsProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042E8DD6E5F5FD65361A7BDD /* CrowdloanYourContributionsProtocols.swift */; }; E0CBD1D747361D121555FD51 /* ParaStkRedeemViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BEEFB03BBA45F5143484398 /* ParaStkRedeemViewFactory.swift */; }; E14F809C3917EFA4B5388AC8 /* AccountConfirmViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14CA4551FCC2EBD078E2242 /* AccountConfirmViewFactory.swift */; }; E221892A5B6A41A944B88336 /* ParaStkYieldBoostStartProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50829CD47D3F60E3067418B4 /* ParaStkYieldBoostStartProtocols.swift */; }; + E28F3762EAC9A4E5D21342D4 /* GovernanceUnlockSetupViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95E4AF529B896F7E58671A74 /* GovernanceUnlockSetupViewFactory.swift */; }; E2A9BC1477D81DDDE519404C /* DAppOperationConfirmWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CECA2C5A0EFEBFDBB3C90C /* DAppOperationConfirmWireframe.swift */; }; E2F07BE11A2A6E862164C681 /* ParaStkUnstakeWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0D4E719EB5AC6CDB97BAB5C /* ParaStkUnstakeWireframe.swift */; }; E2F3E726280823CF00CF31B5 /* ETHAccountInjection.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F3E725280823CF00CF31B5 /* ETHAccountInjection.swift */; }; @@ -2493,6 +2742,7 @@ E325FBFE10A037E58525DA66 /* DAppSearchViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF9C192200F9B998724FC6C /* DAppSearchViewFactory.swift */; }; E36D8899C003C0AFA5BE290F /* AssetsManageProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90681A889A40F7163CBE9B6B /* AssetsManageProtocols.swift */; }; E37BB7A393FFEFC350B4EA3D /* AdvancedWalletProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0043E77B2DBB3546A9E54C4B /* AdvancedWalletProtocols.swift */; }; + E4021A6E90432CC5C797A647 /* ReferendumVotersWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9FBF368FBB46AD4DE606DB1 /* ReferendumVotersWireframe.swift */; }; E477B09B47A3021EF1CE66F0 /* ParaStkRedeemViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2D3F02FD57B4C28BA09C5F8 /* ParaStkRedeemViewLayout.swift */; }; E488F3E052650FF525D41D63 /* LedgerTxConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 313B89948DC631DE61E01007 /* LedgerTxConfirmInteractor.swift */; }; E5DC2660D78D3CC9FC48E748 /* LedgerAccountConfirmationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95A04CDB05A013ED57D3DEA3 /* LedgerAccountConfirmationViewController.swift */; }; @@ -2504,6 +2754,7 @@ E8C54C2441B78248B6067204 /* YourWalletsViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2509FEA85677165C4CCCFF /* YourWalletsViewLayout.swift */; }; E8F04B9E557AD6BD0279EA6F /* ParitySignerAddressesViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = E20124142C4011901EF55AAA /* ParitySignerAddressesViewLayout.swift */; }; E9625CE429290F5504728D62 /* NftListWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F0AFEA616FDDF846F3F3650 /* NftListWireframe.swift */; }; + EAAFB082E2BB0CA418714061 /* ReferendumFullDetailsViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57CDCB8CF3D8EBE5DA7A5A30 /* ReferendumFullDetailsViewLayout.swift */; }; EB376E61CD1C39AC148DE80C /* NftListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95A60B27D3A045E0DEF23775 /* NftListViewController.swift */; }; EB544E8D26ABEE4ADE2F939F /* AnalyticsRewardDetailsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC0C84704B8876688E59FA58 /* AnalyticsRewardDetailsInteractor.swift */; }; EB5F587A71CCE1F0F86154CF /* ControllerAccountViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 002A29AE58EB53E915330490 /* ControllerAccountViewFactory.swift */; }; @@ -2526,12 +2777,16 @@ EFF8F905CE4E8A212FE79EE4 /* ParaStkYourCollatorsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B5E099C1E3DC3730DD503BE /* ParaStkYourCollatorsViewController.swift */; }; F022F1444E0F75CCA42F4648 /* YourValidatorListProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = A31780E84948D7FE632ECB02 /* YourValidatorListProtocols.swift */; }; F0675F495766D07473B065F7 /* CrowdloanYourContributionsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3251EE6FFC95D656BA2146F4 /* CrowdloanYourContributionsInteractor.swift */; }; + F0ADB63765A8EAA19D85C30B /* ReferendumVoteConfirmPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB47990BC7A594E663DAC00 /* ReferendumVoteConfirmPresenter.swift */; }; F0B74A766BF50518323AB25C /* DAppAuthConfirmWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01A9D9D13EC9D921A2C8FB6D /* DAppAuthConfirmWireframe.swift */; }; F0C3DB0CEE1975626B0014A8 /* StakingUnbondConfirmInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C34D496D0F57E685237B3A7 /* StakingUnbondConfirmInteractor.swift */; }; F17C7FA0DB540A803558D1BB /* AnalyticsRewardDetailsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85211D55E2AF0A697FB3EB84 /* AnalyticsRewardDetailsPresenter.swift */; }; + F1BED07F67119E1BD052952A /* ReferendumVoteSetupWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55B2C456A80FA66E6F140814 /* ReferendumVoteSetupWireframe.swift */; }; F20C8D17ABF18B7104E14394 /* StakingAmountInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 312DE7ADA5ABC3214AD3D4AD /* StakingAmountInteractor.swift */; }; F27AAD7BC84793FA63027F8C /* AssetsManageInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA134C6DB56DE1DFBA1B88B4 /* AssetsManageInteractor.swift */; }; + F35B520D7955A70588AB593C /* ReferendumVoteConfirmWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C784EDFB9227884E30FBE6E /* ReferendumVoteConfirmWireframe.swift */; }; F382BF4F8C3C46C7C21DE5C0 /* ParaStkUnstakeConfirmPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86DCB6F3977BDE1BDC7BC3F9 /* ParaStkUnstakeConfirmPresenter.swift */; }; + F3BB50CCA38C9B47FDBEDF53 /* ReferendumVotersInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23CC3812E4DFC26484324D57 /* ReferendumVotersInteractor.swift */; }; F3D2AC37709EAF088A594B73 /* AccountManagementViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2FCA2DD3A8898D64CBC9F97 /* AccountManagementViewController.swift */; }; F400A7C2260CE1670061D576 /* StakingRewardStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = F400A7C1260CE1670061D576 /* StakingRewardStatus.swift */; }; F402BC83273ACDC30075F803 /* AstarBonusService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F402BC82273ACDC30075F803 /* AstarBonusService.swift */; }; @@ -2695,7 +2950,7 @@ F4F65C3326D8B81A002EE838 /* FWChartViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F65C3226D8B81A002EE838 /* FWChartViewProtocol.swift */; }; F4F65C3826D8B86F002EE838 /* FWXAxisEmptyValueFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F65C3726D8B86F002EE838 /* FWXAxisEmptyValueFormatter.swift */; }; F4F65C3D26D8B9DD002EE838 /* FWYAxisChartFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F65C3C26D8B9DD002EE838 /* FWYAxisChartFormatter.swift */; }; - F4F69E282731B0B200214542 /* CrowdloanTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F69E272731B0B200214542 /* CrowdloanTableHeaderView.swift */; }; + F4F69E282731B0B200214542 /* VoteTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F69E272731B0B200214542 /* VoteTableHeaderView.swift */; }; F4FDA0F826A57626003D753B /* BabeEraOperationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FDA0F726A57626003D753B /* BabeEraOperationFactory.swift */; }; F4FDA0FD26A57860003D753B /* EraCountdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FDA0FC26A57860003D753B /* EraCountdown.swift */; }; F5CA222FA684AAC8B556E667 /* DAppAddFavoritePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F599B3A847492204853ADB /* DAppAddFavoritePresenter.swift */; }; @@ -2709,6 +2964,7 @@ F85E4E18D7D535538D52B950 /* ParaStkSelectCollatorsViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AE545FC135A5D1C49CE3770 /* ParaStkSelectCollatorsViewLayout.swift */; }; F85F1BCAD47F0596FBFBA110 /* ParaStkRebondWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C2B583DB30C6C818B0F952D /* ParaStkRebondWireframe.swift */; }; F88D85C73094F6A1FC494D87 /* DAppSearchWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A191B92AD171FDDDD8C30E2 /* DAppSearchWireframe.swift */; }; + F8C0CA3DDBCB5E509295F099 /* ReferendumFullDescriptionViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAF9ED27CF12B7DA8B1378CF /* ReferendumFullDescriptionViewFactory.swift */; }; FA62AACACA15CB04275DE957 /* ParaStkYourCollatorsInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21A2FD02269432066884F5AF /* ParaStkYourCollatorsInteractor.swift */; }; FA894DFA8EEBB0B4562CD788 /* LedgerAccountConfirmationViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392B5AA43C68E640C9FDEE04 /* LedgerAccountConfirmationViewFactory.swift */; }; FB405A41F9B89097016D4C78 /* ChainAddressDetailsWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 245DED717B5B3FC380C24E3D /* ChainAddressDetailsWireframe.swift */; }; @@ -2743,6 +2999,8 @@ 00E1485C7B322E477D445C84 /* ChainAddressDetailsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ChainAddressDetailsProtocols.swift; sourceTree = ""; }; 0100701AA69652CB91ACBD97 /* AssetListInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetListInteractor.swift; sourceTree = ""; }; 01A9D9D13EC9D921A2C8FB6D /* DAppAuthConfirmWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAuthConfirmWireframe.swift; sourceTree = ""; }; + 01B2EBE8C02491A06121705A /* GovernanceUnlockConfirmViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmViewController.swift; sourceTree = ""; }; + 024B7E67C0603C53981EC394 /* ReferendumVoteSetupInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteSetupInteractor.swift; sourceTree = ""; }; 02ACCC85B2CCF3D9392CA9B4 /* CrowdloanListProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanListProtocols.swift; sourceTree = ""; }; 02D8F02830944DBAF72D8A41 /* MoonbeamTermsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MoonbeamTermsProtocols.swift; sourceTree = ""; }; 037D3CE23FFD176F4F7DABC0 /* ParaStkStakeConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkStakeConfirmViewFactory.swift; sourceTree = ""; }; @@ -2765,6 +3023,7 @@ 0C34D496D0F57E685237B3A7 /* StakingUnbondConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingUnbondConfirmInteractor.swift; sourceTree = ""; }; 0C797A5B5863A026E84062AE /* MessageSheetProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MessageSheetProtocols.swift; sourceTree = ""; }; 0CDFFCC54A504417F4ACE7AA /* NftListInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NftListInteractor.swift; sourceTree = ""; }; + 0D3FE2CE7F9F2836755DBA63 /* GovernanceUnlockConfirmProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmProtocols.swift; sourceTree = ""; }; 0D6E67AD564867E121601F18 /* WalletsListPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WalletsListPresenter.swift; sourceTree = ""; }; 0D9C85AB0C9D53B522DCF3C5 /* CreateWatchOnlyInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreateWatchOnlyInteractor.swift; sourceTree = ""; }; 1039AA3654461114FBB86844 /* DAppTxDetailsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppTxDetailsPresenter.swift; sourceTree = ""; }; @@ -2798,6 +3057,7 @@ 1D42F468C639CA69621F0C03 /* LedgerWalletConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerWalletConfirmViewFactory.swift; sourceTree = ""; }; 1DC6917929E4A752B79FE554 /* OperationDetailsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OperationDetailsWireframe.swift; sourceTree = ""; }; 1DECC58C93DB18E79A03B5A0 /* AssetSelectionProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetSelectionProtocols.swift; sourceTree = ""; }; + 1E067006C1BC9DFCA5E8DB86 /* GovernanceUnlockConfirmWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmWireframe.swift; sourceTree = ""; }; 1E5CB64B91B35804B3671456 /* ControllerAccountPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ControllerAccountPresenter.swift; sourceTree = ""; }; 1F3A05E0F46351784030D1AA /* ChainAddressDetailsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ChainAddressDetailsPresenter.swift; sourceTree = ""; }; 1F3B726402D4DB25059EF156 /* AnalyticsValidatorsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnalyticsValidatorsProtocols.swift; sourceTree = ""; }; @@ -2813,6 +3073,7 @@ 2377F8FB07B47637346249F5 /* StakingRewardDetailsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardDetailsViewFactory.swift; sourceTree = ""; }; 23A74BDB54D503FA2BFBEF35 /* StakingUnbondSetupProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingUnbondSetupProtocols.swift; sourceTree = ""; }; 23BC71941B91D3E372CDB11C /* CrowdloanContributionSetupViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionSetupViewLayout.swift; sourceTree = ""; }; + 23CC3812E4DFC26484324D57 /* ReferendumVotersInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVotersInteractor.swift; sourceTree = ""; }; 245DED717B5B3FC380C24E3D /* ChainAddressDetailsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ChainAddressDetailsWireframe.swift; sourceTree = ""; }; 24B23BAD22C87DA5F324B44F /* DAppAuthSettingsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAuthSettingsWireframe.swift; sourceTree = ""; }; 256215C11DC0E091660034EA /* CrowdloanYourContributionsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanYourContributionsViewController.swift; sourceTree = ""; }; @@ -2862,6 +3123,7 @@ 2ECD8589BD30A8BE9492AD87 /* StakingRewardPayoutsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardPayoutsPresenter.swift; sourceTree = ""; }; 2F10F130391C4B3652FE8F59 /* ParitySignerTxScanProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerTxScanProtocols.swift; sourceTree = ""; }; 2F8A45125DF93218FC6C5119 /* ParaStkYourCollatorsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYourCollatorsViewFactory.swift; sourceTree = ""; }; + 2FC9F0E50317E1583EA8E345 /* GovernanceUnlockSetupViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockSetupViewController.swift; sourceTree = ""; }; 301287CBBF23EF58186A7BB5 /* DAppAuthConfirmViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAuthConfirmViewLayout.swift; sourceTree = ""; }; 3089A0A7C992300CE839A050 /* ParaStkYieldBoostStartPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostStartPresenter.swift; sourceTree = ""; }; 30F3EC1C2DAE60DD6BB99B42 /* StakingUnbondConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingUnbondConfirmViewFactory.swift; sourceTree = ""; }; @@ -2874,11 +3136,15 @@ 329C58A0AE09361F5ECD6D4E /* DAppSearchPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppSearchPresenter.swift; sourceTree = ""; }; 335E8C17DCB794733476AAE3 /* ParaStkStakeConfirmViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkStakeConfirmViewController.swift; sourceTree = ""; }; 336395FFC4B2104A9651A2DE /* StakingRewardPayoutsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardPayoutsViewFactory.swift; sourceTree = ""; }; + 33DFAA0EEEA7F99C6D1CF4B1 /* ReferendumFullDetailsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDetailsPresenter.swift; sourceTree = ""; }; + 3531B386DEF40108C34E7232 /* ReferendumVoteConfirmViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteConfirmViewLayout.swift; sourceTree = ""; }; 3558BD7D1B8CA1409BE74879 /* AccountManagementInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountManagementInteractor.swift; sourceTree = ""; }; 3574BADE9CF77599048C7010 /* CrowdloanContributionSetupWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionSetupWireframe.swift; sourceTree = ""; }; + 358E87C8E90981E6D9515745 /* GovernanceUnlockConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmViewFactory.swift; sourceTree = ""; }; 35A4A258D911C67F875E386D /* ParaStkCollatorFiltersViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkCollatorFiltersViewController.swift; sourceTree = ""; }; 365CAE2753E7D5F9B9DB7D1F /* CustomValidatorListInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CustomValidatorListInteractor.swift; sourceTree = ""; }; 367393F8CA6157A999F69573 /* AssetsSearchViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetsSearchViewLayout.swift; sourceTree = ""; }; + 369C65964F4D7E8D02EEC5EC /* ReferendumFullDetailsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDetailsViewFactory.swift; sourceTree = ""; }; 36AB8804B896E72AC81879C6 /* ParaStkSelectCollatorsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkSelectCollatorsPresenter.swift; sourceTree = ""; }; 36AE1C39767C4CBE3229089D /* DAppPhishingViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppPhishingViewFactory.swift; sourceTree = ""; }; 376F2C0E94A454FBBBB903F6 /* ParaStkYieldBoostStopInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostStopInteractor.swift; sourceTree = ""; }; @@ -2898,12 +3164,15 @@ 3BB7BFB2477E9F3893126931 /* DAppOperationConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppOperationConfirmViewFactory.swift; sourceTree = ""; }; 3BEEFB03BBA45F5143484398 /* ParaStkRedeemViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkRedeemViewFactory.swift; sourceTree = ""; }; 3C50BB281AD6DB3CF1493958 /* DAppOperationConfirmPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppOperationConfirmPresenter.swift; sourceTree = ""; }; + 3C535E8504943299B3E4A8EB /* ReferendumFullDetailsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDetailsViewController.swift; sourceTree = ""; }; + 3C784EDFB9227884E30FBE6E /* ReferendumVoteConfirmWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteConfirmWireframe.swift; sourceTree = ""; }; 3D2A26EC9537BD4275A03272 /* OperationDetailsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OperationDetailsPresenter.swift; sourceTree = ""; }; 3D383344BEDAEDC76A6BE2CE /* DAppTxDetailsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppTxDetailsProtocols.swift; sourceTree = ""; }; 3E6E41F045986002E1E26C12 /* DAppListWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppListWireframe.swift; sourceTree = ""; }; 3E992CCDC1D581F7E9D3F1CA /* AccountConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountConfirmInteractor.swift; sourceTree = ""; }; 3F1D5849A2EBF462B32F3A9C /* ExportSeedProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ExportSeedProtocols.swift; sourceTree = ""; }; 3F47E5832513985B89D06155 /* AccountExportPasswordWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountExportPasswordWireframe.swift; sourceTree = ""; }; + 3F6DA24E0481A3678F2EF809 /* ReferendumFullDetailsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDetailsProtocols.swift; sourceTree = ""; }; 3F7068913923A6DEEE9D8EA0 /* CrowdloanContributionSetupPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionSetupPresenter.swift; sourceTree = ""; }; 3F75722D2F921FD1C2D4105D /* CrowdloanContributionConfirmViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionConfirmViewController.swift; sourceTree = ""; }; 3FECFFBAB264397F9B2646CE /* ChangeWatchOnlyViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ChangeWatchOnlyViewController.swift; sourceTree = ""; }; @@ -2911,6 +3180,7 @@ 40B47961B2254E8A4D8EC588 /* StakingAmountPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingAmountPresenter.swift; sourceTree = ""; }; 4191E0055768541F6A3D8A61 /* StakingRewardPayoutsInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardPayoutsInteractor.swift; sourceTree = ""; }; 41DFB2757D029FB5DF3CEBC2 /* WalletHistoryFilterProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WalletHistoryFilterProtocols.swift; sourceTree = ""; }; + 42594560B2928C79B87275D8 /* ReferendumVotersViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVotersViewController.swift; sourceTree = ""; }; 43AE3AE09F98E37C15BA87A1 /* LedgerInstructionsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerInstructionsWireframe.swift; sourceTree = ""; }; 43FBC2EA83A121CEBD25549D /* DAppOperationConfirmViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppOperationConfirmViewController.swift; sourceTree = ""; }; 44809BCF44D7329266A60A9D /* ParitySignerAddConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddConfirmInteractor.swift; sourceTree = ""; }; @@ -2929,6 +3199,7 @@ 4C602661DE4D6CAC482AF721 /* ParaStkCollatorsSearchViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkCollatorsSearchViewFactory.swift; sourceTree = ""; }; 4C71DEF78B69F017DF460AB7 /* CrowdloanContributionSetupViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionSetupViewController.swift; sourceTree = ""; }; 4D8246CDA02F544AF9DA2B11 /* ParaStkStakeSetupProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkStakeSetupProtocols.swift; sourceTree = ""; }; + 4E2C32A42B0084AFF2911F6E /* ReferendumVoteConfirmViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteConfirmViewController.swift; sourceTree = ""; }; 4E2CF76ABE7BC9A99724D393 /* ParitySignerAddConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddConfirmViewFactory.swift; sourceTree = ""; }; 4E3749525FED4CA4CD0DCDF5 /* CreateWatchOnlyPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreateWatchOnlyPresenter.swift; sourceTree = ""; }; 4F21FBC9BE578A300A77E9C5 /* ParaStkRebondViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkRebondViewLayout.swift; sourceTree = ""; }; @@ -2936,7 +3207,9 @@ 5002B8FA2695F470587677D2 /* AccountConfirmProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountConfirmProtocols.swift; sourceTree = ""; }; 502D42F4A480889BA226CAD3 /* StakingMainPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingMainPresenter.swift; sourceTree = ""; }; 50829CD47D3F60E3067418B4 /* ParaStkYieldBoostStartProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostStartProtocols.swift; sourceTree = ""; }; + 513A449CCF5A417B67B7067D /* GovernanceUnlockConfirmPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmPresenter.swift; sourceTree = ""; }; 5147BFCC44EB3938D50EE8D9 /* DAppPhishingPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppPhishingPresenter.swift; sourceTree = ""; }; + 5159EA2661A6CBE123CCF891 /* ReferendumVoteSetupProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteSetupProtocols.swift; sourceTree = ""; }; 518305BB475DE40E94DCBD5D /* DAppPhishingWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppPhishingWireframe.swift; sourceTree = ""; }; 5278A5F4178922A240590334 /* DAppBrowserViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppBrowserViewLayout.swift; sourceTree = ""; }; 52B7577593D1A0789B60FF70 /* NftListViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NftListViewLayout.swift; sourceTree = ""; }; @@ -2945,11 +3218,13 @@ 52F8D055D0481469073AA859 /* StakingPayoutConfirmationProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingPayoutConfirmationProtocols.swift; sourceTree = ""; }; 53235E51143C6E93303E30FE /* DAppSearchViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppSearchViewController.swift; sourceTree = ""; }; 537CCA1F2667A51731C56C88 /* CreateWatchOnlyProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CreateWatchOnlyProtocols.swift; sourceTree = ""; }; + 53A058D4A585F253CBF2968D /* ReferendumVoteSetupViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteSetupViewController.swift; sourceTree = ""; }; 53B5C1C920BFDA8F5C9C89D9 /* ParaStkRedeemInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkRedeemInteractor.swift; sourceTree = ""; }; 53BE9DEF100A373868EDD03F /* ParaStkSelectCollatorsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkSelectCollatorsWireframe.swift; sourceTree = ""; }; 53C2612BBF75CF0FBD91764E /* ParaStkCollatorsSearchWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkCollatorsSearchWireframe.swift; sourceTree = ""; }; 5467B9B6AEDB33F565D130A1 /* ParaStkUnstakeViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakeViewFactory.swift; sourceTree = ""; }; 54FB887490A8B33890B4E0E4 /* ControllerAccountConfirmationPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ControllerAccountConfirmationPresenter.swift; sourceTree = ""; }; + 55B2C456A80FA66E6F140814 /* ReferendumVoteSetupWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteSetupWireframe.swift; sourceTree = ""; }; 55E6B5C44D7F43B5C14901ED /* ParaStkUnstakeConfirmWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakeConfirmWireframe.swift; sourceTree = ""; }; 560C48D7A83F51F001622D71 /* StakingRedeemInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRedeemInteractor.swift; sourceTree = ""; }; 5674162035C7D9F226FA9964 /* StakingUnbondConfirmViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingUnbondConfirmViewController.swift; sourceTree = ""; }; @@ -2958,6 +3233,8 @@ 57535268534B154B42ED51CE /* MessageSheetViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MessageSheetViewFactory.swift; sourceTree = ""; }; 578743E9101B334BFBE44CB6 /* ParaStkRedeemWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkRedeemWireframe.swift; sourceTree = ""; }; 57C624E71FCE0FFF8EAD5BA9 /* RecommendedValidatorListWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = RecommendedValidatorListWireframe.swift; sourceTree = ""; }; + 57CDCB8CF3D8EBE5DA7A5A30 /* ReferendumFullDetailsViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDetailsViewLayout.swift; sourceTree = ""; }; + 57E6825E525785A1A12C62E7 /* ReferendumFullDescriptionWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDescriptionWireframe.swift; sourceTree = ""; }; 58612684146AD03AD7BC30DF /* ChangeWatchOnlyViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ChangeWatchOnlyViewLayout.swift; sourceTree = ""; }; 594BC61689EC942ED0A64A4A /* ReferralCrowdloanViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferralCrowdloanViewLayout.swift; sourceTree = ""; }; 597A3C3F2937333D0EC7ABD5 /* AdvancedWalletViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdvancedWalletViewController.swift; sourceTree = ""; }; @@ -2967,10 +3244,12 @@ 5AD16D5FA4115F2A525BDE4F /* ParaStkRedeemViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkRedeemViewController.swift; sourceTree = ""; }; 5B8B0940B2CB25AD9C36206E /* SelectValidatorsConfirmViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SelectValidatorsConfirmViewController.swift; sourceTree = ""; }; 5BCDAB970C17F9798AC79B08 /* DAppTxDetailsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppTxDetailsViewController.swift; sourceTree = ""; }; + 5C6CCACED8D5AFA6543845B7 /* ReferendumVoteSetupPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteSetupPresenter.swift; sourceTree = ""; }; 5C92E3ED704CB0BBAB3A669F /* CrowdloanContributionConfirmViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionConfirmViewLayout.swift; sourceTree = ""; }; 5C96E41F878ED0A0A6F469D3 /* CrowdloanContributionSetupViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionSetupViewFactory.swift; sourceTree = ""; }; 5CD36AD8C414F8973CDA8A0F /* ParaStkUnstakeConfirmViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakeConfirmViewLayout.swift; sourceTree = ""; }; 5D0E02AA5D3EBA9B94950241 /* SelectValidatorsConfirmWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SelectValidatorsConfirmWireframe.swift; sourceTree = ""; }; + 5E2EB9EE4A87BD4A74040784 /* ReferendumDetailsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsWireframe.swift; sourceTree = ""; }; 5EAF3AEE27F7901458B39A7A /* Pods-novawalletAll-novawalletIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-novawalletAll-novawalletIntegrationTests.debug.xcconfig"; path = "Target Support Files/Pods-novawalletAll-novawalletIntegrationTests/Pods-novawalletAll-novawalletIntegrationTests.debug.xcconfig"; sourceTree = ""; }; 5F4F3C080F3D5C1E64475903 /* ParitySignerAddressesProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddressesProtocols.swift; sourceTree = ""; }; 5F791FE1B479CE1DF936F79F /* CrowdloanContributionConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionConfirmViewFactory.swift; sourceTree = ""; }; @@ -2983,7 +3262,6 @@ 62C5AF7E89A8C6CFF5AE03B1 /* YourWalletsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = YourWalletsProtocols.swift; sourceTree = ""; }; 62FA66143B25AA70B02CE461 /* ExportSeedViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ExportSeedViewFactory.swift; sourceTree = ""; }; 638A65DAC86BAF9EB4D2F2F8 /* StakingRewardDetailsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardDetailsWireframe.swift; sourceTree = ""; }; - 63F4BE52D0625CD8C21D2460 /* CrowdloanListViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanListViewLayout.swift; sourceTree = ""; }; 6475F9C6C6B095B9C5026CE9 /* ParaStkYieldBoostStartViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostStartViewController.swift; sourceTree = ""; }; 65AD15693E21C869DE1FDD17 /* UsernameSetupWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UsernameSetupWireframe.swift; sourceTree = ""; }; 661356CFE77B978610397907 /* OperationDetailsInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OperationDetailsInteractor.swift; sourceTree = ""; }; @@ -2991,6 +3269,7 @@ 6747B9F68F9E92845122D8D2 /* LedgerInstructionsViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerInstructionsViewLayout.swift; sourceTree = ""; }; 677CE34BFAB45122C57095F6 /* DAppBrowserViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppBrowserViewFactory.swift; sourceTree = ""; }; 67CAEB35921A61A8EC131AF8 /* LedgerDiscoverViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerDiscoverViewFactory.swift; sourceTree = ""; }; + 6A3105383F2825940D0105D5 /* ReferendumVoteSetupViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteSetupViewLayout.swift; sourceTree = ""; }; 6A695CA303926DFB5D54E309 /* LedgerAccountConfirmationViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerAccountConfirmationViewLayout.swift; sourceTree = ""; }; 6A825B6368073B06F32D7C8F /* StakingMainViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingMainViewFactory.swift; sourceTree = ""; }; 6AD8B98AB03AAF06AA891695 /* TransferConfirmViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TransferConfirmViewLayout.swift; sourceTree = ""; }; @@ -3007,6 +3286,7 @@ 70A399F229B59A854FEA6D91 /* LedgerPerformOperationViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerPerformOperationViewLayout.swift; sourceTree = ""; }; 71285CF636B32ACD8EB5519E /* ReferralCrowdloanViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferralCrowdloanViewFactory.swift; sourceTree = ""; }; 715F4A252715B543F11087AB /* DAppOperationConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppOperationConfirmInteractor.swift; sourceTree = ""; }; + 722DC609FE13ACBEE4328873 /* ReferendumFullDescriptionProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDescriptionProtocols.swift; sourceTree = ""; }; 72FEB9C65F32B7A4FD27C9EB /* ParitySignerTxScanInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerTxScanInteractor.swift; sourceTree = ""; }; 7306D50F278F6CC90DC88F27 /* AccountConfirmPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountConfirmPresenter.swift; sourceTree = ""; }; 7320E1CD9EA1A33EA29D0700 /* AnalyticsValidatorsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnalyticsValidatorsPresenter.swift; sourceTree = ""; }; @@ -3019,6 +3299,7 @@ 76AA6A6232B1CF2D5AF74D0D /* ParaStkUnstakeInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakeInteractor.swift; sourceTree = ""; }; 781FA4C896AF31B4035AFB38 /* ChainAddressDetailsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ChainAddressDetailsViewFactory.swift; sourceTree = ""; }; 782CC21A2F9EEF5DBA3AB1AA /* PurchaseProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PurchaseProtocols.swift; sourceTree = ""; }; + 78536852751EF56F58C5691E /* ReferendumDetailsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsPresenter.swift; sourceTree = ""; }; 7859654B7C1FAC269CA61E71 /* ParitySignerTxQrInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerTxQrInteractor.swift; sourceTree = ""; }; 78670B0926E92B75088D2D7B /* WalletHistoryFilterWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WalletHistoryFilterWireframe.swift; sourceTree = ""; }; 78A5A3C9077FCE262224B832 /* ParaStkYieldBoostSetupInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostSetupInteractor.swift; sourceTree = ""; }; @@ -3031,6 +3312,7 @@ 7ACF32611D345B87BCE29FE0 /* DAppAddFavoriteWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAddFavoriteWireframe.swift; sourceTree = ""; }; 7B1A00299D9B50045E1A1983 /* DAppAddFavoriteProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAddFavoriteProtocols.swift; sourceTree = ""; }; 7B81B239BD9C150BFE9A82B0 /* LocksViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LocksViewFactory.swift; sourceTree = ""; }; + 7B9CC114CB6B28CDC59F99CF /* GovernanceUnlockSetupPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockSetupPresenter.swift; sourceTree = ""; }; 7C70EBF83B2547452417E588 /* StakingRewardDetailsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardDetailsViewController.swift; sourceTree = ""; }; 7CBA1296E4C6E04EC9C5CA98 /* ParaStkUnstakePresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakePresenter.swift; sourceTree = ""; }; 7DDDB2B35CD3299F50613141 /* ReferralCrowdloanViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferralCrowdloanViewController.swift; sourceTree = ""; }; @@ -3065,8 +3347,14 @@ 8401AEBF2642A71D000B03E3 /* StakingRebondConfirmationProtocols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StakingRebondConfirmationProtocols.swift; sourceTree = ""; }; 8401F24E24E524900081D8F8 /* String+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Helpers.swift"; sourceTree = ""; }; 8402CC9B275B92AC00E5BF30 /* ControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlView.swift; sourceTree = ""; }; - 8402CC9D275B946100E5BF30 /* DAppItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppItemView.swift; sourceTree = ""; }; + 8402CC9D275B946100E5BF30 /* DAppItemViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppItemViewCell.swift; sourceTree = ""; }; + 840302DD292CE3EA0013F356 /* StorageEntryMetadata+TypeCheck.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StorageEntryMetadata+TypeCheck.swift"; sourceTree = ""; }; + 840302DF292CE4030013F356 /* CodingFactory+TypeCheck.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CodingFactory+TypeCheck.swift"; sourceTree = ""; }; + 840302E3292CFCF90013F356 /* AssetSelectionBasePresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetSelectionBasePresenter.swift; sourceTree = ""; }; + 840302E7292D00380013F356 /* GovernanceAssetSelectionPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceAssetSelectionPresenter.swift; sourceTree = ""; }; 84031C16263EC95C008FD9D4 /* SetPayeeCall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetPayeeCall.swift; sourceTree = ""; }; + 84033054290FD745009C18E6 /* ReferendumsUnlocksViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsUnlocksViewModel.swift; sourceTree = ""; }; + 84033056290FD8AB009C18E6 /* ReferendumsUnlocksTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsUnlocksTableViewCell.swift; sourceTree = ""; }; 84038FEB26FFBA4D00C73F3F /* PriceLocalStorageSubscriber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceLocalStorageSubscriber.swift; sourceTree = ""; }; 84038FED26FFBA6200C73F3F /* PriceLocalSubscriptionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceLocalSubscriptionHandler.swift; sourceTree = ""; }; 84038FEF26FFBE0600C73F3F /* JsonLocalStorageSubscriber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JsonLocalStorageSubscriber.swift; sourceTree = ""; }; @@ -3140,6 +3428,12 @@ 84117079285B10F5006F4DFB /* XcmAssetTransferFee.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcmAssetTransferFee.swift; sourceTree = ""; }; 8411707B285B1214006F4DFB /* XcmTransfers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcmTransfers.swift; sourceTree = ""; }; 8411707E285B15E0006F4DFB /* XcmTransfersSyncService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcmTransfersSyncService.swift; sourceTree = ""; }; + 8412219A28F04EA600715C82 /* GovMetadataLocalSubscriptionFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovMetadataLocalSubscriptionFactory.swift; sourceTree = ""; }; + 8412219D28F0514400715C82 /* ReferendumsMetadataPreviewProviderSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsMetadataPreviewProviderSource.swift; sourceTree = ""; }; + 8412219F28F051EE00715C82 /* GovMetadataLocalStorageSubscriber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovMetadataLocalStorageSubscriber.swift; sourceTree = ""; }; + 841221A128F0520300715C82 /* GovMetadataLocalStorageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovMetadataLocalStorageHandler.swift; sourceTree = ""; }; + 841221A328F0A3F200715C82 /* ReferendumAccountVoteLocal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumAccountVoteLocal.swift; sourceTree = ""; }; + 841221A528F13BA100715C82 /* GovernanceServiceFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceServiceFactory.swift; sourceTree = ""; }; 8412AF982789AB76008A6C22 /* PolkadotExtensionMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolkadotExtensionMetadata.swift; sourceTree = ""; }; 8412AF9A2789ABBC008A6C22 /* PolkadotExtensionMetadataResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolkadotExtensionMetadataResponse.swift; sourceTree = ""; }; 841493DB2604C144000D8D1A /* SubscanRewardData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscanRewardData.swift; sourceTree = ""; }; @@ -3231,6 +3525,14 @@ 84243094265B1888003E07EC /* CrowdloanMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanMetadata.swift; sourceTree = ""; }; 8424A8C6262EC0E50091BFB1 /* PayoutInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayoutInfo.swift; sourceTree = ""; }; 8424DB0A26B8466A008C834F /* ValidatorOperationFactoryProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidatorOperationFactoryProtocol.swift; sourceTree = ""; }; + 8425D0DF28FE738D003B782A /* ReferendumVoteSetupInteractorError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVoteSetupInteractorError.swift; sourceTree = ""; }; + 8425D0E228FE766B003B782A /* ReferendumVoteProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVoteProtocols.swift; sourceTree = ""; }; + 8425D0E528FE82CB003B782A /* ReferendumVoteInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVoteInteractor.swift; sourceTree = ""; }; + 8425D0E728FE8356003B782A /* ReferendumVoteInteractorError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVoteInteractorError.swift; sourceTree = ""; }; + 8425D0E928FE9A45003B782A /* GovernanceExtrinsicFactoryProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceExtrinsicFactoryProtocol.swift; sourceTree = ""; }; + 8425D0EB28FE9ACB003B782A /* Gov2ExtrinsicFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2ExtrinsicFactory.swift; sourceTree = ""; }; + 8425D0ED28FE9BF1003B782A /* ReferendumVoteAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVoteAction.swift; sourceTree = ""; }; + 8425D0EF28FE9CF0003B782A /* ConvictionVoting+Call.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ConvictionVoting+Call.swift"; sourceTree = ""; }; 8425EA8A25EA7AF200C307C9 /* UnappliedSlashes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnappliedSlashes.swift; sourceTree = ""; }; 8425EA8F25EA7E5800C307C9 /* ElectedValidatorInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElectedValidatorInfo.swift; sourceTree = ""; }; 8425EA9425EA82CE00C307C9 /* AccountIdentity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountIdentity.swift; sourceTree = ""; }; @@ -3242,6 +3544,10 @@ 84264EE0285B6C6700BF6D4A /* XcmTransfersSyncTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcmTransfersSyncTests.swift; sourceTree = ""; }; 84265E032523D20A005EEE2D /* WalletBaseAmountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBaseAmountView.swift; sourceTree = ""; }; 84265E052523D7BE005EEE2D /* WalletInputAmountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletInputAmountView.swift; sourceTree = ""; }; + 8427495028FEB6E500B2B70B /* GovernanceLockState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceLockState.swift; sourceTree = ""; }; + 8427495228FEB8C800B2B70B /* ReferendumNewVote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumNewVote.swift; sourceTree = ""; }; + 8427495428FEB92700B2B70B /* GovernanceLockStateFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceLockStateFactory.swift; sourceTree = ""; }; + 8427495628FEBFA400B2B70B /* ConvictionVoting+ConstantPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ConvictionVoting+ConstantPath.swift"; sourceTree = ""; }; 84274B8027A19AFF00A26657 /* OrmlTokenTransfer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrmlTokenTransfer.swift; sourceTree = ""; }; 842806F22847A51400702F3A /* AccountDetailsSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountDetailsSelectionView.swift; sourceTree = ""; }; 842806F42847A82500702F3A /* StackAccountSelectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackAccountSelectionCell.swift; sourceTree = ""; }; @@ -3391,6 +3697,12 @@ 843461CC26E2596E00DCE0CD /* WalletRemoteHistoryFiltering.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletRemoteHistoryFiltering.swift; sourceTree = ""; }; 843461CE26E25AD400DCE0CD /* SubscanHistoryItem+Wallet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SubscanHistoryItem+Wallet.swift"; sourceTree = ""; }; 843461D026E2641500DCE0CD /* SubqueryRewardOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubqueryRewardOperationFactory.swift; sourceTree = ""; }; + 843461E7290BF14400379936 /* ReferendumsSorting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsSorting.swift; sourceTree = ""; }; + 843461E9290C04C400379936 /* Gov2OperationFactory+Protocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Gov2OperationFactory+Protocol.swift"; sourceTree = ""; }; + 843461EB290D0D9400379936 /* GovernanceUnlockSchedule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockSchedule.swift; sourceTree = ""; }; + 843461F4290E4A1C00379936 /* GovernanceUnlocksCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlocksCalculator.swift; sourceTree = ""; }; + 843461F6290E4AF500379936 /* GovUnlocksCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovUnlocksCalculator.swift; sourceTree = ""; }; + 843461F9290E55D100379936 /* GovernanceUnlocksTestBuilding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlocksTestBuilding.swift; sourceTree = ""; }; 8434C9E325401EF3009E4191 /* TransactionHistoryItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionHistoryItem.swift; sourceTree = ""; }; 8434C9E525403686009E4191 /* CDTransactionHistoryItem+CoreDataDecodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CDTransactionHistoryItem+CoreDataDecodable.swift"; sourceTree = ""; }; 8434C9E92540AE51009E4191 /* ExtrinsicEraTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtrinsicEraTests.swift; sourceTree = ""; }; @@ -3432,6 +3744,7 @@ 8436EDE125895804004D9E97 /* RampProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RampProvider.swift; sourceTree = ""; }; 8436EDE625895846004D9E97 /* PurchaseProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchaseProvider.swift; sourceTree = ""; }; 8436EDEE25896722004D9E97 /* PurchaseAggregator+Default.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PurchaseAggregator+Default.swift"; sourceTree = ""; }; + 8438432D2913B3150048595C /* Gov1OperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov1OperationFactory.swift; sourceTree = ""; }; 8438C45A2655AC2600047E3F /* runtime-rococo.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "runtime-rococo.json"; sourceTree = ""; }; 8438E1CF24BFAAD2001BDB13 /* novawalletIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = novawalletIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8438E1D124BFAAD2001BDB13 /* JSONRPCTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONRPCTests.swift; sourceTree = ""; }; @@ -3460,6 +3773,7 @@ 843A2C7226A8641400266F53 /* MultiValueView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiValueView.swift; sourceTree = ""; }; 843A2C7626A86FD000266F53 /* TitleStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleStatusView.swift; sourceTree = ""; }; 843B1D79263EED5C00AF8957 /* StakingUnbondConfirmLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingUnbondConfirmLayout.swift; sourceTree = ""; }; + 843B6F4E28EEEF610086D4E0 /* Gov2OperationFactoryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2OperationFactoryTests.swift; sourceTree = ""; }; 843C49D724DD98CC00B71DDA /* DerivationPathConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DerivationPathConstants.swift; sourceTree = ""; }; 843C49DA24DF373000B71DDA /* AccountImportRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountImportRequest.swift; sourceTree = ""; }; 843C49DE24DF3CB300B71DDA /* AccountImportMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountImportMetadata.swift; sourceTree = ""; }; @@ -3486,6 +3800,19 @@ 844138EB2830106B00AFEF6D /* ParaStkNetworkInfoViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParaStkNetworkInfoViewModelFactory.swift; sourceTree = ""; }; 844138ED28303A2E00AFEF6D /* ParaStkStateViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParaStkStateViewModelFactory.swift; sourceTree = ""; }; 84415BC926E783EB005A3683 /* PayoutValidatorsForNominatorFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayoutValidatorsForNominatorFactory.swift; sourceTree = ""; }; + 8442001F28E6FDBE00C49C4A /* CrowdloanListViewManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanListViewManager.swift; sourceTree = ""; }; + 8442002228E6FE1E00C49C4A /* ReferendumsViewManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsViewManager.swift; sourceTree = ""; }; + 8442002428E6FEEE00C49C4A /* ReferendumsProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsProtocols.swift; sourceTree = ""; }; + 8442002628E6FFBA00C49C4A /* VoteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteViewController.swift; sourceTree = ""; }; + 8442002828E7004B00C49C4A /* VoteViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteViewLayout.swift; sourceTree = ""; }; + 8442002A28E9ACDB00C49C4A /* VotePresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VotePresenter.swift; sourceTree = ""; }; + 8442002C28E9ADB500C49C4A /* VoteInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteInteractor.swift; sourceTree = ""; }; + 8442002E28E9AEFB00C49C4A /* VoteWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteWireframe.swift; sourceTree = ""; }; + 8442003328E9BD3200C49C4A /* VoteChildPresenterFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteChildPresenterFactory.swift; sourceTree = ""; }; + 8442003528EA9DF100C49C4A /* VoteViewFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteViewFactory.swift; sourceTree = ""; }; + 8442003728EAA16600C49C4A /* ReferendumsPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsPresenter.swift; sourceTree = ""; }; + 8442003928EAA2D300C49C4A /* ReferendumsInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsInteractor.swift; sourceTree = ""; }; + 8442003B28EAA2E400C49C4A /* ReferendumsWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsWireframe.swift; sourceTree = ""; }; 844384AB28538D3000611CE2 /* RewardCalculatorEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RewardCalculatorEngine.swift; sourceTree = ""; }; 844384AD28538F4700611CE2 /* UniformCurveRewardEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UniformCurveRewardEngine.swift; sourceTree = ""; }; 844384AF285391D800611CE2 /* RewardCalculatorEngineFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RewardCalculatorEngineFactory.swift; sourceTree = ""; }; @@ -3538,6 +3865,7 @@ 8446F5F5281916D300B7A86C /* StakingRewardsHeaderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingRewardsHeaderCell.swift; sourceTree = ""; }; 8446F5F72819235B00B7A86C /* AssetIconView+Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AssetIconView+Style.swift"; sourceTree = ""; }; 8446F5F928192FF500B7A86C /* ListLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLoadingView.swift; sourceTree = ""; }; + 8448148028E46881007F64FF /* ConvictionVotingLocks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvictionVotingLocks.swift; sourceTree = ""; }; 8448221726B1624E007F4492 /* SelectValidatorsConfirmViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectValidatorsConfirmViewLayout.swift; sourceTree = ""; }; 8448221B26B1850D007F4492 /* TitleIconViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleIconViewModel.swift; sourceTree = ""; }; 8448336627FAAF780077FB55 /* TransakProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransakProvider.swift; sourceTree = ""; }; @@ -3605,8 +3933,15 @@ 8452585027ABC531004F9082 /* AssetsManageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetsManageViewModel.swift; sourceTree = ""; }; 8452585227ABCA07004F9082 /* HideZeroBalancesChanged.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HideZeroBalancesChanged.swift; sourceTree = ""; }; 8452585427ABF270004F9082 /* AssetListEmptyCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetListEmptyCell.swift; sourceTree = ""; }; + 84532D5C28E41D8500EF4ADC /* ConvictionVoting+StoragePath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ConvictionVoting+StoragePath.swift"; sourceTree = ""; }; + 84532D5E28E4210E00EF4ADC /* ConvictionVotesFetchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvictionVotesFetchTests.swift; sourceTree = ""; }; + 84532D6028E4234700EF4ADC /* ConvictionVotingForKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvictionVotingForKey.swift; sourceTree = ""; }; 845353BA2886E3B4006C871A /* OnboardingMainViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingMainViewLayout.swift; sourceTree = ""; }; 845353BC2886EB1A006C871A /* ButtonLargeControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonLargeControl.swift; sourceTree = ""; }; + 8453DE5428FD24FF0055345C /* GovernanceSubscriptionProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceSubscriptionProtocol.swift; sourceTree = ""; }; + 8453DE5628FD27390055345C /* Gov2SubscriptionFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2SubscriptionFactory.swift; sourceTree = ""; }; + 8453DE5828FD32780055345C /* NotEqualWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotEqualWrapper.swift; sourceTree = ""; }; + 8453DE5A28FD32B50055345C /* StorageSubscriptionObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorageSubscriptionObserver.swift; sourceTree = ""; }; 8454C21C2632A78900657DAD /* EventRecord.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventRecord.swift; sourceTree = ""; }; 8454C2642632B0EF00657DAD /* EventCodingPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventCodingPath.swift; sourceTree = ""; }; 8454C2692632B8CE00657DAD /* BalanceDepositEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceDepositEvent.swift; sourceTree = ""; }; @@ -3614,6 +3949,8 @@ 8454C2822632FC2500657DAD /* ExtrinsicProcessingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtrinsicProcessingTests.swift; sourceTree = ""; }; 845532CF2684690D00C2645D /* ParachainSlotLease.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParachainSlotLease.swift; sourceTree = ""; }; 845532D126846B6800C2645D /* ParachainLeaseInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParachainLeaseInfo.swift; sourceTree = ""; }; + 8455AB4428F7F05400974E88 /* ReferendumStatusViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumStatusViewModelFactory.swift; sourceTree = ""; }; + 8455AB4928F80D9300974E88 /* ReferendumTrackType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumTrackType.swift; sourceTree = ""; }; 84563D0824F46B7F0055591D /* ManagedAccountItemMapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManagedAccountItemMapperTests.swift; sourceTree = ""; }; 8456C08127CF9DC9001282DE /* RemoteNftModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteNftModel.swift; sourceTree = ""; }; 8456C08327CFA4A7001282DE /* ImagePlaceholderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePlaceholderView.swift; sourceTree = ""; }; @@ -3622,6 +3959,38 @@ 8459A9C727469E4B000D6278 /* AcalaContributionSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AcalaContributionSource.swift; sourceTree = ""; }; 8459A9C92746A1BC000D6278 /* CrowdloanOffchainSubscriber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanOffchainSubscriber.swift; sourceTree = ""; }; 8459A9CB2746A1E9000D6278 /* CrowdloanOffchainSubscriptionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanOffchainSubscriptionHandler.swift; sourceTree = ""; }; + 845AADA02902D02400B5AE96 /* TitleValueDiffView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleValueDiffView.swift; sourceTree = ""; }; + 845AADA22902D1EA00B5AE96 /* StackTitleValueDiffCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackTitleValueDiffCell.swift; sourceTree = ""; }; + 845AADA52903B32E00B5AE96 /* ReferendumVoteConfirmError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVoteConfirmError.swift; sourceTree = ""; }; + 845B07EA29159190005785D3 /* Democracy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Democracy.swift; sourceTree = ""; }; + 845B07EC291594E1005785D3 /* DemocracyReferendum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemocracyReferendum.swift; sourceTree = ""; }; + 845B07EE2915951A005785D3 /* DemocracyVoteThreshold.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemocracyVoteThreshold.swift; sourceTree = ""; }; + 845B07F029159AE7005785D3 /* DemocracyVoting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemocracyVoting.swift; sourceTree = ""; }; + 845B07F229159C15005785D3 /* Democracy+CodingPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Democracy+CodingPath.swift"; sourceTree = ""; }; + 845B07F4291627A3005785D3 /* Gov1OperationFactory+Protocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Gov1OperationFactory+Protocol.swift"; sourceTree = ""; }; + 845B07F629162AB3005785D3 /* Democracy+ConstantPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Democracy+ConstantPath.swift"; sourceTree = ""; }; + 845B07F829162D24005785D3 /* Gov1LocalMappingFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov1LocalMappingFactory.swift; sourceTree = ""; }; + 845B07FC291634D4005785D3 /* DemocracyDecidingFunctionProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemocracyDecidingFunctionProtocol.swift; sourceTree = ""; }; + 845B07FE2916F529005785D3 /* Gov1SubscriptionFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov1SubscriptionFactory.swift; sourceTree = ""; }; + 845B08002918406A005785D3 /* Gov2ActionOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2ActionOperationFactory.swift; sourceTree = ""; }; + 845B08032918C308005785D3 /* Gov1ActionOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov1ActionOperationFactory.swift; sourceTree = ""; }; + 845B08052918C3FB005785D3 /* DemocracyProposalCall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemocracyProposalCall.swift; sourceTree = ""; }; + 845B08072918C8DA005785D3 /* RemoteStorageSizeRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteStorageSizeRequest.swift; sourceTree = ""; }; + 845B08092918D381005785D3 /* Gov1ExtrinsicFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov1ExtrinsicFactory.swift; sourceTree = ""; }; + 845B080C2918D4F8005785D3 /* Democracy+Call.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Democracy+Call.swift"; sourceTree = ""; }; + 845B080F2918D65E005785D3 /* GovernanceExtrinsicFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceExtrinsicFactory.swift; sourceTree = ""; }; + 845B08112918E343005785D3 /* SubstrateDataModel4.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SubstrateDataModel4.xcdatamodel; sourceTree = ""; }; + 845B08122918FF98005785D3 /* Gov2UnlockReferendum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2UnlockReferendum.swift; sourceTree = ""; }; + 845B081429190056005785D3 /* Gov1UnlockReferendum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov1UnlockReferendum.swift; sourceTree = ""; }; + 845B0816291902CF005785D3 /* Gov2LockStateFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2LockStateFactory.swift; sourceTree = ""; }; + 845B0818291905CA005785D3 /* Gov1LockStateFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov1LockStateFactory.swift; sourceTree = ""; }; + 845B811128F429BB0040CE84 /* SupportPallet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportPallet.swift; sourceTree = ""; }; + 845B811428F43C350040CE84 /* Treasury.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Treasury.swift; sourceTree = ""; }; + 845B811628F43C730040CE84 /* TreasuryProposal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreasuryProposal.swift; sourceTree = ""; }; + 845B811828F43D4C0040CE84 /* Treasury+CodingPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Treasury+CodingPath.swift"; sourceTree = ""; }; + 845B811A28F445E90040CE84 /* Treasury+Calls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Treasury+Calls.swift"; sourceTree = ""; }; + 845B811C28F44A700040CE84 /* ReferendumActionLocal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumActionLocal.swift; sourceTree = ""; }; + 845B811E28F451A40040CE84 /* GovernanceActionOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceActionOperationFactory.swift; sourceTree = ""; }; 845B821426EF657700D25C72 /* PersistentValueSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersistentValueSettings.swift; sourceTree = ""; }; 845B821626EF7FED00D25C72 /* SelectedWalletSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedWalletSettings.swift; sourceTree = ""; }; 845B821826EF808D00D25C72 /* MetaAccountMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetaAccountMapper.swift; sourceTree = ""; }; @@ -3718,6 +4087,8 @@ 8467FD5724EFD5C2005D486C /* CDAccountItem+CoreDataDecodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CDAccountItem+CoreDataDecodable.swift"; sourceTree = ""; }; 8467FD5B24EFDCC9005D486C /* UserDataStorageTestFacade.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDataStorageTestFacade.swift; sourceTree = ""; }; 846802A2265DA5530034F9B5 /* CrowdloanContributionSetupViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionSetupViewModel.swift; sourceTree = ""; }; + 8468119328E6234B00BF54F1 /* RoundedSegmentedControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedSegmentedControl.swift; sourceTree = ""; }; + 8468119628E6C90F00BF54F1 /* VoteProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteProtocols.swift; sourceTree = ""; }; 8468B86424F59D1D00B76BC6 /* IconTitleHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconTitleHeaderView.swift; sourceTree = ""; }; 8468B86924F63CBA00B76BC6 /* AddAccount+AccountImportInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AddAccount+AccountImportInteractor.swift"; sourceTree = ""; }; 8468B86B24F63CEF00B76BC6 /* AddAccount+AccountConfirmInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AddAccount+AccountConfirmInteractor.swift"; sourceTree = ""; }; @@ -3735,6 +4106,7 @@ 846952A52852A1E60083E0B4 /* AuraStakingDurationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuraStakingDurationFactory.swift; sourceTree = ""; }; 8469936A26CD1BBE002CC786 /* RuntimePoolTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimePoolTests.swift; sourceTree = ""; }; 8469D5A528F5E8F20074FEE3 /* Staking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Staking.swift; sourceTree = ""; }; + 8469D5A728F683930074FEE3 /* ReferendumDetailsInteractorError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsInteractorError.swift; sourceTree = ""; }; 846A2600267C768500429A7F /* CrowdloanContributionMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionMapper.swift; sourceTree = ""; }; 846A2605267C792000429A7F /* CrowdloanContributionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionResponse.swift; sourceTree = ""; }; 846A2C4225271CDE00731018 /* TransactionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionType.swift; sourceTree = ""; }; @@ -3753,7 +4125,6 @@ 846A835E28B8D94300D92892 /* MessageSheetNoContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageSheetNoContentView.swift; sourceTree = ""; }; 846A836028B8DB7700D92892 /* MessageSheetTimerLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageSheetTimerLabel.swift; sourceTree = ""; }; 846AACEC28BF94B9009F3D42 /* AccountManagementFilter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountManagementFilter.swift; sourceTree = ""; }; - 846AACEE28BF9519009F3D42 /* NoAccountSupportPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoAccountSupportPresentable.swift; sourceTree = ""; }; 846AC7EE2638D9200075F7DA /* YourValidatorTableCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YourValidatorTableCell.swift; sourceTree = ""; }; 846AF83D2525B85100868F37 /* WalletNetworkFacade.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletNetworkFacade.swift; sourceTree = ""; }; 846AF83F2525B94D00868F37 /* WalletNetworkFacade+Protocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WalletNetworkFacade+Protocol.swift"; sourceTree = ""; }; @@ -3802,6 +4173,11 @@ 847119D4262EF95A00716580 /* PayoutInfoFactoryProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayoutInfoFactoryProtocol.swift; sourceTree = ""; }; 847119EA262EFF3800716580 /* ValidatorPayoutInfoFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidatorPayoutInfoFactory.swift; sourceTree = ""; }; 8471538C2653B29100CB91D8 /* ChangeRewardDestinationViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeRewardDestinationViewModelFactory.swift; sourceTree = ""; }; + 8471577A2910F0AF00D7D003 /* GovernanceUnlockInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockInteractor.swift; sourceTree = ""; }; + 8471577C2910F18300D7D003 /* GovernanceUnlockProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockProtocols.swift; sourceTree = ""; }; + 8471577F2910F30500D7D003 /* GovernanceUnlockInteractorError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockInteractorError.swift; sourceTree = ""; }; + 84715782291132B400D7D003 /* GovernanceUnlockTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockTableViewCell.swift; sourceTree = ""; }; + 84715785291136B100D7D003 /* GovernanceUnlocksViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlocksViewModel.swift; sourceTree = ""; }; 8471825E2846A8E2002C5720 /* ActionManageTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionManageTableViewCell.swift; sourceTree = ""; }; 8472072D277C203A00F593DD /* UICollectionView+Reuse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Reuse.swift"; sourceTree = ""; }; 8472072F277C335000F593DD /* DAppListFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppListFlowLayout.swift; sourceTree = ""; }; @@ -3838,6 +4214,7 @@ 8473F4B5282BE488007CC55A /* StakingRelaychainProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingRelaychainProtocols.swift; sourceTree = ""; }; 8473F4B7282BFFF8007CC55A /* StakingRelaychainInteractor+Subscription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StakingRelaychainInteractor+Subscription.swift"; sourceTree = ""; }; 8473F4B9282C012B007CC55A /* StakingRelaychainInteractor+InputProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StakingRelaychainInteractor+InputProtocol.swift"; sourceTree = ""; }; + 84741ADE290F116B00C98E17 /* Gov2UnlockScheduleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2UnlockScheduleTests.swift; sourceTree = ""; }; 847449502891F3B00042FD80 /* WalletSwitchControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletSwitchControl.swift; sourceTree = ""; }; 84744952289268770042FD80 /* WalletSwitchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletSwitchViewModel.swift; sourceTree = ""; }; 84744954289284F50042FD80 /* StakingMainViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingMainViewLayout.swift; sourceTree = ""; }; @@ -3857,6 +4234,10 @@ 8476D39C27F44E73004D9A7A /* PhishingSiteVerifier+Init.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PhishingSiteVerifier+Init.swift"; sourceTree = ""; }; 8476D39E27F4582A004D9A7A /* DAppMetamaskPhishingDetectedState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppMetamaskPhishingDetectedState.swift; sourceTree = ""; }; 8476D3A027F4598D004D9A7A /* DAppBrowserPhishingDetectedState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppBrowserPhishingDetectedState.swift; sourceTree = ""; }; + 84770F24291F72D700852A33 /* ReferendumVotingInitData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotingInitData.swift; sourceTree = ""; }; + 84770F26291F7CD400852A33 /* ReferendumDetailsInitData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsInitData.swift; sourceTree = ""; }; + 84770F29291F864500852A33 /* GovernanceUnlockInitData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockInitData.swift; sourceTree = ""; }; + 84770F2B291F893200852A33 /* GovernanceUnlockConfirmInitData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmInitData.swift; sourceTree = ""; }; 8477DAA22888329800129B45 /* watchOnlyPreset.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = watchOnlyPreset.json; sourceTree = ""; }; 8477DAA5288832CB00129B45 /* WatchOnlyPresetRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchOnlyPresetRepository.swift; sourceTree = ""; }; 84786DA725F9F58E0089DFF7 /* EraValidatorService+Fetch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "EraValidatorService+Fetch.swift"; sourceTree = ""; }; @@ -3879,6 +4260,10 @@ 847A25BA28D7BB92006AC9F5 /* ExtrinsicProcessor+Events.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ExtrinsicProcessor+Events.swift"; sourceTree = ""; }; 847A25BC28D7C0E7006AC9F5 /* TokenTransferedEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenTransferedEvent.swift; sourceTree = ""; }; 847A25BE28D7C2A2006AC9F5 /* AccountIdCodingWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountIdCodingWrapper.swift; sourceTree = ""; }; + 847A25C228D84A9C006AC9F5 /* ReferendumFetchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumFetchTests.swift; sourceTree = ""; }; + 847A25C528D84BE2006AC9F5 /* Referenda.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Referenda.swift; sourceTree = ""; }; + 847A25C728D84C0A006AC9F5 /* Referenda+CodingPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Referenda+CodingPath.swift"; sourceTree = ""; }; + 847A25C928D85204006AC9F5 /* ReferendumInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumInfo.swift; sourceTree = ""; }; 847A6C0828817DC700477F77 /* AssetListBaseInteractorProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetListBaseInteractorProtocol.swift; sourceTree = ""; }; 847A6C0A28817E4000477F77 /* AssetListBaseInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetListBaseInteractor.swift; sourceTree = ""; }; 847ABE3028532E1B00851218 /* ConsesusType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsesusType.swift; sourceTree = ""; }; @@ -3919,7 +4304,16 @@ 8482F62E280C618B0006C3A0 /* DAppAuthSettingsTableCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppAuthSettingsTableCell.swift; sourceTree = ""; }; 8482F63028101FB10006C3A0 /* DAppEthereumSignBytesInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppEthereumSignBytesInteractor.swift; sourceTree = ""; }; 8482F632281024B80006C3A0 /* Data+EthereumSign.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+EthereumSign.swift"; sourceTree = ""; }; + 8483B15028F93A080048B295 /* ReferendumVotersType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotersType.swift; sourceTree = ""; }; + 8483B15228F940080048B295 /* ReferendumVotersModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotersModel.swift; sourceTree = ""; }; + 8483B15428F9406C0048B295 /* ReferendumVotersInteractorError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotersInteractorError.swift; sourceTree = ""; }; + 8483B15728F98C9F0048B295 /* ReferendumVotersViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotersViewModel.swift; sourceTree = ""; }; + 8483B15A28F991550048B295 /* ReferendumVotersTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotersTableViewCell.swift; sourceTree = ""; }; + 8483B15C28FA79620048B295 /* ReferendumDisplayStringFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumDisplayStringFactory.swift; sourceTree = ""; }; 8485D923277E16C400767243 /* DAppBrowserScriptHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppBrowserScriptHandler.swift; sourceTree = ""; }; + 848701092907055900F2C0C3 /* ReferendumTimelineViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumTimelineViewModelFactory.swift; sourceTree = ""; }; + 8487010B2907AA9B00F2C0C3 /* ReferendumMetadataViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumMetadataViewModelFactory.swift; sourceTree = ""; }; + 8487010D2907DF2F00F2C0C3 /* MultiValueView+Styles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MultiValueView+Styles.swift"; sourceTree = ""; }; 84873AFE26028E2B000A83EE /* StakingStateMachine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingStateMachine.swift; sourceTree = ""; }; 84873B0326029B75000A83EE /* StakingEstimationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingEstimationViewModel.swift; sourceTree = ""; }; 84873B0826029CBD000A83EE /* StakingStateViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingStateViewModelFactory.swift; sourceTree = ""; }; @@ -3939,6 +4333,10 @@ 8487584627F1816200495306 /* QRExtractionService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QRExtractionService.swift; sourceTree = ""; }; 8487584827F1830D00495306 /* QRImageUploadDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRImageUploadDelegate.swift; sourceTree = ""; }; 8487584A27F1834E00495306 /* ImageGalleryPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageGalleryPresentable.swift; sourceTree = ""; }; + 84880C3F29016F1500CADB06 /* ReferendumLockChangeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumLockChangeViewModel.swift; sourceTree = ""; }; + 84880C41290172C300CADB06 /* ReferendumLockChangeViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumLockChangeViewModelFactory.swift; sourceTree = ""; }; + 84880C4329026C3E00CADB06 /* ReferendumDelegatingLocal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumDelegatingLocal.swift; sourceTree = ""; }; + 84880C452902781E00CADB06 /* ReferendumVotingLocal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotingLocal.swift; sourceTree = ""; }; 848841C028D1229000D750E9 /* ParaStkYieldBoostStopError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostStopError.swift; sourceTree = ""; }; 84884B5E27A1336500FAC549 /* OrmlAssetExtras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrmlAssetExtras.swift; sourceTree = ""; }; 8488ECD6258CDCBC004591CC /* PurchaseCompletionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchaseCompletionHandler.swift; sourceTree = ""; }; @@ -3971,13 +4369,17 @@ 848A837D274BB03E004493DD /* PublicSans-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PublicSans-Regular.otf"; sourceTree = ""; }; 848B2FFD286EDA4700465BA2 /* WalletServiceFacade.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletServiceFacade.swift; sourceTree = ""; }; 848B2FFF286EDE3800465BA2 /* ParaIdOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParaIdOperationFactory.swift; sourceTree = ""; }; - 848B59B328BC9FBF0009543C /* AccountManagementFilter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountManagementFilter.swift; sourceTree = ""; }; 848B59B928BCB3CA0009543C /* LedgerBaseAccountConfirmationWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LedgerBaseAccountConfirmationWireframe.swift; sourceTree = ""; }; 848B59BD28BCB4C80009543C /* LedgerAddAccountConfirmationWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LedgerAddAccountConfirmationWireframe.swift; sourceTree = ""; }; 848B59BF28BCB8530009543C /* LedgerBaseAccountConfirmationInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LedgerBaseAccountConfirmationInteractor.swift; sourceTree = ""; }; 848B59C128BCC1E60009543C /* LedgerAddAccountConfirmationInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LedgerAddAccountConfirmationInteractor.swift; sourceTree = ""; }; 848B59C328BCD1BD0009543C /* MessageSheetContentLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageSheetContentLabel.swift; sourceTree = ""; }; 848C3D0826248A3B005481C3 /* TransferCall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferCall.swift; sourceTree = ""; }; + 848CC93A28D9F6A5009EB4B0 /* OnChainScheduler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnChainScheduler.swift; sourceTree = ""; }; + 848CC93C28D9F6D8009EB4B0 /* OnChainDispatchTime.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnChainDispatchTime.swift; sourceTree = ""; }; + 848CC93E28D9F90D009EB4B0 /* ReferendaDeposit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendaDeposit.swift; sourceTree = ""; }; + 848CC94328D9FBDA009EB4B0 /* ConvictionVoting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvictionVoting.swift; sourceTree = ""; }; + 848CC94528D9FC46009EB4B0 /* ConvictionVotingTally.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvictionVotingTally.swift; sourceTree = ""; }; 848CCB432832EE9B00A1FD00 /* GeneralStorageSubscriptionFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralStorageSubscriptionFactory.swift; sourceTree = ""; }; 848CCB452832EF3400A1FD00 /* GeneralLocalStorageSubscriber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralLocalStorageSubscriber.swift; sourceTree = ""; }; 848CCB472832EF4400A1FD00 /* GeneralLocalStorageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralLocalStorageHandler.swift; sourceTree = ""; }; @@ -4116,6 +4518,8 @@ 8493D0E226FF571D00A28008 /* PriceProviderFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceProviderFactory.swift; sourceTree = ""; }; 8493D3E52705994200157009 /* StakingSharedState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingSharedState.swift; sourceTree = ""; }; 8493D3E827059B6700157009 /* StakingServiceFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingServiceFactory.swift; sourceTree = ""; }; + 8493FF36291A3D4C00F09F1B /* SubstrateDataModel5.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SubstrateDataModel5.xcdatamodel; sourceTree = ""; }; + 8493FF37291A59D800F09F1B /* ReferendumMetadataMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumMetadataMapper.swift; sourceTree = ""; }; 84944249265306BD0016E7BD /* ChangeRewardDestinationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeRewardDestinationViewModel.swift; sourceTree = ""; }; 84948C35287DD1C800E6DD3E /* NftListRMRKV2ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NftListRMRKV2ViewModel.swift; sourceTree = ""; }; 84948C37287E0B4F00E6DD3E /* FilterImageProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterImageProcessor.swift; sourceTree = ""; }; @@ -4139,11 +4543,12 @@ 8496ADD9276AFF4600306B24 /* DAppBrowserScript.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppBrowserScript.swift; sourceTree = ""; }; 8496ADDD276B123200306B24 /* PolkadotExtentionMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolkadotExtentionMessage.swift; sourceTree = ""; }; 8496ADDF276B152500306B24 /* NSDictionary+Map.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSDictionary+Map.swift"; sourceTree = ""; }; + 849707A028F3E0AC00DD0A02 /* ReferendumVoterLocal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVoterLocal.swift; sourceTree = ""; }; 8497FC5F26317783002FEAA7 /* AccountInfoViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountInfoViewModel.swift; sourceTree = ""; }; 84981CC22666D95F00C4C691 /* GradientButton+Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "GradientButton+Style.swift"; sourceTree = ""; }; 849842E526587573006BBB9F /* MultilineTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultilineTableViewCell.swift; sourceTree = ""; }; 849842FD26592C2B006BBB9F /* StatusSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusSectionView.swift; sourceTree = ""; }; - 8498430226592D29006BBB9F /* CrowdloanStatusSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanStatusSectionView.swift; sourceTree = ""; }; + 8498430226592D29006BBB9F /* VoteStatusSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteStatusSectionView.swift; sourceTree = ""; }; 8498430826592E5D006BBB9F /* CrowdloansViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloansViewModel.swift; sourceTree = ""; }; 849976B227B2430300B14A6C /* DAppMetamaskTransport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppMetamaskTransport.swift; sourceTree = ""; }; 849976B727B24BCB00B14A6C /* DAppPolkadotExtensionTransport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppPolkadotExtensionTransport.swift; sourceTree = ""; }; @@ -4211,6 +4616,10 @@ 849B563427A70DDE007D5528 /* ExtrinsicProcessor+Matching.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ExtrinsicProcessor+Matching.swift"; sourceTree = ""; }; 849C066E2765140B00394C82 /* AnyCancellableCleaning.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnyCancellableCleaning.swift; sourceTree = ""; }; 849C0670276516F900394C82 /* BaseOperation+Cancellable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BaseOperation+Cancellable.swift"; sourceTree = ""; }; + 849D321F291C26BA00D25839 /* GovernanceDAppList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceDAppList.swift; sourceTree = ""; }; + 849D3222291CC43D00D25839 /* MarkdownText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkdownText.swift; sourceTree = ""; }; + 849D3224291CC4A500D25839 /* MarkdownParsingOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkdownParsingOperationFactory.swift; sourceTree = ""; }; + 849D3226291CE25E00D25839 /* MarkdownViewContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkdownViewContainer.swift; sourceTree = ""; }; 849D755A2756910A007726C3 /* RoundedView+Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RoundedView+Style.swift"; sourceTree = ""; }; 849D755C27577602007726C3 /* AccountExportPasswordViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountExportPasswordViewLayout.swift; sourceTree = ""; }; 849DEBD325ED015C00C64C19 /* SelectValidatorsConfirmViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectValidatorsConfirmViewModel.swift; sourceTree = ""; }; @@ -4239,6 +4648,9 @@ 849FA21528A26CB500F83EAA /* CountdownTimerMediator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountdownTimerMediator.swift; sourceTree = ""; }; 84A04621277DE83E000B24DA /* DAppListErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DAppListErrorView.swift; sourceTree = ""; }; 84A15488262888CA0050D557 /* IdentityOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdentityOperationFactory.swift; sourceTree = ""; }; + 84A1742328ED3CF70096F943 /* ReferendumLocal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumLocal.swift; sourceTree = ""; }; + 84A1742628ED607B0096F943 /* GovernanceOperationProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceOperationProtocols.swift; sourceTree = ""; }; + 84A1742828ED625D0096F943 /* Gov2OperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2OperationFactory.swift; sourceTree = ""; }; 84A2A60926B82B35000C6C6C /* ValidatorOperationFactory+Protocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ValidatorOperationFactory+Protocol.swift"; sourceTree = ""; }; 84A2C90124E07E440020D3B7 /* CryptoType+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CryptoType+Utils.swift"; sourceTree = ""; }; 84A2C90324E07F400020D3B7 /* AccountOperationFactoryError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountOperationFactoryError.swift; sourceTree = ""; }; @@ -4257,8 +4669,12 @@ 84A58FD828A10ABD003F6ABF /* MultipartQrOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultipartQrOperationFactory.swift; sourceTree = ""; }; 84A6171A2625AC3E007B75E1 /* CallCodingPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallCodingPath.swift; sourceTree = ""; }; 84A617252625AF51007B75E1 /* RuntimeMetadata+Internal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RuntimeMetadata+Internal.swift"; sourceTree = ""; }; + 84A6AB5D290AA7DF001B57B2 /* ReferendumFullDetailsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumFullDetailsViewModel.swift; sourceTree = ""; }; + 84A6AB63290B021E001B57B2 /* CopyPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CopyPresentable.swift; sourceTree = ""; }; 84A8FD8D265FDA76002ADB58 /* CrowdloanContributionConfirmData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionConfirmData.swift; sourceTree = ""; }; 84A90488288EA0E500DFC8E2 /* NoKeysCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoKeysCommand.swift; sourceTree = ""; }; + 84A9ECC0291292900094C763 /* GovernanceUnlockConfirmInteractorError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmInteractorError.swift; sourceTree = ""; }; + 84A9ECC329129FF10094C763 /* GovernanceRemainedLockViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceRemainedLockViewModel.swift; sourceTree = ""; }; 84AA004226C5DFD800BCB4DC /* RuntimeSyncServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeSyncServiceTests.swift; sourceTree = ""; }; 84AA004426C6A04A00BCB4DC /* CommonTypesSyncService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonTypesSyncService.swift; sourceTree = ""; }; 84AC0B6928C0D8CE00FA5B5D /* NoLedgerSupportCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoLedgerSupportCommand.swift; sourceTree = ""; }; @@ -4287,9 +4703,12 @@ 84B018AD26E03FB500C75E28 /* NominatorStateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NominatorStateView.swift; sourceTree = ""; }; 84B018AF26E0450F00C75E28 /* ValidatorStateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidatorStateView.swift; sourceTree = ""; }; 84B28FC328C54441007A1006 /* OnChainTransferAmount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnChainTransferAmount.swift; sourceTree = ""; }; + 84B4E12B28EC038C00AC4FA8 /* ChainModelMapperV2V3.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChainModelMapperV2V3.swift; sourceTree = ""; }; 84B5DE52283F7BE500193ED3 /* CollatorsSortType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollatorsSortType.swift; sourceTree = ""; }; 84B5DE55283F7C8500193ED3 /* CollatorSelectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollatorSelectionCell.swift; sourceTree = ""; }; 84B5DE58283F8B5400193ED3 /* CollatorSelectionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollatorSelectionViewModel.swift; sourceTree = ""; }; + 84B6349C28F4A06D00503306 /* Preimage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preimage.swift; sourceTree = ""; }; + 84B6349E28F5575900503306 /* PreimageRequestStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreimageRequestStatus.swift; sourceTree = ""; }; 84B64E3E2704567700914E88 /* StakingLocalStorageSubscriber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingLocalStorageSubscriber.swift; sourceTree = ""; }; 84B64E402704569D00914E88 /* StakingLocalSubscriptionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingLocalSubscriptionHandler.swift; sourceTree = ""; }; 84B66A0A26FDB70F0038B963 /* CrowdloansListInteractor+Protocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CrowdloansListInteractor+Protocols.swift"; sourceTree = ""; }; @@ -4437,6 +4856,8 @@ 84C3F77A2601F08B00D47501 /* NominationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NominationViewModel.swift; sourceTree = ""; }; 84C3F7822602086100D47501 /* StakingViewState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingViewState.swift; sourceTree = ""; }; 84C3F78B26020DE800D47501 /* StakingStateMachineProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingStateMachineProtocols.swift; sourceTree = ""; }; + 84C41F3528EDADE000DB1CD3 /* ReferendaTrackInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendaTrackInfo.swift; sourceTree = ""; }; + 84C41F3728EDB80700DB1CD3 /* ReferendaCurve.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendaCurve.swift; sourceTree = ""; }; 84C4C2D6255D2B780045B582 /* PinChangeWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinChangeWireframe.swift; sourceTree = ""; }; 84C4C2F8255DB9510045B582 /* PinChangeInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinChangeInteractor.swift; sourceTree = ""; }; 84C515FA26D84F8C000DBA45 /* AccountImportWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountImportWrapper.swift; sourceTree = ""; }; @@ -4468,6 +4889,9 @@ 84C7DA5325EE2DF000F8C318 /* StakingErrorPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingErrorPresentable.swift; sourceTree = ""; }; 84C91FA9261E724F002796B9 /* SwitchTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchTableViewCell.swift; sourceTree = ""; }; 84C91FAE261E7CDD002796B9 /* WalletHistoryFilterEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletHistoryFilterEditor.swift; sourceTree = ""; }; + 84C9CF3A291AE328002BF328 /* PolkassemblyOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolkassemblyOperationFactory.swift; sourceTree = ""; }; + 84C9CF3C291AF1B1002BF328 /* GovernanceOffchainApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceOffchainApi.swift; sourceTree = ""; }; + 84C9CF3E291AF4B2002BF328 /* ReferendumMetadataDetailsProviderSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumMetadataDetailsProviderSource.swift; sourceTree = ""; }; 84CA68CE26BD6872003B9453 /* RuntimeSyncService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeSyncService.swift; sourceTree = ""; }; 84CA68D026BE99ED003B9453 /* RuntimeProviderFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeProviderFactory.swift; sourceTree = ""; }; 84CA68D226BE9A35003B9453 /* RuntimeProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeProvider.swift; sourceTree = ""; }; @@ -4497,6 +4921,10 @@ 84CEAAF426D7ADF20021B881 /* KeystoreMigrator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeystoreMigrator.swift; sourceTree = ""; }; 84CEAAF626D7B8010021B881 /* SettingsMigrator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsMigrator.swift; sourceTree = ""; }; 84CEEDE1284E3DCE0039364A /* AccountDetailsNavigationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountDetailsNavigationCell.swift; sourceTree = ""; }; + 84CEF287290462C300BA25BB /* GovernanceValidatorFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceValidatorFactory.swift; sourceTree = ""; }; + 84CEF289290466A800BA25BB /* GovernanceErrorPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceErrorPresentable.swift; sourceTree = ""; }; + 84CEF28B290509D600BA25BB /* GovernanceVoteValidatingParams.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceVoteValidatingParams.swift; sourceTree = ""; }; + 84CEF28D29050A3300BA25BB /* DataValidationRunner+GovVote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DataValidationRunner+GovVote.swift"; sourceTree = ""; }; 84CF00C227F6C1E4004DB322 /* CustomAssetMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAssetMapper.swift; sourceTree = ""; }; 84CFBC6428756CCB00E93EDA /* EthereumError+Presentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "EthereumError+Presentable.swift"; sourceTree = ""; }; 84CFF1CF26526FBC00DB7CF7 /* StakingBondMoreProtocols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StakingBondMoreProtocols.swift; sourceTree = ""; }; @@ -4557,6 +4985,12 @@ 84D6D7FB27A7F4B40094FC33 /* AssetListNetworkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetListNetworkView.swift; sourceTree = ""; }; 84D6D7FD27A7F4CD0094FC33 /* AssetListChainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetListChainView.swift; sourceTree = ""; }; 84D6E2F9283AE6590031D6FD /* ExtrinsicSubmissionPresenting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtrinsicSubmissionPresenting.swift; sourceTree = ""; }; + 84D8753928EB0A93004065BD /* GovernanceChainSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceChainSettings.swift; sourceTree = ""; }; + 84D8753C28EB17B2004065BD /* GovernanceSharedState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceSharedState.swift; sourceTree = ""; }; + 84D8753F28EB1A59004065BD /* ReferendumsInteractorError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsInteractorError.swift; sourceTree = ""; }; + 84D8754128EB5D66004065BD /* ChainBalanceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChainBalanceViewModel.swift; sourceTree = ""; }; + 84D8754328EB5E6D004065BD /* ChainBalanceViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChainBalanceViewModelFactory.swift; sourceTree = ""; }; + 84D8754628EB726E004065BD /* SubstrateDataModel3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SubstrateDataModel3.xcdatamodel; sourceTree = ""; }; 84D8F15424D80CA100AF43E9 /* ModalPickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalPickerViewController.swift; sourceTree = ""; }; 84D8F15624D80D5500AF43E9 /* ModalPickerViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ModalPickerViewController.xib; sourceTree = ""; }; 84D8F15A24D8136700AF43E9 /* ModalPickerCellProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalPickerCellProtocol.swift; sourceTree = ""; }; @@ -4570,6 +5004,7 @@ 84D8F16C24D82C7E00AF43E9 /* ModalPickerConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalPickerConfiguration.swift; sourceTree = ""; }; 84D8F16E24D8451F00AF43E9 /* CryptoType+ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CryptoType+ViewModel.swift"; sourceTree = ""; }; 84D8F17024D856D300AF43E9 /* SNAddressType+ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SNAddressType+ViewModel.swift"; sourceTree = ""; }; + 84D911A9292C923D0032EF33 /* Data+Fill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+Fill.swift"; sourceTree = ""; }; 84D97EC72520D32000F07405 /* PolkadotIcon+Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PolkadotIcon+Image.swift"; sourceTree = ""; }; 84D97ECE2521CA2F00F07405 /* WalletBaseTokenView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBaseTokenView.swift; sourceTree = ""; }; 84D97ED02521CA5200F07405 /* WalletTokenView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WalletTokenView.xib; sourceTree = ""; }; @@ -4602,6 +5037,9 @@ 84DC3CE42796768A0038E2ED /* SubqueryHistoryContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubqueryHistoryContext.swift; sourceTree = ""; }; 84DC3CE6279679230038E2ED /* SubqueryHistory+Wallet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SubqueryHistory+Wallet.swift"; sourceTree = ""; }; 84DC5A1228BAA8020014E081 /* LedgerInvaliDataPolkadotReason.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LedgerInvaliDataPolkadotReason.swift; sourceTree = ""; }; + 84DD49F328EE91ED00B804F3 /* Gov2LocalMappingFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gov2LocalMappingFactory.swift; sourceTree = ""; }; + 84DD49F528EE974B00B804F3 /* ReferendumDecidingFunctionProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumDecidingFunctionProtocol.swift; sourceTree = ""; }; + 84DD49F728EEAFFF00B804F3 /* DecimalTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecimalTests.swift; sourceTree = ""; }; 84DD5F20263CB6BE00425ACF /* UnbondCall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnbondCall.swift; sourceTree = ""; }; 84DD5F25263D72C400425ACF /* ExtrinsicFeeProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtrinsicFeeProxy.swift; sourceTree = ""; }; 84DD5F2F263D84F300425ACF /* RuntimeConstantFetching.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeConstantFetching.swift; sourceTree = ""; }; @@ -4628,6 +5066,12 @@ 84DF21AC25363D28005454AE /* WalletAssetId+Chain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WalletAssetId+Chain.swift"; sourceTree = ""; }; 84DF21B02536DDC1005454AE /* TransferConfirmCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferConfirmCommand.swift; sourceTree = ""; }; 84DF21B425388B35005454AE /* Scheduler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Scheduler.swift; sourceTree = ""; }; + 84E0EE03292D336C008B2953 /* GovernanceType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceType.swift; sourceTree = ""; }; + 84E0EE05292D3A58008B2953 /* AssetSelectionBaseProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetSelectionBaseProtocols.swift; sourceTree = ""; }; + 84E0EE07292D3C2D008B2953 /* GovernanceAssetSelectionProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceAssetSelectionProtocols.swift; sourceTree = ""; }; + 84E0EE09292D3CB4008B2953 /* GovernanceAssetSelectionWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceAssetSelectionWireframe.swift; sourceTree = ""; }; + 84E0EE0B292D402C008B2953 /* GovernanceAssetSelectionViewFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceAssetSelectionViewFactory.swift; sourceTree = ""; }; + 84E0EE0D292D69A9008B2953 /* CallMetadata+TypeCheck.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CallMetadata+TypeCheck.swift"; sourceTree = ""; }; 84E172CE28BE468D00DC85B6 /* MessageSheetPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageSheetPresentable.swift; sourceTree = ""; }; 84E172D028BF383B00DC85B6 /* Array+Dictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Dictionary.swift"; sourceTree = ""; }; 84E1CCF4260DCB91001E81B5 /* SwitchAccount+WalletManagementWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SwitchAccount+WalletManagementWireframe.swift"; sourceTree = ""; }; @@ -4657,6 +5101,7 @@ 84E58C7C275E124A00BD441A /* PublicSans-ExtraLight.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PublicSans-ExtraLight.otf"; sourceTree = ""; }; 84E5CD532809315300A98DC4 /* MultiassetUserDataModel4.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MultiassetUserDataModel4.xcdatamodel; sourceTree = ""; }; 84E5D14127E32E8B00D27B1E /* AccountInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountInputView.swift; sourceTree = ""; }; + 84E63C1628FFC69A0093534A /* DiscreteGradientSlider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscreteGradientSlider.swift; sourceTree = ""; }; 84E6D57B262E2CE8000EA3F5 /* OperationCombiningService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OperationCombiningService.swift; sourceTree = ""; }; 84E731C226652B5C00D5B15A /* AttributedString+Crowdloan.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AttributedString+Crowdloan.swift"; sourceTree = ""; }; 84E83AA1286328660000B418 /* XcmOrmlTransfer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcmOrmlTransfer.swift; sourceTree = ""; }; @@ -4665,6 +5110,7 @@ 84E8AC7427BB975700402635 /* RMRKV1OperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RMRKV1OperationFactory.swift; sourceTree = ""; }; 84E8AC7627BBC8E400402635 /* NFTIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFTIntegrationTests.swift; sourceTree = ""; }; 84E90BA028D0B51000529633 /* CheckboxControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckboxControlView.swift; sourceTree = ""; }; + 84E9A04F28F000AB00551DC4 /* ReferendumMetadataLocal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumMetadataLocal.swift; sourceTree = ""; }; 84EA0B2925E579DF00AFB0DC /* AssetBalanceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetBalanceViewModel.swift; sourceTree = ""; }; 84EB6C4D281999E100CFD8B2 /* PayoutTimeViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayoutTimeViewModelFactory.swift; sourceTree = ""; }; 84EBA4EF27AD26A5000AEEAD /* AssetBalanceId.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetBalanceId.swift; sourceTree = ""; }; @@ -4735,6 +5181,10 @@ 84F1CB3B27CF42B80095D523 /* NftListItemWithPriceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NftListItemWithPriceCell.swift; sourceTree = ""; }; 84F1CB3D27CF4F5A0095D523 /* BorderedLabelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BorderedLabelView.swift; sourceTree = ""; }; 84F1CB3F27CF6BEF0095D523 /* UniquesClassDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UniquesClassDetails.swift; sourceTree = ""; }; + 84F1D66A29051A730050F4E3 /* ReferendumLockReuseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumLockReuseViewModel.swift; sourceTree = ""; }; + 84F1D66C29051F240050F4E3 /* ReferendumReuseLockModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumReuseLockModel.swift; sourceTree = ""; }; + 84F1D66E29066F740050F4E3 /* ReferendumVotesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotesViewModel.swift; sourceTree = ""; }; + 84F1D67229069FFB0050F4E3 /* governanceDApps.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = governanceDApps.json; sourceTree = ""; }; 84F2FEF925E797E8008338D5 /* StorageRequestFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorageRequestFactory.swift; sourceTree = ""; }; 84F2FEFE25E7ADE7008338D5 /* ValidatorPrefs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidatorPrefs.swift; sourceTree = ""; }; 84F2FF0625E7AF8F008338D5 /* EraValidatorInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EraValidatorInfo.swift; sourceTree = ""; }; @@ -4778,6 +5228,8 @@ 84F6B6422619A8480038F10D /* SubscanConcreteExtrinsicsData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscanConcreteExtrinsicsData.swift; sourceTree = ""; }; 84F6B6472619A87C0038F10D /* ExtrinsicIndexWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtrinsicIndexWrapper.swift; sourceTree = ""; }; 84F6B64F2619E1ED0038F10D /* Int+Operations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Int+Operations.swift"; sourceTree = ""; }; + 84F76ED529006A0900D7206C /* ReferendumConvictionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumConvictionView.swift; sourceTree = ""; }; + 84F76ED729006BC400D7206C /* DiscreteGradientSlider+Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DiscreteGradientSlider+Style.swift"; sourceTree = ""; }; 84F77AA9265EE86B00F54885 /* CrowdloanErrorPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanErrorPresentable.swift; sourceTree = ""; }; 84F81317265B9E990043FA1D /* CrowdloansOperationFactoryStub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloansOperationFactoryStub.swift; sourceTree = ""; }; 84F98D8925E3DD3F0040418E /* StorageCodingPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorageCodingPath.swift; sourceTree = ""; }; @@ -4849,13 +5301,21 @@ 84FFE504261290830054EA63 /* NetworkInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkInfoView.swift; sourceTree = ""; }; 85211D55E2AF0A697FB3EB84 /* AnalyticsRewardDetailsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnalyticsRewardDetailsPresenter.swift; sourceTree = ""; }; 855FB8DD761E110A42435A02 /* AccountManagementWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountManagementWireframe.swift; sourceTree = ""; }; + 856BF961EACEB9703B2B37C7 /* GovernanceUnlockSetupWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockSetupWireframe.swift; sourceTree = ""; }; 859E0EF774DF0D498FEF8FCB /* DAppOperationConfirmViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppOperationConfirmViewLayout.swift; sourceTree = ""; }; 85D8B7BE70A9F907F8B43BFC /* TransferSetupViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TransferSetupViewController.swift; sourceTree = ""; }; 85F45A5C6145F863760F4409 /* AccountImportWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountImportWireframe.swift; sourceTree = ""; }; + 8602E65CC4E81A7BE1727CE3 /* ReferendumVotersViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVotersViewLayout.swift; sourceTree = ""; }; 86DCB6F3977BDE1BDC7BC3F9 /* ParaStkUnstakeConfirmPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakeConfirmPresenter.swift; sourceTree = ""; }; 86F7A369E31DCB9ABD556EE9 /* CrowdloanListPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanListPresenter.swift; sourceTree = ""; }; 86F9063B2DF46E7B65B5248E /* Pods_novawalletAll_novawalletIntegrationTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_novawalletAll_novawalletIntegrationTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 87CD8C618D61C78EA8C58532 /* ParitySignerTxScanViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerTxScanViewLayout.swift; sourceTree = ""; }; + 880059D728EEBC0200E87B9B /* SliderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderView.swift; sourceTree = ""; }; + 880059D928EF092800E87B9B /* ThumbView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThumbView.swift; sourceTree = ""; }; + 880059DB28EF092F00E87B9B /* SegmentedSliderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SegmentedSliderView.swift; sourceTree = ""; }; + 880059DE28EF09E100E87B9B /* GovernanceStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GovernanceStyle.swift; sourceTree = ""; }; + 880059E028EF0A5C00E87B9B /* VotingProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VotingProgressView.swift; sourceTree = ""; }; + 880059E228EF128000E87B9B /* ReferendumInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumInfoView.swift; sourceTree = ""; }; 880855EC28D062A9004255E7 /* Array+AddOrReplace.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+AddOrReplace.swift"; sourceTree = ""; }; 880855EF28D099F2004255E7 /* CrowdloanOnChainSyncService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanOnChainSyncService.swift; sourceTree = ""; }; 880855F128D09A0B004255E7 /* CrowdloanContributionData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionData.swift; sourceTree = ""; }; @@ -4864,8 +5324,15 @@ 880855F728D09DA8004255E7 /* CrowdloanContributionDataMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionDataMapper.swift; sourceTree = ""; }; 880855F928D0BAA2004255E7 /* CrowdloanContributionLocalSubscriptionFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionLocalSubscriptionFactory.swift; sourceTree = ""; }; 880855FB28D0C3DF004255E7 /* CrowdloansLocalStorageSubscriber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloansLocalStorageSubscriber.swift; sourceTree = ""; }; - 8820134728EB04300027CD80 /* SkeletonableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkeletonableView.swift; sourceTree = ""; }; + 88107D5E290133F8001AB0B0 /* RoundedView+Styles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RoundedView+Styles.swift"; sourceTree = ""; }; + 88107D6029015FAB001AB0B0 /* TrackTagsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackTagsView.swift; sourceTree = ""; }; 8821119C96944A0E3526E93A /* StakingRedeemViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRedeemViewFactory.swift; sourceTree = ""; }; + 8824D4212902D92F0022D778 /* ReferendumFullDetailsInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumFullDetailsInteractor.swift; sourceTree = ""; }; + 8824D423290324260022D778 /* PrettyPrintedJSONOperationFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrettyPrintedJSONOperationFactory.swift; sourceTree = ""; }; + 8824D42529032B410022D778 /* BlurredView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurredView.swift; sourceTree = ""; }; + 8824D42729032BF60022D778 /* ReferendumStateLocal+Presenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ReferendumStateLocal+Presenter.swift"; sourceTree = ""; }; + 882808C729009CA500AE8089 /* DotsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DotsView.swift; sourceTree = ""; }; + 882808C929009CDC00AE8089 /* UIView+frame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+frame.swift"; sourceTree = ""; }; 8828C05728B4A67000555CB6 /* Prism.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Prism.swift; sourceTree = ""; }; 8828C05928B4A6A800555CB6 /* Samples.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Samples.swift; sourceTree = ""; }; 8828F4F228AD2734009E0B7C /* CrowdloansCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloansCalculator.swift; sourceTree = ""; }; @@ -4902,6 +5369,7 @@ 8860F3E3289D50BA00C0BF86 /* Array+SectionProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+SectionProtocol.swift"; sourceTree = ""; }; 8860F3E7289D7CF400C0BF86 /* Atomic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Atomic.swift; sourceTree = ""; }; 88787F0328DB3A7B00B115AB /* SubstrateDataModel2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SubstrateDataModel2.xcdatamodel; sourceTree = ""; }; + 887A717B28FEF03E00B13C7E /* BaselinedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaselinedView.swift; sourceTree = ""; }; 887AFC8628BC95F0002A0422 /* MetaAccountChainResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetaAccountChainResponse.swift; sourceTree = ""; }; 887AFC8928BCB313002A0422 /* PolkadotIconDetailsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PolkadotIconDetailsView.swift; sourceTree = ""; }; 887AFC8A28BCB313002A0422 /* SelectableIconSubtitleCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectableIconSubtitleCollectionViewCell.swift; sourceTree = ""; }; @@ -4909,8 +5377,15 @@ 8887813B28B62B0A00E7290F /* FlexibleSpaceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexibleSpaceView.swift; sourceTree = ""; }; 8887813D28B7AA3100E7290F /* RoundedIconTitleCollectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedIconTitleCollectionHeaderView.swift; sourceTree = ""; }; 8887813F28B7AAB700E7290F /* RoundedIconTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedIconTitleView.swift; sourceTree = ""; }; + 888A3B6428F73DC300E15BD2 /* ReferendumVotingStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotingStatusView.swift; sourceTree = ""; }; + 888A3B6628F746D200E15BD2 /* ReferendumVotingStatusDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumVotingStatusDetailsView.swift; sourceTree = ""; }; + 888B853728ED966600AC9614 /* SkeletonableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SkeletonableView.swift; sourceTree = ""; }; 8890E51528DDC98C001D3994 /* SubstrateStorageMigrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubstrateStorageMigrationTests.swift; sourceTree = ""; }; + 8892284728F353A5003F8B9E /* ReferendumsModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsModelFactory.swift; sourceTree = ""; }; + 8892284928F35410003F8B9E /* ReferendumsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumsViewModel.swift; sourceTree = ""; }; 889A825F58F5CB54118A9D35 /* SelectValidatorsStartWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SelectValidatorsStartWireframe.swift; sourceTree = ""; }; + 889D889428F01E5B00C4320F /* ReferendumTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumTableViewCell.swift; sourceTree = ""; }; + 889D889628F022AA00C4320F /* UILabel+Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+Style.swift"; sourceTree = ""; }; 88A0C52028D49A090083A524 /* CrowdloanOffChainSyncService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrowdloanOffChainSyncService.swift; sourceTree = ""; }; 88A0E0FC28A284C700A9C940 /* SelectedCurrencyDepending.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectedCurrencyDepending.swift; sourceTree = ""; }; 88A0E0FD28A284C700A9C940 /* CurrencyManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CurrencyManager.swift; sourceTree = ""; }; @@ -4920,11 +5395,16 @@ 88A5317F28B9328E00AF18F5 /* YourWalletsViewSectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YourWalletsViewSectionModel.swift; sourceTree = ""; }; 88A6BCFE28CA15400047E4C2 /* LocksBalanceViewModelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocksBalanceViewModelFactory.swift; sourceTree = ""; }; 88A6BD0028CA15710047E4C2 /* LocksViewInput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocksViewInput.swift; sourceTree = ""; }; + 88A95FA528F8664100BE26F3 /* ReferendumTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumTimelineView.swift; sourceTree = ""; }; + 88A95FA728FAA99D00BE26F3 /* ReferendumDAppView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumDAppView.swift; sourceTree = ""; }; 88AA0FB728B60E6A00931800 /* YourWalletsControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YourWalletsControlView.swift; sourceTree = ""; }; 88AC186028CA3EE100892A9B /* LocksViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocksViewLayout.swift; sourceTree = ""; }; 88AC186228CA3F0000892A9B /* GenericCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenericCollectionViewLayout.swift; sourceTree = ""; }; 88AC186428CA461F00892A9B /* ModalSheetCollectionViewProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalSheetCollectionViewProtocol.swift; sourceTree = ""; }; 88AF35DD28C21D28003730DA /* LocksSubscription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocksSubscription.swift; sourceTree = ""; }; + 88B1862928EF30A600D49854 /* YourVoteView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YourVoteView.swift; sourceTree = ""; }; + 88B438E628F6C629001FC08A /* StatusTimeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusTimeViewModel.swift; sourceTree = ""; }; + 88B560BB28F80DCB00A5EB59 /* VoteRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteRowView.swift; sourceTree = ""; }; 88BB219F28D34C660019C6B4 /* DataProviderChange+Identifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DataProviderChange+Identifier.swift"; sourceTree = ""; }; 88C017E528C60A65003B2D28 /* AssetLockMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssetLockMapper.swift; sourceTree = ""; }; 88C7165328C894510015D1E9 /* CollectionViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionViewDelegate.swift; sourceTree = ""; }; @@ -4940,8 +5420,17 @@ 88E8CF5D28E3789600C90112 /* CrowdloanEmptyView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CrowdloanEmptyView.swift; sourceTree = ""; }; 88F19DDD28D8D0A100F6E459 /* Either.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Either.swift; sourceTree = ""; }; 88F19DDF28D8D0F600F6E459 /* LoadableViewModelState+Addition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LoadableViewModelState+Addition.swift"; sourceTree = ""; }; + 88F34FD128FF045400712BDE /* BindableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BindableView.swift; sourceTree = ""; }; + 88F34FD328FFE64400712BDE /* ReferendumDAppCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumDAppCellView.swift; sourceTree = ""; }; + 88F34FD628FFE66E00712BDE /* FullDetailsRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullDetailsRow.swift; sourceTree = ""; }; + 88F34FD828FFE68B00712BDE /* YourVoteRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YourVoteRow.swift; sourceTree = ""; }; + 88F34FDA28FFE6AA00712BDE /* RequestedAmountRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestedAmountRow.swift; sourceTree = ""; }; + 88F34FDC28FFE6E400712BDE /* MultiValueView+Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MultiValueView+Model.swift"; sourceTree = ""; }; + 88F34FDE28FFEAE500712BDE /* TimelineRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineRow.swift; sourceTree = ""; }; + 88F34FE028FFEAFD00712BDE /* VotingDetailsRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VotingDetailsRow.swift; sourceTree = ""; }; 88F7715F28BEA589008C028A /* YourWalletsIconDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YourWalletsIconDetailsView.swift; sourceTree = ""; }; 88F7716328BF6B59008C028A /* GenericMultiValueView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenericMultiValueView.swift; sourceTree = ""; }; + 88FAE78728FCF8E200130B47 /* ReferendumDetailsTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsTitleView.swift; sourceTree = ""; }; 899686C7351A2600FFA08371 /* TransferConfirmOnChainViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TransferConfirmOnChainViewFactory.swift; sourceTree = ""; }; 89CFED2E01AB638656E251AF /* NftListProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NftListProtocols.swift; sourceTree = ""; }; 8ADA5C374888879D27DBAA29 /* Pods-novawalletTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-novawalletTests.release.xcconfig"; path = "Target Support Files/Pods-novawalletTests/Pods-novawalletTests.release.xcconfig"; sourceTree = ""; }; @@ -4956,6 +5445,7 @@ 8EB322463CF5036819A181E0 /* ParaStkCollatorsSearchViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkCollatorsSearchViewController.swift; sourceTree = ""; }; 8EE41915478E28D94B8471A0 /* LedgerNetworkSelectionViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerNetworkSelectionViewController.swift; sourceTree = ""; }; 8EE72F2B6612508D4783A507 /* DAppAuthSettingsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAuthSettingsProtocols.swift; sourceTree = ""; }; + 8EE81AE154A736A93FF3812B /* GovernanceUnlockConfirmViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmViewLayout.swift; sourceTree = ""; }; 8F96182151D003DF6789CB4B /* DAppSearchProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppSearchProtocols.swift; sourceTree = ""; }; 8F9C67FCF466D9EF48ED35D2 /* Pods-novawalletTests.dev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-novawalletTests.dev.xcconfig"; path = "Target Support Files/Pods-novawalletTests/Pods-novawalletTests.dev.xcconfig"; sourceTree = ""; }; 8FDF5963FA924F8C815F3BCF /* ParaStkRebondViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkRebondViewController.swift; sourceTree = ""; }; @@ -4970,8 +5460,10 @@ 955A6977CCE5861E4F5DCFBB /* AnalyticsValidatorsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnalyticsValidatorsViewController.swift; sourceTree = ""; }; 95A04CDB05A013ED57D3DEA3 /* LedgerAccountConfirmationViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerAccountConfirmationViewController.swift; sourceTree = ""; }; 95A60B27D3A045E0DEF23775 /* NftListViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NftListViewController.swift; sourceTree = ""; }; + 95E4AF529B896F7E58671A74 /* GovernanceUnlockSetupViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockSetupViewFactory.swift; sourceTree = ""; }; 9622C6C3102EF12BEE78D63D /* AssetSelectionViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetSelectionViewFactory.swift; sourceTree = ""; }; 96340EDDE0EAA7F9B6D33E96 /* LedgerWalletConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerWalletConfirmInteractor.swift; sourceTree = ""; }; + 9638E6EDBA41A5772E0033AE /* GovernanceUnlockConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockConfirmInteractor.swift; sourceTree = ""; }; 96BE36DA0A2310660A43FF5B /* DAppAddFavoriteInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAddFavoriteInteractor.swift; sourceTree = ""; }; 96D540DFC00C25D8F73CFDC3 /* CustomValidatorListWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CustomValidatorListWireframe.swift; sourceTree = ""; }; 96F09665083031502F9693F8 /* StakingMainWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingMainWireframe.swift; sourceTree = ""; }; @@ -4993,12 +5485,15 @@ 9D93D6B6DB7BACFEA6F2738C /* ParaStkCollatorInfoInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkCollatorInfoInteractor.swift; sourceTree = ""; }; 9DBACA1AB17E90565F133C19 /* WalletsListInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WalletsListInteractor.swift; sourceTree = ""; }; 9F1BCCE09BB15106FDC02495 /* ParaStkRebondInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkRebondInteractor.swift; sourceTree = ""; }; + 9F2F90150AD2DD3CDF7F4EDA /* ReferendumDetailsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsViewFactory.swift; sourceTree = ""; }; 9FDF20DCECDEA61E1BDE780B /* CrowdloanYourContributionsViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanYourContributionsViewLayout.swift; sourceTree = ""; }; A028BD1A81CA95BE0DB66031 /* DAppTxDetailsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppTxDetailsViewFactory.swift; sourceTree = ""; }; A0F285548A6F98B3EB3F170C /* NftDetailsViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NftDetailsViewLayout.swift; sourceTree = ""; }; A12FACE9CF804AF777024A31 /* ParitySignerAddressesViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddressesViewFactory.swift; sourceTree = ""; }; A14CA4551FCC2EBD078E2242 /* AccountConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountConfirmViewFactory.swift; sourceTree = ""; }; + A1565588CB7E044C02B091FB /* ReferendumDetailsViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsViewLayout.swift; sourceTree = ""; }; A2AEC47F0599E0AC45237639 /* Pods-novawalletAll-novawallet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-novawalletAll-novawallet.release.xcconfig"; path = "Target Support Files/Pods-novawalletAll-novawallet/Pods-novawalletAll-novawallet.release.xcconfig"; sourceTree = ""; }; + A2E14458DEC3317602A17527 /* GovernanceUnlockSetupViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockSetupViewLayout.swift; sourceTree = ""; }; A3104ABC4BECF08B0BA836AA /* AccountConfirmViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountConfirmViewController.swift; sourceTree = ""; }; A31780E84948D7FE632ECB02 /* YourValidatorListProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = YourValidatorListProtocols.swift; sourceTree = ""; }; A3BACB7E24BC87F9218DBBC4 /* StakingPayoutConfirmationViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingPayoutConfirmationViewController.swift; sourceTree = ""; }; @@ -5023,6 +5518,7 @@ AC404A4071AF571FAC4C1994 /* AccountExportPasswordProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountExportPasswordProtocols.swift; sourceTree = ""; }; ACAEDA02F409FE23749A1551 /* AccountCreateWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountCreateWireframe.swift; sourceTree = ""; }; AD0186D779597EAA44B8B188 /* LedgerWalletAccountConfirmationInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerWalletAccountConfirmationInteractor.swift; sourceTree = ""; }; + AD1CAB4467C76E4139ECB1B7 /* ReferendumVoteConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteConfirmViewFactory.swift; sourceTree = ""; }; ADD348E749EC6A7E3BB069DE /* StakingUnbondConfirmProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingUnbondConfirmProtocols.swift; sourceTree = ""; }; AE1000F126679886004753B7 /* ChangeTargetsRecommendationWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeTargetsRecommendationWireframe.swift; sourceTree = ""; }; AE1000F326679946004753B7 /* InitiatedBondingRecommendationWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InitiatedBondingRecommendationWireframe.swift; sourceTree = ""; }; @@ -5161,12 +5657,14 @@ B56202207DF8BB6684C6EF6C /* AdvancedWalletPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdvancedWalletPresenter.swift; sourceTree = ""; }; B5BC1402B34E341312ABB378 /* LedgerWalletConfirmPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerWalletConfirmPresenter.swift; sourceTree = ""; }; B6884DFC1AA1B995C21C274C /* WalletHistoryFilterViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WalletHistoryFilterViewController.swift; sourceTree = ""; }; + B727587201B9D6F91A28428A /* ReferendumDetailsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsViewController.swift; sourceTree = ""; }; B765BDAA27726E2586953368 /* OnChainTransferSetupInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OnChainTransferSetupInteractor.swift; sourceTree = ""; }; B7CB6BF970620958C9DDD037 /* ParaStkStakeConfirmWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkStakeConfirmWireframe.swift; sourceTree = ""; }; B8A6C6207095F63972E14618 /* DAppPhishingProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppPhishingProtocols.swift; sourceTree = ""; }; B8B0A8174A9FFB8422A70D83 /* ParitySignerWelcomeWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerWelcomeWireframe.swift; sourceTree = ""; }; B90CEC70F101AA25A4C00021 /* YourValidatorListViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = YourValidatorListViewController.swift; sourceTree = ""; }; BAB2478DE3AF0885A3ED7ED8 /* StakingRedeemPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRedeemPresenter.swift; sourceTree = ""; }; + BAF9ED27CF12B7DA8B1378CF /* ReferendumFullDescriptionViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDescriptionViewFactory.swift; sourceTree = ""; }; BB5E8FAB4C12D7BFEEF576AD /* AnalyticsRewardDetailsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnalyticsRewardDetailsWireframe.swift; sourceTree = ""; }; BC15D0B7B9F29E97FCECC1D2 /* AssetsManageViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetsManageViewLayout.swift; sourceTree = ""; }; BC216C4DBF86A9F3ADB3AECF /* ParitySignerAddConfirmWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddConfirmWireframe.swift; sourceTree = ""; }; @@ -5182,12 +5680,16 @@ C1B08ACC71BE679A48A7B66E /* LedgerInstructionsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerInstructionsPresenter.swift; sourceTree = ""; }; C22DAB1222A253F4ADAD9169 /* ParaStkYieldBoostSetupViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostSetupViewController.swift; sourceTree = ""; }; C2956D0C69019DDCDAB2EB34 /* CustomValidatorListViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CustomValidatorListViewLayout.swift; sourceTree = ""; }; + C3ABAD23C0039AFA8351C650 /* ReferendumDetailsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsProtocols.swift; sourceTree = ""; }; C503100478AB56E903598A78 /* ReferralCrowdloanPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferralCrowdloanPresenter.swift; sourceTree = ""; }; C6F8BBBA9EABA266B288333F /* AnalyticsValidatorsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnalyticsValidatorsViewFactory.swift; sourceTree = ""; }; C74A2166B054240BD5D925B6 /* UsernameSetupViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UsernameSetupViewFactory.swift; sourceTree = ""; }; + C80D934D47929D2331111AD7 /* ReferendumFullDetailsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDetailsWireframe.swift; sourceTree = ""; }; C96C3B5ABF4A8124848EFD17 /* ControllerAccountConfirmationWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ControllerAccountConfirmationWireframe.swift; sourceTree = ""; }; C9978451AB2F4958E6FF117D /* YourWalletsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = YourWalletsViewFactory.swift; sourceTree = ""; }; + C9990DF2F0214CD51E5388CE /* ReferendumVotersPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVotersPresenter.swift; sourceTree = ""; }; CAB80E4CA0D5FA56612318A2 /* ChangeWatchOnlyProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ChangeWatchOnlyProtocols.swift; sourceTree = ""; }; + CAEF44ADECD66B49E3430365 /* ReferendumFullDescriptionPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDescriptionPresenter.swift; sourceTree = ""; }; CB441F15E16B07196DD9CE9D /* ParaStkUnstakeProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakeProtocols.swift; sourceTree = ""; }; CB9150FEC66FC503CF1BD1D0 /* WalletHistoryFilterPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WalletHistoryFilterPresenter.swift; sourceTree = ""; }; CC17D12DCD0CDAF0BC13D80D /* StakingUnbondSetupViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingUnbondSetupViewController.swift; sourceTree = ""; }; @@ -5195,11 +5697,14 @@ CCBCB7C3ABB6C06CD4681D44 /* LedgerTxConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerTxConfirmViewFactory.swift; sourceTree = ""; }; CD098B40697FD6CC08F9A6AC /* UsernameSetupProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UsernameSetupProtocols.swift; sourceTree = ""; }; CD6B5B187E83839481846C7E /* NftDetailsInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NftDetailsInteractor.swift; sourceTree = ""; }; + CDB47990BC7A594E663DAC00 /* ReferendumVoteConfirmPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteConfirmPresenter.swift; sourceTree = ""; }; CE294DDEAB7902D7CE1F1BA1 /* AnalyticsRewardDetailsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnalyticsRewardDetailsProtocols.swift; sourceTree = ""; }; CE98454DC77EAA01301B9BBF /* ParaStkCollatorFiltersProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkCollatorFiltersProtocols.swift; sourceTree = ""; }; CF7A019F89C6CD418AEEE79C /* YourWalletsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = YourWalletsPresenter.swift; sourceTree = ""; }; CF891BE39D442C2D06DDF3BB /* StakingRewardDetailsProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardDetailsProtocols.swift; sourceTree = ""; }; + CFA54AB88E24A2053F289D74 /* GovernanceUnlockSetupInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockSetupInteractor.swift; sourceTree = ""; }; D02E38ABE379CA48E63328C4 /* DAppBrowserProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppBrowserProtocols.swift; sourceTree = ""; }; + D087F5710630FCC968B65FB5 /* ReferendumFullDescriptionViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDescriptionViewLayout.swift; sourceTree = ""; }; D0D4E719EB5AC6CDB97BAB5C /* ParaStkUnstakeWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakeWireframe.swift; sourceTree = ""; }; D101339CC1292531CC4DB0AC /* StakingUnbondSetupInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingUnbondSetupInteractor.swift; sourceTree = ""; }; D1852EB0DD9E0C39E0AAEE68 /* AssetListPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetListPresenter.swift; sourceTree = ""; }; @@ -5211,6 +5716,7 @@ D529B9CA8D6E2E6F375FC260 /* AssetListProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetListProtocols.swift; sourceTree = ""; }; D5840ED54B83E2C652442DBC /* ParitySignerAddConfirmProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddConfirmProtocols.swift; sourceTree = ""; }; D5A5DCA28ABF42D342BBDF9A /* ParitySignerTxQrViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerTxQrViewLayout.swift; sourceTree = ""; }; + D5AC65A04352405327BFE946 /* ReferendumDetailsInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumDetailsInteractor.swift; sourceTree = ""; }; D613E20E96E7BA5B8F4B9799 /* StakingRewardDetailsInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardDetailsInteractor.swift; sourceTree = ""; }; D6470B066E67834BF97E0A68 /* StakingRewardDetailsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardDetailsPresenter.swift; sourceTree = ""; }; D6C6573C52692E4A56E35FF9 /* RecommendedValidatorListProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = RecommendedValidatorListProtocols.swift; sourceTree = ""; }; @@ -5220,7 +5726,6 @@ D7A0A5EE9BE2862B085712A0 /* AssetSelectionPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetSelectionPresenter.swift; sourceTree = ""; }; D7E4D8E59F0976D412FF0B10 /* LedgerAccountConfirmationProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerAccountConfirmationProtocols.swift; sourceTree = ""; }; D7FE5F01FC9364788A91EFA5 /* SelectValidatorsConfirmProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SelectValidatorsConfirmProtocols.swift; sourceTree = ""; }; - D852BF894D6E06EB9A92BC71 /* CrowdloanListViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanListViewController.swift; sourceTree = ""; }; D8A759A20A4A39B3B0E2A735 /* DAppAddFavoriteViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAddFavoriteViewLayout.swift; sourceTree = ""; }; D8C4C48E50DC14085258AB6D /* NftDetailsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NftDetailsViewController.swift; sourceTree = ""; }; D9046DB927451ED700C29F2E /* ParallelContributionSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParallelContributionSource.swift; sourceTree = ""; }; @@ -5238,7 +5743,10 @@ DBF9C192200F9B998724FC6C /* DAppSearchViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppSearchViewFactory.swift; sourceTree = ""; }; DBFC5052A062548D20D232DA /* AssetsManageWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AssetsManageWireframe.swift; sourceTree = ""; }; DD1A2F7E5E278FDCC89FE097 /* OnChainTransferSetupPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OnChainTransferSetupPresenter.swift; sourceTree = ""; }; + DD1A35F4D82F97C9663F1CD4 /* ReferendumVoteConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteConfirmInteractor.swift; sourceTree = ""; }; DD2F1EEBF48485F02BF690A4 /* ParaStkStakeSetupViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkStakeSetupViewController.swift; sourceTree = ""; }; + DDF3C1CFECE4340E82837FC4 /* ReferendumVotersViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVotersViewFactory.swift; sourceTree = ""; }; + DE767858B6CF5F6F7C7B418E /* ReferendumVoteConfirmProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteConfirmProtocols.swift; sourceTree = ""; }; DF715CEF29477B59119520F1 /* ParitySignerAddressesInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddressesInteractor.swift; sourceTree = ""; }; DFF58EC3A44E4DDDFB4B5C84 /* ParaStkYieldBoostStopViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostStopViewLayout.swift; sourceTree = ""; }; E0DB5EA5195D9433A4B90793 /* AdvancedWalletWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdvancedWalletWireframe.swift; sourceTree = ""; }; @@ -5247,6 +5755,7 @@ E1E60EF37AC0A7646ED8FE64 /* AccountImportViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountImportViewFactory.swift; sourceTree = ""; }; E20124142C4011901EF55AAA /* ParitySignerAddressesViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddressesViewLayout.swift; sourceTree = ""; }; E29DAC8F2DB0F7BF909812FA /* DAppTxDetailsViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppTxDetailsViewLayout.swift; sourceTree = ""; }; + E2E47548C4A216327B05A63C /* ReferendumFullDescriptionInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDescriptionInteractor.swift; sourceTree = ""; }; E2F3E725280823CF00CF31B5 /* ETHAccountInjection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ETHAccountInjection.swift; sourceTree = ""; }; E30E541992BF608923DABE5F /* LocksWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LocksWireframe.swift; sourceTree = ""; }; E4C77FD258A19F08F3955AC4 /* ParaStkUnstakeConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkUnstakeConfirmInteractor.swift; sourceTree = ""; }; @@ -5258,11 +5767,12 @@ E5CC1FB277A878E9C9B7EAEB /* AccountImportInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountImportInteractor.swift; sourceTree = ""; }; E63ECD1205B2CCCDA2E66A1E /* ParaStkYieldBoostSetupViewLayout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYieldBoostSetupViewLayout.swift; sourceTree = ""; }; E675B4C5BE36C0004564105B /* DAppOperationConfirmProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppOperationConfirmProtocols.swift; sourceTree = ""; }; - E70C8A9C6BF8AE46CAE1CB61 /* CrowdloanListViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanListViewFactory.swift; sourceTree = ""; }; + E6FE9E98CB265815986BE909 /* ReferendumVotersProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVotersProtocols.swift; sourceTree = ""; }; E8B10C37813EFE7D7663605E /* ParitySignerAddressesWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParitySignerAddressesWireframe.swift; sourceTree = ""; }; E8C13B77688FFF0FFBBB6612 /* ParaStkYourCollatorsWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkYourCollatorsWireframe.swift; sourceTree = ""; }; E9636093217ABE05A7FAC9B9 /* AccountCreateViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountCreateViewFactory.swift; sourceTree = ""; }; E9F49B3B261FBA0B568A5320 /* ParaStkRebondPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkRebondPresenter.swift; sourceTree = ""; }; + E9FBF368FBB46AD4DE606DB1 /* ReferendumVotersWireframe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVotersWireframe.swift; sourceTree = ""; }; EB8605FD90D8C3553A9897B4 /* AccountImportPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AccountImportPresenter.swift; sourceTree = ""; }; ED010772D7CE0450BDF30707 /* ParaStkCollatorFiltersViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ParaStkCollatorFiltersViewFactory.swift; sourceTree = ""; }; ED5CED3C58CD433B19978EC4 /* TransferOnChainConfirmInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TransferOnChainConfirmInteractor.swift; sourceTree = ""; }; @@ -5281,6 +5791,7 @@ EFB278373745C20822442686 /* ExportSeedPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ExportSeedPresenter.swift; sourceTree = ""; }; F02DBCA4A63A5E52E3739374 /* ControllerAccountConfirmationViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ControllerAccountConfirmationViewFactory.swift; sourceTree = ""; }; F0548D67378CB1EFEC2D5784 /* Pods-novawalletAll-novawalletIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-novawalletAll-novawalletIntegrationTests.release.xcconfig"; path = "Target Support Files/Pods-novawalletAll-novawalletIntegrationTests/Pods-novawalletAll-novawalletIntegrationTests.release.xcconfig"; sourceTree = ""; }; + F080BC55D9575EBE4216283C /* ReferendumFullDescriptionViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumFullDescriptionViewController.swift; sourceTree = ""; }; F1A9B9D741BABBCE6C70BE45 /* LedgerDiscoverProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LedgerDiscoverProtocols.swift; sourceTree = ""; }; F23E38DCBC74C528D7839B76 /* CrowdloanContributionSetupInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CrowdloanContributionSetupInteractor.swift; sourceTree = ""; }; F23EDFB699CAEEADC9263A0D /* DAppAuthSettingsViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppAuthSettingsViewFactory.swift; sourceTree = ""; }; @@ -5374,6 +5885,7 @@ F462B350260C7DBE0005AB01 /* StakingRewardHistoryTableCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingRewardHistoryTableCell.swift; sourceTree = ""; }; F462B35B260C86880005AB01 /* ViewHolder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewHolder.swift; sourceTree = ""; }; F462B363260C88050005AB01 /* UITableView+Reuse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableView+Reuse.swift"; sourceTree = ""; }; + F4642DD5186EFA940518CCB4 /* GovernanceUnlockSetupProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GovernanceUnlockSetupProtocols.swift; sourceTree = ""; }; F466AA84273D0D4200D14021 /* SettingsSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsSectionHeaderView.swift; sourceTree = ""; }; F466AA8F273D188600D14021 /* SettingsRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsRow.swift; sourceTree = ""; }; F46F9F8F2733E02B00FFA556 /* MoonbeamKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoonbeamKeys.swift; sourceTree = ""; }; @@ -5451,7 +5963,7 @@ F4F65C3226D8B81A002EE838 /* FWChartViewProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FWChartViewProtocol.swift; sourceTree = ""; }; F4F65C3726D8B86F002EE838 /* FWXAxisEmptyValueFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FWXAxisEmptyValueFormatter.swift; sourceTree = ""; }; F4F65C3C26D8B9DD002EE838 /* FWYAxisChartFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FWYAxisChartFormatter.swift; sourceTree = ""; }; - F4F69E272731B0B200214542 /* CrowdloanTableHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CrowdloanTableHeaderView.swift; sourceTree = ""; }; + F4F69E272731B0B200214542 /* VoteTableHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VoteTableHeaderView.swift; sourceTree = ""; }; F4F9944B0577EFF25A0643FE /* LocksProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LocksProtocols.swift; sourceTree = ""; }; F4FDA0F726A57626003D753B /* BabeEraOperationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BabeEraOperationFactory.swift; sourceTree = ""; }; F4FDA0FC26A57860003D753B /* EraCountdown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EraCountdown.swift; sourceTree = ""; }; @@ -5472,6 +5984,7 @@ FE0641B2354E6F236CB9A132 /* NftDetailsPresenter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NftDetailsPresenter.swift; sourceTree = ""; }; FE4AF0849E32E5B9C72E2ABB /* RecommendedValidatorListViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = RecommendedValidatorListViewFactory.swift; sourceTree = ""; }; FF4688AF0658F8BB7A90C2BE /* ExportMnemonicConfirmViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ExportMnemonicConfirmViewFactory.swift; sourceTree = ""; }; + FF755EE09598254BB5E59CC2 /* ReferendumVoteSetupViewFactory.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReferendumVoteSetupViewFactory.swift; sourceTree = ""; }; FFB4A14C99D151B41F61F474 /* DAppTxDetailsInteractor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DAppTxDetailsInteractor.swift; sourceTree = ""; }; FFEBC03AB1841681427D38AF /* StakingRewardPayoutsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StakingRewardPayoutsViewController.swift; sourceTree = ""; }; FFF3E2C8682E9BCCB0A6872D /* AccountConfirmViewController.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; path = AccountConfirmViewController.xib; sourceTree = ""; }; @@ -5948,6 +6461,23 @@ path = HistoryFilter; sourceTree = ""; }; + 357F2FABE25DB08B50B329CF /* ReferendumVoters */ = { + isa = PBXGroup; + children = ( + 8483B15928F991400048B295 /* View */, + 8483B15628F98C700048B295 /* ViewModel */, + 8483B14F28F939F30048B295 /* Model */, + E6FE9E98CB265815986BE909 /* ReferendumVotersProtocols.swift */, + E9FBF368FBB46AD4DE606DB1 /* ReferendumVotersWireframe.swift */, + C9990DF2F0214CD51E5388CE /* ReferendumVotersPresenter.swift */, + 23CC3812E4DFC26484324D57 /* ReferendumVotersInteractor.swift */, + 42594560B2928C79B87275D8 /* ReferendumVotersViewController.swift */, + 8602E65CC4E81A7BE1727CE3 /* ReferendumVotersViewLayout.swift */, + DDF3C1CFECE4340E82837FC4 /* ReferendumVotersViewFactory.swift */, + ); + path = ReferendumVoters; + sourceTree = ""; + }; 39A771F6D252031C00568966 /* ParaStkYieldBoostSetup */ = { isa = PBXGroup; children = ( @@ -6201,6 +6731,22 @@ path = SelectValidatorsConfirm; sourceTree = ""; }; + 77E4088EF503B8FD414F14EA /* GovernanceUnlockConfirm */ = { + isa = PBXGroup; + children = ( + 84A9ECC229129F360094C763 /* ViewModel */, + 84A9ECBF2912925E0094C763 /* Model */, + 0D3FE2CE7F9F2836755DBA63 /* GovernanceUnlockConfirmProtocols.swift */, + 1E067006C1BC9DFCA5E8DB86 /* GovernanceUnlockConfirmWireframe.swift */, + 513A449CCF5A417B67B7067D /* GovernanceUnlockConfirmPresenter.swift */, + 9638E6EDBA41A5772E0033AE /* GovernanceUnlockConfirmInteractor.swift */, + 01B2EBE8C02491A06121705A /* GovernanceUnlockConfirmViewController.swift */, + 8EE81AE154A736A93FF3812B /* GovernanceUnlockConfirmViewLayout.swift */, + 358E87C8E90981E6D9515745 /* GovernanceUnlockConfirmViewFactory.swift */, + ); + path = GovernanceUnlockConfirm; + sourceTree = ""; + }; 788647A9C0A8684C9A8AC310 /* ControllerAccount */ = { isa = PBXGroup; children = ( @@ -6323,6 +6869,17 @@ path = View; sourceTree = ""; }; + 840302E6292D00090013F356 /* GovernanceAssetSelection */ = { + isa = PBXGroup; + children = ( + 840302E7292D00380013F356 /* GovernanceAssetSelectionPresenter.swift */, + 84E0EE07292D3C2D008B2953 /* GovernanceAssetSelectionProtocols.swift */, + 84E0EE09292D3CB4008B2953 /* GovernanceAssetSelectionWireframe.swift */, + 84E0EE0B292D402C008B2953 /* GovernanceAssetSelectionViewFactory.swift */, + ); + path = GovernanceAssetSelection; + sourceTree = ""; + }; 8407715428CB7D22007DBD24 /* Base */ = { isa = PBXGroup; children = ( @@ -6408,6 +6965,15 @@ path = XcmService; sourceTree = ""; }; + 8412219C28F0512B00715C82 /* Governance */ = { + isa = PBXGroup; + children = ( + 8412219D28F0514400715C82 /* ReferendumsMetadataPreviewProviderSource.swift */, + 84C9CF3E291AF4B2002BF328 /* ReferendumMetadataDetailsProviderSource.swift */, + ); + path = Governance; + sourceTree = ""; + }; 84155DE8253980D700A27058 /* Services */ = { isa = PBXGroup; children = ( @@ -6583,6 +7149,26 @@ path = ConnectionPool; sourceTree = ""; }; + 8425D0DE28FE736F003B782A /* Model */ = { + isa = PBXGroup; + children = ( + 8425D0DF28FE738D003B782A /* ReferendumVoteSetupInteractorError.swift */, + 84F1D66C29051F240050F4E3 /* ReferendumReuseLockModel.swift */, + 84770F24291F72D700852A33 /* ReferendumVotingInitData.swift */, + ); + path = Model; + sourceTree = ""; + }; + 8425D0E128FE75EA003B782A /* ReferendumVote */ = { + isa = PBXGroup; + children = ( + 8425D0E228FE766B003B782A /* ReferendumVoteProtocols.swift */, + 8425D0E528FE82CB003B782A /* ReferendumVoteInteractor.swift */, + 8425D0E728FE8356003B782A /* ReferendumVoteInteractorError.swift */, + ); + path = ReferendumVote; + sourceTree = ""; + }; 8428228B289B2D2D00163031 /* Base */ = { isa = PBXGroup; children = ( @@ -6948,6 +7534,29 @@ path = Storage; sourceTree = ""; }; + 843461F1290D370000379936 /* Locks */ = { + isa = PBXGroup; + children = ( + 8427495428FEB92700B2B70B /* GovernanceLockStateFactory.swift */, + 845B0816291902CF005785D3 /* Gov2LockStateFactory.swift */, + 845B0818291905CA005785D3 /* Gov1LockStateFactory.swift */, + 843461F4290E4A1C00379936 /* GovernanceUnlocksCalculator.swift */, + 843461F6290E4AF500379936 /* GovUnlocksCalculator.swift */, + 845B08122918FF98005785D3 /* Gov2UnlockReferendum.swift */, + 845B081429190056005785D3 /* Gov1UnlockReferendum.swift */, + ); + path = Locks; + sourceTree = ""; + }; + 843461F8290E55BE00379936 /* Governance */ = { + isa = PBXGroup; + children = ( + 843461F9290E55D100379936 /* GovernanceUnlocksTestBuilding.swift */, + 84741ADE290F116B00C98E17 /* Gov2UnlockScheduleTests.swift */, + ); + path = Governance; + sourceTree = ""; + }; 84350AD7284604B50031EF24 /* ViewModel */ = { isa = PBXGroup; children = ( @@ -7068,6 +7677,9 @@ 84264EE0285B6C6700BF6D4A /* XcmTransfersSyncTests.swift */, 844133BA2860528500845987 /* XcmTransfersFeeTests.swift */, 84BFE8A128C2420A00140F1F /* AutocompounDelegateStakeTests.swift */, + 847A25C228D84A9C006AC9F5 /* ReferendumFetchTests.swift */, + 84532D5E28E4210E00EF4ADC /* ConvictionVotesFetchTests.swift */, + 843B6F4E28EEEF610086D4E0 /* Gov2OperationFactoryTests.swift */, ); path = novawalletIntegrationTests; sourceTree = ""; @@ -7075,6 +7687,13 @@ 8438E1DC24C18F11001BDB13 /* Types */ = { isa = PBXGroup; children = ( + 845B07E929159174005785D3 /* Democracy */, + 84B6349B28F4A05A00503306 /* Preimage */, + 845B811328F43C1E0040CE84 /* Treasury */, + 845B811028F429AB0040CE84 /* Support */, + 848CC94228D9FBBE009EB4B0 /* ConvictionVoting */, + 848CC93928D9F68C009EB4B0 /* Scheduler */, + 847A25C428D84BC9006AC9F5 /* Referenda */, 8469D5A428F5E8D40074FEE3 /* Staking */, 84BFE89A28C23A0900140F1F /* AutomationTime */, 84FB9E18285C57C000B42FC0 /* Xcm */, @@ -7130,6 +7749,9 @@ 8493D0E026FF4F5000A28008 /* ScaleCoder+Extension.swift */, 84D2F19C2771E5610040C680 /* ExtrinsicBuilder+Signing.swift */, 8499FEC727BF73F400712589 /* StorageKeyFactory+Size.swift */, + 840302DD292CE3EA0013F356 /* StorageEntryMetadata+TypeCheck.swift */, + 840302DF292CE4030013F356 /* CodingFactory+TypeCheck.swift */, + 84E0EE0D292D69A9008B2953 /* CallMetadata+TypeCheck.swift */, ); path = SubstrateSdk; sourceTree = ""; @@ -7295,6 +7917,19 @@ path = ViewModel; sourceTree = ""; }; + 8442002128E6FE0100C49C4A /* Referendums */ = { + isa = PBXGroup; + children = ( + 84D8753E28EB1A46004065BD /* Model */, + 8442002228E6FE1E00C49C4A /* ReferendumsViewManager.swift */, + 8442002428E6FEEE00C49C4A /* ReferendumsProtocols.swift */, + 8442003728EAA16600C49C4A /* ReferendumsPresenter.swift */, + 8442003928EAA2D300C49C4A /* ReferendumsInteractor.swift */, + 8442003B28EAA2E400C49C4A /* ReferendumsWireframe.swift */, + ); + path = Referendums; + sourceTree = ""; + }; 8444406D28AA57D600446D22 /* Ledger */ = { isa = PBXGroup; children = ( @@ -7335,6 +7970,7 @@ 84452F7225D5E2B300F47EC5 /* runtime-default.json */, 84452F7325D5E2B300F47EC5 /* runtime-kusama.json */, 8438C45A2655AC2600047E3F /* runtime-rococo.json */, + 84F1D67229069FFB0050F4E3 /* governanceDApps.json */, ); path = Resources; sourceTree = ""; @@ -7519,6 +8155,33 @@ path = ViewModel; sourceTree = ""; }; + 8453DE5328FD24210055345C /* Subscription */ = { + isa = PBXGroup; + children = ( + 8453DE5428FD24FF0055345C /* GovernanceSubscriptionProtocol.swift */, + 8453DE5628FD27390055345C /* Gov2SubscriptionFactory.swift */, + 845B07FE2916F529005785D3 /* Gov1SubscriptionFactory.swift */, + ); + path = Subscription; + sourceTree = ""; + }; + 8455AB4628F7F07200974E88 /* ViewModel */ = { + isa = PBXGroup; + children = ( + 8892284728F353A5003F8B9E /* ReferendumsModelFactory.swift */, + 8892284928F35410003F8B9E /* ReferendumsViewModel.swift */, + 88B438E628F6C629001FC08A /* StatusTimeViewModel.swift */, + 8455AB4428F7F05400974E88 /* ReferendumStatusViewModelFactory.swift */, + 8455AB4928F80D9300974E88 /* ReferendumTrackType.swift */, + 8483B15C28FA79620048B295 /* ReferendumDisplayStringFactory.swift */, + 84F1D66E29066F740050F4E3 /* ReferendumVotesViewModel.swift */, + 848701092907055900F2C0C3 /* ReferendumTimelineViewModelFactory.swift */, + 8487010B2907AA9B00F2C0C3 /* ReferendumMetadataViewModelFactory.swift */, + 84033054290FD745009C18E6 /* ReferendumsUnlocksViewModel.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; 8457F91126EB9088006803E1 /* EntityToModel */ = { isa = PBXGroup; children = ( @@ -7531,10 +8194,80 @@ 8499FECB27BF8F4A00712589 /* NftModelMapper.swift */, 84F3B27727F4179A00D64CF5 /* PhishingSiteMapper.swift */, 849E07F5284A114B00DE0440 /* ParaStkScheduledRequestsMapper.swift */, + 8493FF37291A59D800F09F1B /* ReferendumMetadataMapper.swift */, ); path = EntityToModel; sourceTree = ""; }; + 845AADA42903B30400B5AE96 /* Model */ = { + isa = PBXGroup; + children = ( + 845AADA52903B32E00B5AE96 /* ReferendumVoteConfirmError.swift */, + ); + path = Model; + sourceTree = ""; + }; + 845B07E929159174005785D3 /* Democracy */ = { + isa = PBXGroup; + children = ( + 845B07EA29159190005785D3 /* Democracy.swift */, + 845B07EC291594E1005785D3 /* DemocracyReferendum.swift */, + 845B07EE2915951A005785D3 /* DemocracyVoteThreshold.swift */, + 845B07F029159AE7005785D3 /* DemocracyVoting.swift */, + 845B07F229159C15005785D3 /* Democracy+CodingPath.swift */, + 845B07F629162AB3005785D3 /* Democracy+ConstantPath.swift */, + 845B08052918C3FB005785D3 /* DemocracyProposalCall.swift */, + ); + path = Democracy; + sourceTree = ""; + }; + 845B08022918C2E5005785D3 /* Action */ = { + isa = PBXGroup; + children = ( + 845B811E28F451A40040CE84 /* GovernanceActionOperationFactory.swift */, + 845B08002918406A005785D3 /* Gov2ActionOperationFactory.swift */, + 845B08032918C308005785D3 /* Gov1ActionOperationFactory.swift */, + ); + path = Action; + sourceTree = ""; + }; + 845B080B2918D4E9005785D3 /* Democracy */ = { + isa = PBXGroup; + children = ( + 845B080C2918D4F8005785D3 /* Democracy+Call.swift */, + ); + path = Democracy; + sourceTree = ""; + }; + 845B080E2918D64B005785D3 /* Extrinsics */ = { + isa = PBXGroup; + children = ( + 845B080F2918D65E005785D3 /* GovernanceExtrinsicFactory.swift */, + 8425D0EB28FE9ACB003B782A /* Gov2ExtrinsicFactory.swift */, + 845B08092918D381005785D3 /* Gov1ExtrinsicFactory.swift */, + ); + path = Extrinsics; + sourceTree = ""; + }; + 845B811028F429AB0040CE84 /* Support */ = { + isa = PBXGroup; + children = ( + 845B811128F429BB0040CE84 /* SupportPallet.swift */, + ); + path = Support; + sourceTree = ""; + }; + 845B811328F43C1E0040CE84 /* Treasury */ = { + isa = PBXGroup; + children = ( + 845B811428F43C350040CE84 /* Treasury.swift */, + 845B811628F43C730040CE84 /* TreasuryProposal.swift */, + 845B811828F43D4C0040CE84 /* Treasury+CodingPath.swift */, + 845B811A28F445E90040CE84 /* Treasury+Calls.swift */, + ); + path = Treasury; + sourceTree = ""; + }; 845BB8B625E4464D00E5FCDC /* ExtrinsicService */ = { isa = PBXGroup; children = ( @@ -7556,6 +8289,8 @@ 845BB8C725E45D0600E5FCDC /* Calls */ = { isa = PBXGroup; children = ( + 845B080B2918D4E9005785D3 /* Democracy */, + 84A9ECBE29128D130094C763 /* ConvictionVoting */, 844ADE7C28CB34F600EE29F7 /* AutomationTime */, 84EBFCEC285E82AB0006327E /* Xcm */, 8445CC252836654B003B26CD /* Common */, @@ -7650,6 +8385,7 @@ 842643BC28785A940031B5B5 /* TuringStakingLocalSubscriptionFactory.swift */, 84EF8D38288FCE8100265346 /* WalletListLocalSubscriptionFactory.swift */, 880855F928D0BAA2004255E7 /* CrowdloanContributionLocalSubscriptionFactory.swift */, + 8412219A28F04EA600715C82 /* GovMetadataLocalSubscriptionFactory.swift */, ); path = DataProvider; sourceTree = ""; @@ -7657,6 +8393,7 @@ 8463A70825E30000003B8160 /* Sources */ = { isa = PBXGroup; children = ( + 8412219C28F0512B00715C82 /* Governance */, 846A682A274693D400D1A47A /* Crowdloan */, 84EE6826264AD37B0026E6D3 /* Rewards */, 8463A71E25E39E07003B8160 /* StorageProviderSource.swift */, @@ -7789,6 +8526,7 @@ 845B822826F0BB6700D25C72 /* CrowdloanChainSettings.swift */, 84F13F0726F13898006725FF /* StakingAssetSettings.swift */, 841AAC2E26F73E0C00F0A25E /* LocalStorageKeyFactory.swift */, + 84D8753928EB0A93004065BD /* GovernanceChainSettings.swift */, ); path = Storage; sourceTree = ""; @@ -7819,6 +8557,32 @@ path = ViewModel; sourceTree = ""; }; + 8468119528E6C87A00BF54F1 /* Vote */ = { + isa = PBXGroup; + children = ( + 8468119828E6D2A400BF54F1 /* Parent */, + 8438C486265649F800047E3F /* Crowdloan */, + 847A25C028D84A3D006AC9F5 /* Governance */, + ); + path = Vote; + sourceTree = ""; + }; + 8468119828E6D2A400BF54F1 /* Parent */ = { + isa = PBXGroup; + children = ( + 84D8754528EB6B7A004065BD /* View */, + 8468119628E6C90F00BF54F1 /* VoteProtocols.swift */, + 8442002628E6FFBA00C49C4A /* VoteViewController.swift */, + 8442002828E7004B00C49C4A /* VoteViewLayout.swift */, + 8442002A28E9ACDB00C49C4A /* VotePresenter.swift */, + 8442002C28E9ADB500C49C4A /* VoteInteractor.swift */, + 8442002E28E9AEFB00C49C4A /* VoteWireframe.swift */, + 8442003328E9BD3200C49C4A /* VoteChildPresenterFactory.swift */, + 8442003528EA9DF100C49C4A /* VoteViewFactory.swift */, + ); + path = Parent; + sourceTree = ""; + }; 8468B86324F59CF600B76BC6 /* TableHeader */ = { isa = PBXGroup; children = ( @@ -7877,6 +8641,15 @@ path = StakingDuration; sourceTree = ""; }; + 8469D5A328F5817C0074FEE3 /* Model */ = { + isa = PBXGroup; + children = ( + 8469D5A728F683930074FEE3 /* ReferendumDetailsInteractorError.swift */, + 84770F26291F7CD400852A33 /* ReferendumDetailsInitData.swift */, + ); + path = Model; + sourceTree = ""; + }; 8469D5A428F5E8D40074FEE3 /* Staking */ = { isa = PBXGroup; children = ( @@ -8032,6 +8805,32 @@ path = StorageSubscription; sourceTree = ""; }; + 847157792910F06000D7D003 /* GovernanceUnlock */ = { + isa = PBXGroup; + children = ( + 8471577A2910F0AF00D7D003 /* GovernanceUnlockInteractor.swift */, + 8471577C2910F18300D7D003 /* GovernanceUnlockProtocols.swift */, + 8471577F2910F30500D7D003 /* GovernanceUnlockInteractorError.swift */, + ); + path = GovernanceUnlock; + sourceTree = ""; + }; + 847157812911321000D7D003 /* View */ = { + isa = PBXGroup; + children = ( + 84715782291132B400D7D003 /* GovernanceUnlockTableViewCell.swift */, + ); + path = View; + sourceTree = ""; + }; + 847157842911367400D7D003 /* ViewModel */ = { + isa = PBXGroup; + children = ( + 84715785291136B100D7D003 /* GovernanceUnlocksViewModel.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; 8472974B260A9CAD009B86D0 /* Model */ = { isa = PBXGroup; children = ( @@ -8128,6 +8927,27 @@ path = ModalAlert; sourceTree = ""; }; + 84770F23291E590800852A33 /* Fetch */ = { + isa = PBXGroup; + children = ( + 84A1742828ED625D0096F943 /* Gov2OperationFactory.swift */, + 8438432D2913B3150048595C /* Gov1OperationFactory.swift */, + 843461E9290C04C400379936 /* Gov2OperationFactory+Protocol.swift */, + 845B07F4291627A3005785D3 /* Gov1OperationFactory+Protocol.swift */, + 845B07F829162D24005785D3 /* Gov1LocalMappingFactory.swift */, + 84DD49F328EE91ED00B804F3 /* Gov2LocalMappingFactory.swift */, + ); + path = Fetch; + sourceTree = ""; + }; + 84770F28291F85D500852A33 /* Model */ = { + isa = PBXGroup; + children = ( + 84770F29291F864500852A33 /* GovernanceUnlockInitData.swift */, + ); + path = Model; + sourceTree = ""; + }; 847999B22888B46300D1BAD2 /* Address */ = { isa = PBXGroup; children = ( @@ -8139,6 +8959,44 @@ path = Address; sourceTree = ""; }; + 847A25C028D84A3D006AC9F5 /* Governance */ = { + isa = PBXGroup; + children = ( + 84CEF286290462A700BA25BB /* Validating */, + 8453DE5328FD24210055345C /* Subscription */, + 8455AB4628F7F07200974E88 /* ViewModel */, + 880059D628EEA55500E87B9B /* View */, + 84A1742528ED60610096F943 /* Operation */, + 84D8753B28EB1796004065BD /* Model */, + 8442002128E6FE0100C49C4A /* Referendums */, + B4F0332763AFF64A3793C679 /* ReferendumDetails */, + 872D923BC3CE0F69157DB2EA /* ReferendumFullDetails */, + 357F2FABE25DB08B50B329CF /* ReferendumVoters */, + 8425D0E128FE75EA003B782A /* ReferendumVote */, + CEE6BB9D4D5A0E46E857EED4 /* ReferendumVoteSetup */, + B320B465EE16F566DDFE5D8C /* ReferendumVoteConfirm */, + 847157792910F06000D7D003 /* GovernanceUnlock */, + FD4B0C614F7A70D8FB51A1C3 /* GovernanceUnlockSetup */, + ABAF6F503B172CEE34E19030 /* ReferendumFullDescription */, + 77E4088EF503B8FD414F14EA /* GovernanceUnlockConfirm */, + 840302E6292D00090013F356 /* GovernanceAssetSelection */, + ); + path = Governance; + sourceTree = ""; + }; + 847A25C428D84BC9006AC9F5 /* Referenda */ = { + isa = PBXGroup; + children = ( + 847A25C528D84BE2006AC9F5 /* Referenda.swift */, + 847A25C728D84C0A006AC9F5 /* Referenda+CodingPath.swift */, + 847A25C928D85204006AC9F5 /* ReferendumInfo.swift */, + 848CC93E28D9F90D009EB4B0 /* ReferendaDeposit.swift */, + 84C41F3528EDADE000DB1CD3 /* ReferendaTrackInfo.swift */, + 84C41F3728EDB80700DB1CD3 /* ReferendaCurve.swift */, + ); + path = Referenda; + sourceTree = ""; + }; 847A6C0728817DAD00477F77 /* Base */ = { isa = PBXGroup; children = ( @@ -8203,6 +9061,32 @@ path = View; sourceTree = ""; }; + 8483B14F28F939F30048B295 /* Model */ = { + isa = PBXGroup; + children = ( + 8483B15028F93A080048B295 /* ReferendumVotersType.swift */, + 8483B15228F940080048B295 /* ReferendumVotersModel.swift */, + 8483B15428F9406C0048B295 /* ReferendumVotersInteractorError.swift */, + ); + path = Model; + sourceTree = ""; + }; + 8483B15628F98C700048B295 /* ViewModel */ = { + isa = PBXGroup; + children = ( + 8483B15728F98C9F0048B295 /* ReferendumVotersViewModel.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; + 8483B15928F991400048B295 /* View */ = { + isa = PBXGroup; + children = ( + 8483B15A28F991550048B295 /* ReferendumVotersTableViewCell.swift */, + ); + path = View; + sourceTree = ""; + }; 8487582227F06AF300495306 /* QRScanner */ = { isa = PBXGroup; children = ( @@ -8228,11 +9112,22 @@ path = Service; sourceTree = ""; }; + 84880C3E29016EFE00CADB06 /* ViewModel */ = { + isa = PBXGroup; + children = ( + 84880C3F29016F1500CADB06 /* ReferendumLockChangeViewModel.swift */, + 84880C41290172C300CADB06 /* ReferendumLockChangeViewModelFactory.swift */, + 84F1D66A29051A730050F4E3 /* ReferendumLockReuseViewModel.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; 84893BFA24D9B0D1008F6A3F /* Extensions */ = { isa = PBXGroup; children = ( 84893BFB24D9B0F1008F6A3F /* PredicateTests.swift */, 846A2C53252A0FDF00731018 /* FilterTests.swift */, + 84DD49F728EEAFFF00B804F3 /* DecimalTests.swift */, ); path = Extensions; sourceTree = ""; @@ -8250,6 +9145,7 @@ 8489EDD8264DE40800FF997E /* Migration */ = { isa = PBXGroup; children = ( + 84B4E12A28EC036B00AC4FA8 /* Mappers */, 849ECD3426DE70B900F542A3 /* SingleToMultiassetUserMigrationTests.swift */, 8890E51528DDC98C001D3994 /* SubstrateStorageMigrationTests.swift */, ); @@ -8283,6 +9179,28 @@ path = AccountAddFlow; sourceTree = ""; }; + 848CC93928D9F68C009EB4B0 /* Scheduler */ = { + isa = PBXGroup; + children = ( + 848CC93A28D9F6A5009EB4B0 /* OnChainScheduler.swift */, + 848CC93C28D9F6D8009EB4B0 /* OnChainDispatchTime.swift */, + ); + path = Scheduler; + sourceTree = ""; + }; + 848CC94228D9FBBE009EB4B0 /* ConvictionVoting */ = { + isa = PBXGroup; + children = ( + 848CC94328D9FBDA009EB4B0 /* ConvictionVoting.swift */, + 848CC94528D9FC46009EB4B0 /* ConvictionVotingTally.swift */, + 84532D5C28E41D8500EF4ADC /* ConvictionVoting+StoragePath.swift */, + 84532D6028E4234700EF4ADC /* ConvictionVotingForKey.swift */, + 8448148028E46881007F64FF /* ConvictionVotingLocks.swift */, + 8427495628FEBFA400B2B70B /* ConvictionVoting+ConstantPath.swift */, + ); + path = ConvictionVoting; + sourceTree = ""; + }; 848DAEFC282293BD00D56F55 /* ParachainStaking */ = { isa = PBXGroup; children = ( @@ -8398,7 +9316,6 @@ 849013A924A80984008F705E /* Products */, 2698CD398B0412EB85D620AB /* Pods */, BFB3965A583F11EF3045E064 /* Frameworks */, - 849DA43128C5D58D004757F0 /* Recovered References */, ); sourceTree = ""; }; @@ -8486,6 +9403,7 @@ 849013D224A9268D008F705E /* Modules */ = { isa = PBXGroup; children = ( + 8468119528E6C87A00BF54F1 /* Vote */, 848FD1A628AE314F00CCD9E2 /* Ledger */, 8842104D289BBA8D00306F2C /* Currency */, 95ED25232B568F2C7DA953CC /* MessageSheet */, @@ -8496,7 +9414,6 @@ 846B49A92769EEC80066B875 /* DApp */, AEE0C434272A8A50009F9AD5 /* AddChainAccount */, AEE0C440272A9AD4009F9AD5 /* ImportChainAccount */, - 8438C486265649F800047E3F /* Crowdloan */, 0D927CDE29F5C9F4CA537F8F /* AccountConfirm */, 4C5888389F25B5C82454F92D /* AccountCreate */, BF6F50DD15230CADAC713359 /* AccountImport */, @@ -8634,6 +9551,7 @@ 887AFC8628BC95F0002A0422 /* MetaAccountChainResponse.swift */, 8831F0FF28C65B95009F7682 /* AssetLock.swift */, 2AC7BC832731A214001D99B0 /* AssetLocks+Sort.swift */, + 849D3222291CC43D00D25839 /* MarkdownText.swift */, ); path = Model; sourceTree = ""; @@ -8730,6 +9648,7 @@ 846A835528B8A5C700D92892 /* WalletCreationFlowCompleting.swift */, 846A835928B8C5EC00D92892 /* TransactionExpiredPresentable.swift */, 843074F828BF6201009D463B /* NoAccountSupportPresentable.swift */, + 84A6AB63290B021E001B57B2 /* CopyPresentable.swift */, ); path = Protocols; sourceTree = ""; @@ -8841,6 +9760,8 @@ 849FA21528A26CB500F83EAA /* CountdownTimerMediator.swift */, 84466B3228B65B5B00FA1E0D /* MetaAccountModel+Identicon.swift */, 847A25BE28D7C2A2006AC9F5 /* AccountIdCodingWrapper.swift */, + 8453DE5828FD32780055345C /* NotEqualWrapper.swift */, + 8453DE5A28FD32B50055345C /* StorageSubscriptionObserver.swift */, ); path = Helpers; sourceTree = ""; @@ -8872,6 +9793,7 @@ 84D9C8F228ADA42F007FB23B /* Data+Chunk.swift */, 880855EC28D062A9004255E7 /* Array+AddOrReplace.swift */, 88BB219F28D34C660019C6B4 /* DataProviderChange+Identifier.swift */, + 84D911A9292C923D0032EF33 /* Data+Fill.swift */, ); path = Foundation; sourceTree = ""; @@ -8915,6 +9837,7 @@ 848B2FFF286EDE3800465BA2 /* ParaIdOperationFactory.swift */, 847999A8288862A500D1BAD2 /* MetaAccountOperationFactory+Secrets.swift */, 84A58FD828A10ABD003F6ABF /* MultipartQrOperationFactory.swift */, + 8824D423290324260022D778 /* PrettyPrintedJSONOperationFactory.swift */, ); path = Operation; sourceTree = ""; @@ -9044,6 +9967,11 @@ 8887813D28B7AA3100E7290F /* RoundedIconTitleCollectionHeaderView.swift */, 8887813F28B7AAB700E7290F /* RoundedIconTitleView.swift */, 84E90BA028D0B51000529633 /* CheckboxControlView.swift */, + 8468119328E6234B00BF54F1 /* RoundedSegmentedControl.swift */, + 84E63C1628FFC69A0093534A /* DiscreteGradientSlider.swift */, + 84F76ED729006BC400D7206C /* DiscreteGradientSlider+Style.swift */, + 845AADA02902D02400B5AE96 /* TitleValueDiffView.swift */, + 845AADA22902D1EA00B5AE96 /* StackTitleValueDiffCell.swift */, ); path = View; sourceTree = ""; @@ -9148,6 +10076,7 @@ 8490150124AB6BEA008F705E /* Network */ = { isa = PBXGroup; children = ( + 84C9CF39291AE30F002BF328 /* Polkassembly */, 843E9B3027C8B1D4009C143A /* Files */, 8499FE6D27BE1ABF00712589 /* BaseOperationFactory */, 8499FE6427BD15AC00712589 /* DistributedStorage */, @@ -9257,6 +10186,8 @@ 84E2589C2892B41500DC8A51 /* WalletSwitchViewModelFactory.swift */, 845E49822636C87B002F8C22 /* ActionManageViewModel.swift */, 84BC704A289F1338008A9758 /* ExpirationTimeViewModel.swift */, + 84D8754128EB5D66004065BD /* ChainBalanceViewModel.swift */, + 84D8754328EB5E6D004065BD /* ChainBalanceViewModelFactory.swift */, ); path = ViewModel; sourceTree = ""; @@ -9396,12 +10327,9 @@ isa = PBXGroup; children = ( 88E8CF5D28E3789600C90112 /* CrowdloanEmptyView.swift */, - F4F69E272731B0B200214542 /* CrowdloanTableHeaderView.swift */, 84BB3CF7267D276D00676FFE /* CrowdloanTableViewCell.swift */, - 8498430226592D29006BBB9F /* CrowdloanStatusSectionView.swift */, 88D997B128ABC90E006135A5 /* AboutCrowdloansView.swift */, 88D997AD28AB86FD006135A5 /* YourContributionsView.swift */, - 8820134728EB04300027CD80 /* SkeletonableView.swift */, ); path = View; sourceTree = ""; @@ -9559,15 +10487,6 @@ path = Models; sourceTree = ""; }; - 849DA43128C5D58D004757F0 /* Recovered References */ = { - isa = PBXGroup; - children = ( - 848B59B328BC9FBF0009543C /* AccountManagementFilter.swift */, - 846AACEE28BF9519009F3D42 /* NoAccountSupportPresentable.swift */, - ); - name = "Recovered References"; - sourceTree = ""; - }; 849DEBD225ED014000C64C19 /* ViewModel */ = { isa = PBXGroup; children = ( @@ -9593,6 +10512,19 @@ path = Model; sourceTree = ""; }; + 84A1742528ED60610096F943 /* Operation */ = { + isa = PBXGroup; + children = ( + 84770F23291E590800852A33 /* Fetch */, + 845B080E2918D64B005785D3 /* Extrinsics */, + 845B08022918C2E5005785D3 /* Action */, + 843461F1290D370000379936 /* Locks */, + 84A1742628ED607B0096F943 /* GovernanceOperationProtocols.swift */, + 8425D0E928FE9A45003B782A /* GovernanceExtrinsicFactoryProtocol.swift */, + ); + path = Operation; + sourceTree = ""; + }; 84A2A60826B82B1C000C6C6C /* ValidatorOperationFactory */ = { isa = PBXGroup; children = ( @@ -9663,6 +10595,14 @@ path = Operation; sourceTree = ""; }; + 84A6AB5C290AA7C8001B57B2 /* ViewModel */ = { + isa = PBXGroup; + children = ( + 84A6AB5D290AA7DF001B57B2 /* ReferendumFullDetailsViewModel.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; 84A8FD8C265FDA42002ADB58 /* Model */ = { isa = PBXGroup; children = ( @@ -9671,6 +10611,31 @@ path = Model; sourceTree = ""; }; + 84A9ECBE29128D130094C763 /* ConvictionVoting */ = { + isa = PBXGroup; + children = ( + 8425D0EF28FE9CF0003B782A /* ConvictionVoting+Call.swift */, + ); + path = ConvictionVoting; + sourceTree = ""; + }; + 84A9ECBF2912925E0094C763 /* Model */ = { + isa = PBXGroup; + children = ( + 84A9ECC0291292900094C763 /* GovernanceUnlockConfirmInteractorError.swift */, + 84770F2B291F893200852A33 /* GovernanceUnlockConfirmInitData.swift */, + ); + path = Model; + sourceTree = ""; + }; + 84A9ECC229129F360094C763 /* ViewModel */ = { + isa = PBXGroup; + children = ( + 84A9ECC329129FF10094C763 /* GovernanceRemainedLockViewModel.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; 84ACEBF0261E663700AAE665 /* ViewModel */ = { isa = PBXGroup; children = ( @@ -9687,6 +10652,14 @@ path = SiMappers; sourceTree = ""; }; + 84B4E12A28EC036B00AC4FA8 /* Mappers */ = { + isa = PBXGroup; + children = ( + 84B4E12B28EC038C00AC4FA8 /* ChainModelMapperV2V3.swift */, + ); + path = Mappers; + sourceTree = ""; + }; 84B5DE54283F7C6000193ED3 /* View */ = { isa = PBXGroup; children = ( @@ -9713,9 +10686,19 @@ path = Model; sourceTree = ""; }; + 84B6349B28F4A05A00503306 /* Preimage */ = { + isa = PBXGroup; + children = ( + 84B6349C28F4A06D00503306 /* Preimage.swift */, + 84B6349E28F5575900503306 /* PreimageRequestStatus.swift */, + ); + path = Preimage; + sourceTree = ""; + }; 84B7C680289BFA78001A3566 /* Modules */ = { isa = PBXGroup; children = ( + 843461F8290E55BE00379936 /* Governance */, 84B7C683289BFA78001A3566 /* Settings */, 84B7C685289BFA78001A3566 /* ParaStkUnstake */, 84B7C686289BFA78001A3566 /* DAppAuthSettings */, @@ -10578,6 +11561,14 @@ path = Protocols; sourceTree = ""; }; + 84C9CF39291AE30F002BF328 /* Polkassembly */ = { + isa = PBXGroup; + children = ( + 84C9CF3A291AE328002BF328 /* PolkassemblyOperationFactory.swift */, + ); + path = Polkassembly; + sourceTree = ""; + }; 84CAF52524BEEF2F00F4C295 /* JSONRPC */ = { isa = PBXGroup; children = ( @@ -10592,6 +11583,7 @@ 84300B2B26C10C9B00D64514 /* ConnectionStateReporting.swift */, F4C201812728678400B0F3D0 /* ExtrinsicStatus.swift */, 846CF0CC2914DC25008A96A1 /* RemoteStateCallRequest.swift */, + 845B08072918C8DA005785D3 /* RemoteStorageSizeRequest.swift */, ); path = JSONRPC; sourceTree = ""; @@ -10632,6 +11624,8 @@ 84EF8D3D288FDA2100265346 /* WalletListLocalStorageSubscriber.swift */, 84EF8D3F288FDA7700265346 /* WalletListLocalStorageSubscriptionHandler.swift */, 880855FB28D0C3DF004255E7 /* CrowdloansLocalStorageSubscriber.swift */, + 8412219F28F051EE00715C82 /* GovMetadataLocalStorageSubscriber.swift */, + 841221A128F0520300715C82 /* GovMetadataLocalStorageHandler.swift */, ); path = Subscription; sourceTree = ""; @@ -10644,6 +11638,17 @@ path = MigrationMappings; sourceTree = ""; }; + 84CEF286290462A700BA25BB /* Validating */ = { + isa = PBXGroup; + children = ( + 84CEF287290462C300BA25BB /* GovernanceValidatorFactory.swift */, + 84CEF289290466A800BA25BB /* GovernanceErrorPresentable.swift */, + 84CEF28B290509D600BA25BB /* GovernanceVoteValidatingParams.swift */, + 84CEF28D29050A3300BA25BB /* DataValidationRunner+GovVote.swift */, + ); + path = Validating; + sourceTree = ""; + }; 84CFF1CE26526FBC00DB7CF7 /* StakingBondMore */ = { isa = PBXGroup; children = ( @@ -10806,6 +11811,50 @@ path = Parachain; sourceTree = ""; }; + 84D8753B28EB1796004065BD /* Model */ = { + isa = PBXGroup; + children = ( + 84D8753C28EB17B2004065BD /* GovernanceSharedState.swift */, + 84A1742328ED3CF70096F943 /* ReferendumLocal.swift */, + 84DD49F528EE974B00B804F3 /* ReferendumDecidingFunctionProtocol.swift */, + 84E9A04F28F000AB00551DC4 /* ReferendumMetadataLocal.swift */, + 841221A328F0A3F200715C82 /* ReferendumAccountVoteLocal.swift */, + 841221A528F13BA100715C82 /* GovernanceServiceFactory.swift */, + 849707A028F3E0AC00DD0A02 /* ReferendumVoterLocal.swift */, + 845B811C28F44A700040CE84 /* ReferendumActionLocal.swift */, + 8425D0ED28FE9BF1003B782A /* ReferendumVoteAction.swift */, + 8427495028FEB6E500B2B70B /* GovernanceLockState.swift */, + 8427495228FEB8C800B2B70B /* ReferendumNewVote.swift */, + 84880C4329026C3E00CADB06 /* ReferendumDelegatingLocal.swift */, + 84880C452902781E00CADB06 /* ReferendumVotingLocal.swift */, + 843461E7290BF14400379936 /* ReferendumsSorting.swift */, + 843461EB290D0D9400379936 /* GovernanceUnlockSchedule.swift */, + 845B07FC291634D4005785D3 /* DemocracyDecidingFunctionProtocol.swift */, + 84C9CF3C291AF1B1002BF328 /* GovernanceOffchainApi.swift */, + 849D321F291C26BA00D25839 /* GovernanceDAppList.swift */, + 84E0EE03292D336C008B2953 /* GovernanceType.swift */, + ); + path = Model; + sourceTree = ""; + }; + 84D8753E28EB1A46004065BD /* Model */ = { + isa = PBXGroup; + children = ( + 84D8753F28EB1A59004065BD /* ReferendumsInteractorError.swift */, + ); + path = Model; + sourceTree = ""; + }; + 84D8754528EB6B7A004065BD /* View */ = { + isa = PBXGroup; + children = ( + 888B853728ED966600AC9614 /* SkeletonableView.swift */, + 8498430226592D29006BBB9F /* VoteStatusSectionView.swift */, + F4F69E272731B0B200214542 /* VoteTableHeaderView.swift */, + ); + path = View; + sourceTree = ""; + }; 84D8F15324D80C8300AF43E9 /* ModalPicker */ = { isa = PBXGroup; children = ( @@ -10894,7 +11943,7 @@ children = ( 84EE780327C4CF9E0027357F /* DAppListItemsLoadingView.swift */, 84DA03DA275A31B500E8B326 /* DAppListHeaderView.swift */, - 8402CC9D275B946100E5BF30 /* DAppItemView.swift */, + 8402CC9D275B946100E5BF30 /* DAppItemViewCell.swift */, 8472072F277C335000F593DD /* DAppListFlowLayout.swift */, 84720731277C370600F593DD /* DAppCategoriesView.swift */, 8448D5B5277D717400FAEEBC /* DAppListDecorationView.swift */, @@ -11369,6 +12418,14 @@ path = View; sourceTree = ""; }; + 84F76ED4290069E900D7206C /* View */ = { + isa = PBXGroup; + children = ( + 84F76ED529006A0900D7206C /* ReferendumConvictionView.swift */, + ); + path = View; + sourceTree = ""; + }; 84F77AA8265EE82E00F54885 /* Protocols */ = { isa = PBXGroup; children = ( @@ -11508,6 +12565,50 @@ path = ParaStkUnstakeConfirm; sourceTree = ""; }; + 872D923BC3CE0F69157DB2EA /* ReferendumFullDetails */ = { + isa = PBXGroup; + children = ( + 84A6AB5C290AA7C8001B57B2 /* ViewModel */, + 3F6DA24E0481A3678F2EF809 /* ReferendumFullDetailsProtocols.swift */, + C80D934D47929D2331111AD7 /* ReferendumFullDetailsWireframe.swift */, + 33DFAA0EEEA7F99C6D1CF4B1 /* ReferendumFullDetailsPresenter.swift */, + 3C535E8504943299B3E4A8EB /* ReferendumFullDetailsViewController.swift */, + 57CDCB8CF3D8EBE5DA7A5A30 /* ReferendumFullDetailsViewLayout.swift */, + 369C65964F4D7E8D02EEC5EC /* ReferendumFullDetailsViewFactory.swift */, + 8824D4212902D92F0022D778 /* ReferendumFullDetailsInteractor.swift */, + 8824D42729032BF60022D778 /* ReferendumStateLocal+Presenter.swift */, + ); + path = ReferendumFullDetails; + sourceTree = ""; + }; + 880059D628EEA55500E87B9B /* View */ = { + isa = PBXGroup; + children = ( + 880059DD28EF093400E87B9B /* Slider */, + 880059E028EF0A5C00E87B9B /* VotingProgressView.swift */, + 880059E228EF128000E87B9B /* ReferendumInfoView.swift */, + 88B1862928EF30A600D49854 /* YourVoteView.swift */, + 889D889428F01E5B00C4320F /* ReferendumTableViewCell.swift */, + 889D889628F022AA00C4320F /* UILabel+Style.swift */, + 88F34FDC28FFE6E400712BDE /* MultiValueView+Model.swift */, + 84033056290FD8AB009C18E6 /* ReferendumsUnlocksTableViewCell.swift */, + 849D3226291CE25E00D25839 /* MarkdownViewContainer.swift */, + 849D3224291CC4A500D25839 /* MarkdownParsingOperationFactory.swift */, + ); + path = View; + sourceTree = ""; + }; + 880059DD28EF093400E87B9B /* Slider */ = { + isa = PBXGroup; + children = ( + 880059D728EEBC0200E87B9B /* SliderView.swift */, + 880059D928EF092800E87B9B /* ThumbView.swift */, + 880059DB28EF092F00E87B9B /* SegmentedSliderView.swift */, + 880059DE28EF09E100E87B9B /* GovernanceStyle.swift */, + ); + path = Slider; + sourceTree = ""; + }; 880855EE28D099BD004255E7 /* CrowdloanService */ = { isa = PBXGroup; children = ( @@ -11543,6 +12644,17 @@ path = Currency; sourceTree = ""; }; + 887A717A28FEF03000B13C7E /* Timeline */ = { + isa = PBXGroup; + children = ( + 88A95FA528F8664100BE26F3 /* ReferendumTimelineView.swift */, + 887A717B28FEF03E00B13C7E /* BaselinedView.swift */, + 882808C729009CA500AE8089 /* DotsView.swift */, + 882808C929009CDC00AE8089 /* UIView+frame.swift */, + ); + path = Timeline; + sourceTree = ""; + }; 887AFC8828BCB313002A0422 /* View */ = { isa = PBXGroup; children = ( @@ -11553,6 +12665,23 @@ path = View; sourceTree = ""; }; + 888A3B6328F73B9200E15BD2 /* View */ = { + isa = PBXGroup; + children = ( + 887A717A28FEF03000B13C7E /* Timeline */, + 88F34FD528FFE65600712BDE /* Rows */, + 888A3B6628F746D200E15BD2 /* ReferendumVotingStatusDetailsView.swift */, + 888A3B6428F73DC300E15BD2 /* ReferendumVotingStatusView.swift */, + 88B560BB28F80DCB00A5EB59 /* VoteRowView.swift */, + 88A95FA728FAA99D00BE26F3 /* ReferendumDAppView.swift */, + 88FAE78728FCF8E200130B47 /* ReferendumDetailsTitleView.swift */, + 88F34FD128FF045400712BDE /* BindableView.swift */, + 88107D6029015FAB001AB0B0 /* TrackTagsView.swift */, + 8824D42529032B410022D778 /* BlurredView.swift */, + ); + path = View; + sourceTree = ""; + }; 88A0E0FB28A284C700A9C940 /* Currency */ = { isa = PBXGroup; children = ( @@ -11585,12 +12714,10 @@ C191A3875F3255B72E01FA92 /* CrowdloanListWireframe.swift */, 86F7A369E31DCB9ABD556EE9 /* CrowdloanListPresenter.swift */, E4E78D69E8EBC3EB4D01F8EF /* CrowdloanListInteractor.swift */, - D852BF894D6E06EB9A92BC71 /* CrowdloanListViewController.swift */, - 63F4BE52D0625CD8C21D2460 /* CrowdloanListViewLayout.swift */, - E70C8A9C6BF8AE46CAE1CB61 /* CrowdloanListViewFactory.swift */, 84B66A0A26FDB70F0038B963 /* CrowdloansListInteractor+Protocols.swift */, 8828F4F228AD2734009E0B7C /* CrowdloansCalculator.swift */, 8828F4F428AD2763009E0B7C /* BalanceViewModelFactoryFacade.swift */, + 8442001F28E6FDBE00C49C4A /* CrowdloanListViewManager.swift */, ); path = CrowdloanList; sourceTree = ""; @@ -11618,6 +12745,21 @@ path = View; sourceTree = ""; }; + 88F34FD528FFE65600712BDE /* Rows */ = { + isa = PBXGroup; + children = ( + 88F34FD328FFE64400712BDE /* ReferendumDAppCellView.swift */, + 88F34FD628FFE66E00712BDE /* FullDetailsRow.swift */, + 88F34FD828FFE68B00712BDE /* YourVoteRow.swift */, + 88F34FDA28FFE6AA00712BDE /* RequestedAmountRow.swift */, + 88F34FDE28FFEAE500712BDE /* TimelineRow.swift */, + 88F34FE028FFEAFD00712BDE /* VotingDetailsRow.swift */, + 88107D5E290133F8001AB0B0 /* RoundedView+Styles.swift */, + 8487010D2907DF2F00F2C0C3 /* MultiValueView+Styles.swift */, + ); + path = Rows; + sourceTree = ""; + }; 8C1DCF40C8BE3290D4BB9843 /* ParaStkStakeConfirm */ = { isa = PBXGroup; children = ( @@ -11756,6 +12898,8 @@ 83AB0AD3A7CECD061611F60C /* AssetSelectionInteractor.swift */, 9622C6C3102EF12BEE78D63D /* AssetSelectionViewFactory.swift */, 840DC8412880AF440039A054 /* AssetSelectionViewController.swift */, + 840302E3292CFCF90013F356 /* AssetSelectionBasePresenter.swift */, + 84E0EE05292D3A58008B2953 /* AssetSelectionBaseProtocols.swift */, ); path = AssetSelection; sourceTree = ""; @@ -11818,6 +12962,20 @@ path = Instructions; sourceTree = ""; }; + ABAF6F503B172CEE34E19030 /* ReferendumFullDescription */ = { + isa = PBXGroup; + children = ( + 722DC609FE13ACBEE4328873 /* ReferendumFullDescriptionProtocols.swift */, + 57E6825E525785A1A12C62E7 /* ReferendumFullDescriptionWireframe.swift */, + CAEF44ADECD66B49E3430365 /* ReferendumFullDescriptionPresenter.swift */, + E2E47548C4A216327B05A63C /* ReferendumFullDescriptionInteractor.swift */, + F080BC55D9575EBE4216283C /* ReferendumFullDescriptionViewController.swift */, + D087F5710630FCC968B65FB5 /* ReferendumFullDescriptionViewLayout.swift */, + BAF9ED27CF12B7DA8B1378CF /* ReferendumFullDescriptionViewFactory.swift */, + ); + path = ReferendumFullDescription; + sourceTree = ""; + }; ADEC075C60AA6D00785D2BDF /* AssetList */ = { isa = PBXGroup; children = ( @@ -12223,6 +13381,21 @@ path = View; sourceTree = ""; }; + B320B465EE16F566DDFE5D8C /* ReferendumVoteConfirm */ = { + isa = PBXGroup; + children = ( + 845AADA42903B30400B5AE96 /* Model */, + DE767858B6CF5F6F7C7B418E /* ReferendumVoteConfirmProtocols.swift */, + 3C784EDFB9227884E30FBE6E /* ReferendumVoteConfirmWireframe.swift */, + CDB47990BC7A594E663DAC00 /* ReferendumVoteConfirmPresenter.swift */, + DD1A35F4D82F97C9663F1CD4 /* ReferendumVoteConfirmInteractor.swift */, + 4E2C32A42B0084AFF2911F6E /* ReferendumVoteConfirmViewController.swift */, + 3531B386DEF40108C34E7232 /* ReferendumVoteConfirmViewLayout.swift */, + AD1CAB4467C76E4139ECB1B7 /* ReferendumVoteConfirmViewFactory.swift */, + ); + path = ReferendumVoteConfirm; + sourceTree = ""; + }; B492B5426CD384887F1B351D /* DAppSearch */ = { isa = PBXGroup; children = ( @@ -12239,6 +13412,22 @@ path = DAppSearch; sourceTree = ""; }; + B4F0332763AFF64A3793C679 /* ReferendumDetails */ = { + isa = PBXGroup; + children = ( + 888A3B6328F73B9200E15BD2 /* View */, + 8469D5A328F5817C0074FEE3 /* Model */, + C3ABAD23C0039AFA8351C650 /* ReferendumDetailsProtocols.swift */, + 5E2EB9EE4A87BD4A74040784 /* ReferendumDetailsWireframe.swift */, + 78536852751EF56F58C5691E /* ReferendumDetailsPresenter.swift */, + D5AC65A04352405327BFE946 /* ReferendumDetailsInteractor.swift */, + B727587201B9D6F91A28428A /* ReferendumDetailsViewController.swift */, + A1565588CB7E044C02B091FB /* ReferendumDetailsViewLayout.swift */, + 9F2F90150AD2DD3CDF7F4EDA /* ReferendumDetailsViewFactory.swift */, + ); + path = ReferendumDetails; + sourceTree = ""; + }; B7B0681CCE8F8F0127E8676C /* StakingMain */ = { isa = PBXGroup; children = ( @@ -12361,6 +13550,23 @@ path = NftList; sourceTree = ""; }; + CEE6BB9D4D5A0E46E857EED4 /* ReferendumVoteSetup */ = { + isa = PBXGroup; + children = ( + 84880C3E29016EFE00CADB06 /* ViewModel */, + 84F76ED4290069E900D7206C /* View */, + 8425D0DE28FE736F003B782A /* Model */, + 5159EA2661A6CBE123CCF891 /* ReferendumVoteSetupProtocols.swift */, + 55B2C456A80FA66E6F140814 /* ReferendumVoteSetupWireframe.swift */, + 5C6CCACED8D5AFA6543845B7 /* ReferendumVoteSetupPresenter.swift */, + 024B7E67C0603C53981EC394 /* ReferendumVoteSetupInteractor.swift */, + 53A058D4A585F253CBF2968D /* ReferendumVoteSetupViewController.swift */, + 6A3105383F2825940D0105D5 /* ReferendumVoteSetupViewLayout.swift */, + FF755EE09598254BB5E59CC2 /* ReferendumVoteSetupViewFactory.swift */, + ); + path = ReferendumVoteSetup; + sourceTree = ""; + }; D3537A6D35CC43956A18325B /* ParaStkSelectCollators */ = { isa = PBXGroup; children = ( @@ -13071,6 +14277,23 @@ path = ChainAddressDetails; sourceTree = ""; }; + FD4B0C614F7A70D8FB51A1C3 /* GovernanceUnlockSetup */ = { + isa = PBXGroup; + children = ( + 84770F28291F85D500852A33 /* Model */, + 847157842911367400D7D003 /* ViewModel */, + 847157812911321000D7D003 /* View */, + F4642DD5186EFA940518CCB4 /* GovernanceUnlockSetupProtocols.swift */, + 856BF961EACEB9703B2B37C7 /* GovernanceUnlockSetupWireframe.swift */, + 7B9CC114CB6B28CDC59F99CF /* GovernanceUnlockSetupPresenter.swift */, + CFA54AB88E24A2053F289D74 /* GovernanceUnlockSetupInteractor.swift */, + 2FC9F0E50317E1583EA8E345 /* GovernanceUnlockSetupViewController.swift */, + A2E14458DEC3317602A17527 /* GovernanceUnlockSetupViewLayout.swift */, + 95E4AF529B896F7E58671A74 /* GovernanceUnlockSetupViewFactory.swift */, + ); + path = GovernanceUnlockSetup; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -13113,6 +14336,8 @@ dependencies = ( ); name = novawallet; + packageProductDependencies = ( + ); productName = fearless; productReference = 849013A824A80984008F705E /* novawallet.app */; productType = "com.apple.product-type.application"; @@ -13172,6 +14397,8 @@ ru, ); mainGroup = 8490139F24A80984008F705E; + packageReferences = ( + ); productRefGroup = 849013A924A80984008F705E /* Products */; projectDirPath = ""; projectRoot = ""; @@ -13212,6 +14439,7 @@ 84D8F16724D81CB100AF43E9 /* TitleWithSubtitleTableViewCell.xib in Resources */, 84452F7625D5E2B300F47EC5 /* runtime-default.json in Resources */, 848A837F274BB03F004493DD /* PublicSans-SemiBold.otf in Resources */, + 84F1D67329069FFB0050F4E3 /* governanceDApps.json in Resources */, 8409C2662522110F0049B5C8 /* WalletAmountView.xib in Resources */, AEF5058B261EF27B0098574D /* PurchaseProviderPickerTableViewCell.xib in Resources */, 849013B524A80986008F705E /* Assets.xcassets in Resources */, @@ -13369,7 +14597,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#! /bin/sh\n# Define output file. Change \"$PROJECT_DIR/${PROJECT_NAME}Tests\" to your test's root source folder, if it's not the default name.\nOUTPUT_FILE=\"${PROJECT_NAME}Tests/Mocks/ModuleMocks.swift\"\necho \"Generated Mocks File = $OUTPUT_FILE\"\n\n# Define input directory. Change \"${PROJECT_DIR}/${PROJECT_NAME}\" to your project's root source folder, if it's not the default name.\nINPUT_DIR=\"${PROJECT_NAME}\"\necho \"Mocks Input Directory = $INPUT_DIR\"\n\n# Generate mock files, include as many input files as you'd like to create mocks for.\n\"Pods/Cuckoo/run\" generate --no-header --testable \"${PROJECT_NAME}\" \\\n--exclude \"RootPresenterFactoryProtocol, UsernameSetupViewFactoryProtocol, OnboardingMainViewFactoryProtocol, AccountCreateViewFactoryProtocol, AccountImportViewFactoryProtocol, AccountConfirmViewFactoryProtocol, PinViewFactoryProtocol, ProfileViewFactoryProtocol, AccountManagementViewFactoryProtocol, AccountInfoViewFactoryProtocol, NetworkManagementViewFactoryProtocol, NetworkInfoViewFactoryProtocol, AddConnectionViewFactoryProtocol, AccountExportPasswordViewFactoryProtocol, ExportRestoreJsonViewFactoryProtocol, ExportMnemonicViewFactoryProtocol, StakingMainViewFactoryProtocol, SelectValidatorsStartViewFactoryProtocol, SelectValidatorsConfirmViewFactoryProtocol, RecommendedValidatorListViewFactoryProtocol, SelectedValidatorListViewFactoryProtocol, CustomValidatorListViewFactoryProtocol, ValidatorInfoViewFactoryProtocol, WalletHistoryFilterViewFactoryProtocol, StakingPayoutConfirmationViewFactoryProtocol, StakingRewardDetailsViewFactoryProtocol, StakingRewardPayoutsViewFactoryProtocol, StakingPayoutConfirmViewModelFactoryProtocol, YourValidatorListViewFactoryProtocol, StakingUnbondSetupViewFactoryProtocol, StakingUnbondConfirmViewFactoryProtocol, StakingRedeemViewFactoryProtocol, StakingBondMoreViewFactoryProtocol, StakingRebondSetupViewFactoryProtocol, ValidatorListFilterViewFactoryProtocol, ValidatorSearchViewFactoryProtocol\" \\\n--output \"${OUTPUT_FILE}\" \\\n\"$INPUT_DIR/../Pods/SoraFoundation/SoraFoundation/Classes/Localization/Localizable.swift\" \\\n\"$INPUT_DIR/Common/Protocols/LoadableViewProtocol.swift\" \\\n\"$INPUT_DIR/Common/Protocols/ControllerBackedProtocol.swift\" \\\n\"$INPUT_DIR/Common/Protocols/WebPresentable.swift\" \\\n\"$INPUT_DIR/Common/Protocols/AlertPresentable.swift\" \\\n\"$INPUT_DIR/Common/Protocols/ModalAlertPresenting.swift\" \\\n\"$INPUT_DIR/Common/Protocols/SharingPresentable.swift\" \\\n\"$INPUT_DIR/Common/Protocols/AccountSelectionPresentable.swift\" \\\n\"$INPUT_DIR/Modules/Root/RootProtocol.swift\" \\\n\"$INPUT_DIR/Modules/UsernameSetup/UsernameSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/OnbordingMain/OnboardingMainProtocol.swift\" \\\n\"$INPUT_DIR/Modules/AccountCreate/AccountCreateProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AccountImport/AccountImportProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AccountConfirm/AccountConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Pincode/PinSetup/PinSetupProtocol.swift\" \\\n\"$INPUT_DIR/Modules/Settings/SettingsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AccountManagement/AccountManagementProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AccountInfo/AccountInfoProtocols.swift\" \\\n\"$INPUT_DIR/Modules/NetworkManagement/NetworkManagementProtocols.swift\" \\\n\"$INPUT_DIR/Modules/NetworkInfo/NetworkInfoProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AddConnection/AddConnectionProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Export/AccountExportPassword/AccountExportPasswordProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Export/ExportGenericView/ExportGenericProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Export/ExportMnemonic/ExportMnemonicProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Export/ExportRestoreJson/ExportRestoreJsonProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Wallet/HistoryFilter/WalletHistoryFilterProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/Operations/ValidatorOperationFactory/ValidatorOperationFactoryProtocol.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingMain/StakingMainProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingMain/Relaychain/StakingRelaychainProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/Operations/NetworkStakingInfoOperationFactory.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingPayoutConfirmation/StakingPayoutConfirmationProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRewardDetails/StakingRewardDetailsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRewardPayouts/StakingRewardPayoutsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingBalance/StakingBalanceProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingUnbondSetup/StakingUnbondSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingUnbondConfirm/StakingUnbondConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRedeem/StakingRedeemProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingBondMore/StakingBondMoreProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingBondMoreConfirmation/StakingBondMoreConfirmationProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRebondSetup/StakingRebondSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRebondConfirmation/StakingRebondConfirmationProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/ControllerAccount/ControllerAccountProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRewardDestinationSetup/StakingRewardDestSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRewardDestConfirm/StakingRewardDestConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/SelectValidatorsStart/SelectValidatorsStartProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/YourValidatorList/YourValidatorListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/ValidatorListFilter/ValidatorListFilterProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/ValidatorSearch/ValidatorSearchProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/SelectValidatorsConfirm/SelectValidatorsConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/RecommendedValidatorList/RecommendedValidatorListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/SelectedValidatorList/SelectedValidatorListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/CustomValidatorList/CustomValidatorListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/ValidatorInfo/ValidatorInfoProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Crowdloan/CrowdloanList/CrowdloanListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Crowdloan/CrowdloanContribution/CrowdloanContributionProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Crowdloan/CustomCrowdloan/CustomCrowdloanDelegate.swift\" \\\n\"$INPUT_DIR/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanProtocols.swift\" \\\n\"$INPUT_DIR/Common/ViewController/SelectionListViewController/SelectionListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AssetSelection/AssetSelectionProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/Analytics/AnalyticsRewardDetails/AnalyticsRewardDetailsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AdvancedWallet/AdvancedWalletProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppAuthConfirm/DAppAuthConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppList/DAppListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppBrowser/DAppBrowserProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppOperationConfirm/DAppOperationConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppSearch/DAppSearchProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AssetsManage/AssetsManageProtocols.swift\" \\\n\"$INPUT_DIR/Modules/OperationDetails/OperationDetailsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsProtocols.swift\" \\\n"; + shellScript = "#! /bin/sh\n# Define output file. Change \"$PROJECT_DIR/${PROJECT_NAME}Tests\" to your test's root source folder, if it's not the default name.\nOUTPUT_FILE=\"${PROJECT_NAME}Tests/Mocks/ModuleMocks.swift\"\necho \"Generated Mocks File = $OUTPUT_FILE\"\n\n# Define input directory. Change \"${PROJECT_DIR}/${PROJECT_NAME}\" to your project's root source folder, if it's not the default name.\nINPUT_DIR=\"${PROJECT_NAME}\"\necho \"Mocks Input Directory = $INPUT_DIR\"\n\n# Generate mock files, include as many input files as you'd like to create mocks for.\n\"Pods/Cuckoo/run\" generate --no-header --testable \"${PROJECT_NAME}\" \\\n--exclude \"RootPresenterFactoryProtocol, UsernameSetupViewFactoryProtocol, OnboardingMainViewFactoryProtocol, AccountCreateViewFactoryProtocol, AccountImportViewFactoryProtocol, AccountConfirmViewFactoryProtocol, PinViewFactoryProtocol, ProfileViewFactoryProtocol, AccountManagementViewFactoryProtocol, AccountInfoViewFactoryProtocol, NetworkManagementViewFactoryProtocol, NetworkInfoViewFactoryProtocol, AddConnectionViewFactoryProtocol, AccountExportPasswordViewFactoryProtocol, ExportRestoreJsonViewFactoryProtocol, ExportMnemonicViewFactoryProtocol, StakingMainViewFactoryProtocol, SelectValidatorsStartViewFactoryProtocol, SelectValidatorsConfirmViewFactoryProtocol, RecommendedValidatorListViewFactoryProtocol, SelectedValidatorListViewFactoryProtocol, CustomValidatorListViewFactoryProtocol, ValidatorInfoViewFactoryProtocol, WalletHistoryFilterViewFactoryProtocol, StakingPayoutConfirmationViewFactoryProtocol, StakingRewardDetailsViewFactoryProtocol, StakingRewardPayoutsViewFactoryProtocol, StakingPayoutConfirmViewModelFactoryProtocol, YourValidatorListViewFactoryProtocol, StakingUnbondSetupViewFactoryProtocol, StakingUnbondConfirmViewFactoryProtocol, StakingRedeemViewFactoryProtocol, StakingBondMoreViewFactoryProtocol, StakingRebondSetupViewFactoryProtocol, ValidatorListFilterViewFactoryProtocol, ValidatorSearchViewFactoryProtocol\" \\\n--output \"${OUTPUT_FILE}\" \\\n\"$INPUT_DIR/../Pods/SoraFoundation/SoraFoundation/Classes/Localization/Localizable.swift\" \\\n\"$INPUT_DIR/Common/Protocols/LoadableViewProtocol.swift\" \\\n\"$INPUT_DIR/Common/Protocols/ControllerBackedProtocol.swift\" \\\n\"$INPUT_DIR/Common/Protocols/WebPresentable.swift\" \\\n\"$INPUT_DIR/Common/Protocols/AlertPresentable.swift\" \\\n\"$INPUT_DIR/Common/Protocols/ModalAlertPresenting.swift\" \\\n\"$INPUT_DIR/Common/Protocols/SharingPresentable.swift\" \\\n\"$INPUT_DIR/Common/Protocols/AccountSelectionPresentable.swift\" \\\n\"$INPUT_DIR/Modules/Root/RootProtocol.swift\" \\\n\"$INPUT_DIR/Modules/UsernameSetup/UsernameSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/OnbordingMain/OnboardingMainProtocol.swift\" \\\n\"$INPUT_DIR/Modules/AccountCreate/AccountCreateProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AccountImport/AccountImportProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AccountConfirm/AccountConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Pincode/PinSetup/PinSetupProtocol.swift\" \\\n\"$INPUT_DIR/Modules/Settings/SettingsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AccountManagement/AccountManagementProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AccountInfo/AccountInfoProtocols.swift\" \\\n\"$INPUT_DIR/Modules/NetworkManagement/NetworkManagementProtocols.swift\" \\\n\"$INPUT_DIR/Modules/NetworkInfo/NetworkInfoProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AddConnection/AddConnectionProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Export/AccountExportPassword/AccountExportPasswordProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Export/ExportGenericView/ExportGenericProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Export/ExportMnemonic/ExportMnemonicProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Export/ExportRestoreJson/ExportRestoreJsonProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Wallet/HistoryFilter/WalletHistoryFilterProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/Operations/ValidatorOperationFactory/ValidatorOperationFactoryProtocol.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingMain/StakingMainProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingMain/Relaychain/StakingRelaychainProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/Operations/NetworkStakingInfoOperationFactory.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingPayoutConfirmation/StakingPayoutConfirmationProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRewardDetails/StakingRewardDetailsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRewardPayouts/StakingRewardPayoutsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingBalance/StakingBalanceProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingUnbondSetup/StakingUnbondSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingUnbondConfirm/StakingUnbondConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRedeem/StakingRedeemProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingBondMore/StakingBondMoreProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingBondMoreConfirmation/StakingBondMoreConfirmationProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRebondSetup/StakingRebondSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRebondConfirmation/StakingRebondConfirmationProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/ControllerAccount/ControllerAccountProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRewardDestinationSetup/StakingRewardDestSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/StakingRewardDestConfirm/StakingRewardDestConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/SelectValidatorsStart/SelectValidatorsStartProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/YourValidatorList/YourValidatorListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/ValidatorListFilter/ValidatorListFilterProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/ValidatorSearch/ValidatorSearchProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/SelectValidatorsConfirm/SelectValidatorsConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/RecommendedValidatorList/RecommendedValidatorListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/SelectedValidatorList/SelectedValidatorListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/CustomValidatorList/CustomValidatorListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/SelectValidatorsFlow/ValidatorInfo/ValidatorInfoProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Vote/Crowdloan/CrowdloanContribution/CrowdloanContributionProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Vote/Crowdloan/CustomCrowdloan/CustomCrowdloanDelegate.swift\" \\\n\"$INPUT_DIR/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanProtocols.swift\" \\\n\"$INPUT_DIR/Common/ViewController/SelectionListViewController/SelectionListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AssetSelection/AssetSelectionProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Staking/Analytics/AnalyticsRewardDetails/AnalyticsRewardDetailsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AdvancedWallet/AdvancedWalletProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppAuthConfirm/DAppAuthConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppList/DAppListProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppBrowser/DAppBrowserProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppOperationConfirm/DAppOperationConfirmProtocols.swift\" \\\n\"$INPUT_DIR/Modules/DApp/DAppSearch/DAppSearchProtocols.swift\" \\\n\"$INPUT_DIR/Modules/AssetsManage/AssetsManageProtocols.swift\" \\\n\"$INPUT_DIR/Modules/OperationDetails/OperationDetailsProtocols.swift\" \\\n\"$INPUT_DIR/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsProtocols.swift\" \\\n"; }; 842D1E8924D207D900C30A7A /* Common Mock */ = { isa = PBXShellScriptBuildPhase; @@ -13505,6 +14733,7 @@ AEE4E37225ECF83F00D6DF31 /* StakingInfoTests.swift in Sources */, E2F3E726280823CF00CF31B5 /* ETHAccountInjection.swift in Sources */, F441BE13263986BE0096B67B /* ExtrinsicServiceTests.swift in Sources */, + 843B6F4F28EEEF610086D4E0 /* Gov2OperationFactoryTests.swift in Sources */, 84FACB7125F57E4400F32ED4 /* SubstrateStorageTestFacade.swift in Sources */, 8418167728253B120007684A /* ParachainStakingCollatorsTests.swift in Sources */, 84F3B27E27F4206B00D64CF5 /* PhishingSitesSyncIntegrationTests.swift in Sources */, @@ -13512,12 +14741,14 @@ 84264EE1285B6C6700BF6D4A /* XcmTransfersSyncTests.swift in Sources */, 84BFE8A228C2420A00140F1F /* AutocompounDelegateStakeTests.swift in Sources */, F49F49A326A5C45600A25931 /* BabeEraOperationFactoryTests.swift in Sources */, + 84532D5F28E4210E00EF4ADC /* ConvictionVotesFetchTests.swift in Sources */, 84C3420F2831A67200156569 /* BlockTimeEstimationServiceTests.swift in Sources */, 84FACB6A25F5759C00F32ED4 /* AccountCreationHelper.swift in Sources */, 843E9B3827C8CAC1009C143A /* NftDownloadIntegrationTests.swift in Sources */, 844133BD2860532C00845987 /* XcmTransfersSync+Setup.swift in Sources */, 8499FE7D27BE61E000712589 /* UniquesIntegrationTests.swift in Sources */, 84216FD82827A35F00479375 /* ParaStakingRewardCalculatorTests.swift in Sources */, + 847A25C328D84A9C006AC9F5 /* ReferendumFetchTests.swift in Sources */, 84161DB627C39013005DF668 /* NftSyncIntegrationTests.swift in Sources */, 84FACB6625F56D5000F32ED4 /* CalculatorServiceTests.swift in Sources */, ); @@ -13528,19 +14759,23 @@ buildActionMask = 2147483647; files = ( 842A735B27DB1EDE006EE1EA /* OperationDetailsCommand.swift in Sources */, + 84A9ECC429129FF10094C763 /* GovernanceRemainedLockViewModel.swift in Sources */, F4C2009C2727ED1C00B0F3D0 /* SystemRemarkCall.swift in Sources */, AEF505102616769F0098574D /* InitiatedBonding.swift in Sources */, 8434C9E625403686009E4191 /* CDTransactionHistoryItem+CoreDataDecodable.swift in Sources */, + 8425D0E328FE766B003B782A /* ReferendumVoteProtocols.swift in Sources */, F462B364260C88050005AB01 /* UITableView+Reuse.swift in Sources */, 84AE7AA527D35A9800495267 /* StackTableView.swift in Sources */, 88AA0FB828B60E6A00931800 /* YourWalletsControlView.swift in Sources */, 84EE2FA9289120A100A98816 /* WalletManagePresenter.swift in Sources */, 842A737727DC7AEB006EE1EA /* NetworkViewModelFactory.swift in Sources */, 848919D726FB238E004DBAD5 /* JsonDataProviderFactory.swift in Sources */, + 88F34FD228FF045400712BDE /* BindableView.swift in Sources */, 8857E03128A6A22500260BA2 /* PriceAssetInfoFactory.swift in Sources */, 846802A3265DA5530034F9B5 /* CrowdloanContributionSetupViewModel.swift in Sources */, 849014C324AA87E4008F705E /* LocalAuthInteractor.swift in Sources */, 84BEE059255F4D5700D05EB3 /* AccountImportPreferredInfo.swift in Sources */, + 84C41F3828EDB80700DB1CD3 /* ReferendaCurve.swift in Sources */, 8490141524A92F6D008F705E /* OnboardingMainPresenter.swift in Sources */, 846449FF2567090B004EAA4B /* TriangularedView+Inspectable.swift in Sources */, 8460E11D2542011200826F55 /* DetailsTriangularedView.swift in Sources */, @@ -13613,6 +14848,7 @@ 84DA3B1224C6D29100B5E27F /* RuntimeVersion.swift in Sources */, 8476D3A127F4598D004D9A7A /* DAppBrowserPhishingDetectedState.swift in Sources */, 8445F41628C8CFEC009E61C4 /* ParaStkYieldBoostSelectionViewModel.swift in Sources */, + 84A1742428ED3CF70096F943 /* ReferendumLocal.swift in Sources */, 843C49DB24DF373000B71DDA /* AccountImportRequest.swift in Sources */, 843910C1253F36F300E3C217 /* BaseStorageChildSubscription.swift in Sources */, 84FAB0812543A7EE00319F74 /* ReceiveConfigurator.swift in Sources */, @@ -13632,6 +14868,7 @@ 84DD5F77263DFD9C00425ACF /* WarningConditionViolation.swift in Sources */, 84D2F45425EF044B008B914D /* RecommendedValidatorListViewModel.swift in Sources */, 84FD3DB52540ED0900A234E3 /* Block.swift in Sources */, + 888A3B6728F746D200E15BD2 /* ReferendumVotingStatusDetailsView.swift in Sources */, 8494D86B25247F9600614D8F /* Decimal+String.swift in Sources */, 849E17F2279191EB002D1744 /* DAppSettingsMapper.swift in Sources */, 84873B0926029CBD000A83EE /* StakingStateViewModelFactory.swift in Sources */, @@ -13649,11 +14886,13 @@ 847ABE332853333A00851218 /* StakingSharedState+Duration.swift in Sources */, 8424A8C7262EC0E50091BFB1 /* PayoutInfo.swift in Sources */, 843910C7253F56EA00E3C217 /* BaseOperation+Result.swift in Sources */, + 849D3225291CC4A500D25839 /* MarkdownParsingOperationFactory.swift in Sources */, 84D6D7FE27A7F4CD0094FC33 /* AssetListChainView.swift in Sources */, 842D1E8424D197C900C30A7A /* KeyboardAdoptable.swift in Sources */, 849DEBD425ED015C00C64C19 /* SelectValidatorsConfirmViewModel.swift in Sources */, 84CD82B8263C3249001A6F01 /* SubstrateProviderSubscriber+Default.swift in Sources */, 84EE2FAD2891213E00A98816 /* WalletManageWireframe.swift in Sources */, + 8469D5A828F683930074FEE3 /* ReferendumDetailsInteractorError.swift in Sources */, 845BB8B825E4465F00E5FCDC /* ExtrinsicService.swift in Sources */, 8482F625280C45340006C3A0 /* DisplayWalletViewModel.swift in Sources */, F4F65C2E26D8B7F7002EE838 /* FWXAxisChartLegendView.swift in Sources */, @@ -13664,7 +14903,9 @@ 847F2D4627A9DB8E00AFD476 /* MultigradientView.swift in Sources */, 842876A524AE049B00D91AD8 /* SelectableTitleListViewModel.swift in Sources */, 847C96302553426D002D288F /* ExportGenericViewModel.swift in Sources */, + 845B08012918406A005785D3 /* Gov2ActionOperationFactory.swift in Sources */, 84906FEC28AFD23B0049B57D /* LoadableStackActionCell.swift in Sources */, + 8487010A2907055900F2C0C3 /* ReferendumTimelineViewModelFactory.swift in Sources */, AEF73FB525DBA24300407D41 /* PhishingCheckExecutor.swift in Sources */, AEE5FB1826457AC1002B8FDC /* StakingRewardDestSetupViewController.swift in Sources */, 846AF8462525C93A00868F37 /* BalanceContext.swift in Sources */, @@ -13729,8 +14970,10 @@ 8428768824AE046300D91AD8 /* LanguageSelectionWireframe.swift in Sources */, 847F2D4227A96D9200AFD476 /* TokenGroupDecorationView.swift in Sources */, 849014E824AA925C008F705E /* ScrollsToTop.swift in Sources */, + 889D889528F01E5B00C4320F /* ReferendumTableViewCell.swift in Sources */, F41CEB83272FF3DD00C06154 /* CrowdloanYourContributionsVMFactory.swift in Sources */, 8490146A24A9463B008F705E /* Locale+Localization.swift in Sources */, + 84715786291136B100D7D003 /* GovernanceUnlocksViewModel.swift in Sources */, 84DD5F64263DFAB700425ACF /* ErrorConditionViolation.swift in Sources */, 8428768324AE046300D91AD8 /* LanguageSelectionViewController.swift in Sources */, 8493D3E62705994200157009 /* StakingSharedState.swift in Sources */, @@ -13752,17 +14995,22 @@ 8472979A260B3095009B86D0 /* InitBondSelectValidatorsStartWireframe.swift in Sources */, 84B73AD6279B4E0B0071AE16 /* AssetDetails.swift in Sources */, 88A5317B28B9149600AF18F5 /* UIImage+DrawableIcon.swift in Sources */, + 843461F5290E4A1C00379936 /* GovernanceUnlocksCalculator.swift in Sources */, 84C2063A28D1CA90006D0D52 /* YieldBoostCollatorSelectionFactory.swift in Sources */, + 845B08132918FF98005785D3 /* Gov2UnlockReferendum.swift in Sources */, 843612BF278FE59D00DC739E /* DAppOperationConfirmInteractor+Proccessing.swift in Sources */, 842BA36F27B64F1000D31EEF /* DAppListViewModelFactory.swift in Sources */, 84C5ADE42813EBAB006D7388 /* GradientBannerView.swift in Sources */, 841E6AF625EC12100007DDFE /* PreparedNomination.swift in Sources */, 848C3D0926248A3B005481C3 /* TransferCall.swift in Sources */, 843CE3A327D1FB8A00436F4E /* NftDetailsPriceView.swift in Sources */, + 8442002D28E9ADB500C49C4A /* VoteInteractor.swift in Sources */, 84D9C8F328ADA42F007FB23B /* Data+Chunk.swift in Sources */, 8456C08227CF9DC9001282DE /* RemoteNftModel.swift in Sources */, 8401AEC42642A71D000B03E3 /* StakingRebondConfirmationWireframe.swift in Sources */, + 841221A628F13BA100715C82 /* GovernanceServiceFactory.swift in Sources */, F4F3C3CB265BB12200C58400 /* CustomValidatorListViewModelFactory.swift in Sources */, + 84E9A05028F000AB00551DC4 /* ReferendumMetadataLocal.swift in Sources */, 84821E84275F93C700ADC8D2 /* TitleMultiValueView+Style.swift in Sources */, 84DA03D12758AA6800E8B326 /* BaseAccountImportWireframe.swift in Sources */, F4C201822728678400B0F3D0 /* ExtrinsicStatus.swift in Sources */, @@ -13771,6 +15019,7 @@ AEE0C43A272A8B1F009F9AD5 /* AddChainAccount+AccountCreateWireframe.swift in Sources */, 84038FF226FFBE1900C73F3F /* JsonLocalSubscriptionHandler.swift in Sources */, 842898D1265A955A002D5D65 /* ImageViewModel.swift in Sources */, + 88F34FDB28FFE6AA00712BDE /* RequestedAmountRow.swift in Sources */, 8490145324A93FD1008F705E /* FearlessLoadingViewFactory.swift in Sources */, 8472976C260B1CAD009B86D0 /* InitiatedBondingConfirmInteractor.swift in Sources */, 84EBC55F24F71D6A00459D15 /* UITableViewCell+ReorderColor.swift in Sources */, @@ -13786,6 +15035,7 @@ 84452F9325D5EE7300F47EC5 /* DataOperationFactory.swift in Sources */, 841E5538282CF3F400C8438F /* StakingMainViewModelFactory.swift in Sources */, F43A597026D535E2005E973D /* AnalyticsPresenterBaseProtocols.swift in Sources */, + 8442003C28EAA2E400C49C4A /* ReferendumsWireframe.swift in Sources */, 844DBC6F274E702C009F8351 /* AccountImportBaseView.swift in Sources */, 8466781A27ECA021007935D3 /* PersistentExtrinsicService.swift in Sources */, 8490151824AB8C6D008F705E /* WalletCommonStyleConfigurator.swift in Sources */, @@ -13798,6 +15048,7 @@ 841493DC2604C144000D8D1A /* SubscanRewardData.swift in Sources */, 84403D7F25E91BC100494FD4 /* SuperIdentity.swift in Sources */, 8460E71A284D3AF5002896E9 /* ParaStkMinDelegationParams.swift in Sources */, + 84532D5D28E41D8500EF4ADC /* ConvictionVoting+StoragePath.swift in Sources */, 842876A824AE049B00D91AD8 /* SelectionListViewController.swift in Sources */, 84786E1A25FA6A470089DFF7 /* StashItem.swift in Sources */, 848FFE9025E6CF4300652AA5 /* StorageKeyEncodingOperation.swift in Sources */, @@ -13833,11 +15084,14 @@ 84BFFA0C288FFFA100069846 /* WalletsListViewModel.swift in Sources */, 843461CD26E2596E00DCE0CD /* WalletRemoteHistoryFiltering.swift in Sources */, 88F7716428BF6B59008C028A /* GenericMultiValueView.swift in Sources */, + 847157802910F30500D7D003 /* GovernanceUnlockInteractorError.swift in Sources */, 843612BB278FD6E000DC739E /* DAppSigningType.swift in Sources */, AE2C84D525EF989A00986716 /* ValidatorInfoWireframe.swift in Sources */, F471897626C297AA006487AD /* AnalyticsValidatorsPage.swift in Sources */, F44CD8F426242825005DDF23 /* PayoutRewardsService+Fetch.swift in Sources */, 2AD0A19525D3D3EC00312428 /* GitHubOperationFactory.swift in Sources */, + 845B07FF2916F529005785D3 /* Gov1SubscriptionFactory.swift in Sources */, + 888A3B6528F73DC300E15BD2 /* ReferendumVotingStatusView.swift in Sources */, 843E9B3627C8B915009C143A /* NftFileDownloadService.swift in Sources */, 842B17FF28649CCD0014CC57 /* CrossChainDestinationSelectionState.swift in Sources */, 84A3034926A834F900E64382 /* ValidatorInfoViewLayout.swift in Sources */, @@ -13920,12 +15174,15 @@ 84EE2FAB289120AF00A98816 /* WalletManageInteractor.swift in Sources */, 842876B424AE059700D91AD8 /* SocialMessage.swift in Sources */, 849014BC24AA87E4008F705E /* PinSetupInteractor.swift in Sources */, + 8468119728E6C90F00BF54F1 /* VoteProtocols.swift in Sources */, 844B6EC728A3B05300A8BE83 /* MessageSheetViewModel.swift in Sources */, 846CF0CD2914DC25008A96A1 /* RemoteStateCallRequest.swift in Sources */, 84EE780227C4C2A40027357F /* DAppListFeaturedHeaderView.swift in Sources */, 845BB8D125E45F1300E5FCDC /* NominateCall.swift in Sources */, 88421057289BBA8D00306F2C /* CurrencyProtocols.swift in Sources */, 842BDB28278C4CE500AB4B5A /* DAppBrowserWaitingAuthState.swift in Sources */, + 845AADA32902D1EB00B5AE96 /* StackTitleValueDiffCell.swift in Sources */, + 8487010C2907AA9B00F2C0C3 /* ReferendumMetadataViewModelFactory.swift in Sources */, 848DAF042822B7FE00D56F55 /* ParachainStakingCollatorService+Fetch.swift in Sources */, 840689FC26321F2700A017B1 /* StorageQuery.swift in Sources */, 8423ADD026B2C38600057EDD /* ImportantFlowViewFactory.swift in Sources */, @@ -13939,6 +15196,7 @@ AEE5FAFF26415E0C002B8FDC /* StakingRebondSetupPresenter.swift in Sources */, 84A3B8A02836D74B00DE2669 /* StorageKeyDecodingProtocol.swift in Sources */, 84FB9E1C285C57EF00B42FC0 /* XcmMultilocation.swift in Sources */, + 84C9CF3F291AF4B2002BF328 /* ReferendumMetadataDetailsProviderSource.swift in Sources */, 8407715E28CBE28D007DBD24 /* ParaStkYieldBoostSetupPresenter+Cancel.swift in Sources */, 8472975D260B1B71009B86D0 /* ExistingBonding.swift in Sources */, 8490144C24A93D0B008F705E /* FearlessNavigationController.swift in Sources */, @@ -13971,6 +15229,7 @@ 849A4EFA279ABC8800AB6709 /* AssetBalanceMapper.swift in Sources */, 8490147724A94A37008F705E /* RootPresenter.swift in Sources */, 8428765724ADDE0200D91AD8 /* SettingsTableViewCell.swift in Sources */, + 848CC93F28D9F90D009EB4B0 /* ReferendaDeposit.swift in Sources */, 8401AE8D2641EF7B000B03E3 /* NetworkFeeConfirmView.swift in Sources */, 841AAC2F26F73E0C00F0A25E /* LocalStorageKeyFactory.swift in Sources */, 843C49DF24DF3CB300B71DDA /* AccountImportMetadata.swift in Sources */, @@ -13981,6 +15240,7 @@ 848DE76626D642670045CD29 /* StorageMigrator.swift in Sources */, F4AE12A1268DD69B0097D1C7 /* MnemonicTextNormalizer.swift in Sources */, 8463A72525E3A82A003B8160 /* DataProviderProxyTrigger.swift in Sources */, + 84CEF28A290466A800BA25BB /* GovernanceErrorPresentable.swift in Sources */, 8460E720284D452E002896E9 /* ParaStkUnstakePresenter+ModalPicker.swift in Sources */, 847F2D4A27AA687C00AFD476 /* AssetListPresenter+Model.swift in Sources */, 847119EB262EFF3800716580 /* ValidatorPayoutInfoFactory.swift in Sources */, @@ -13991,6 +15251,7 @@ 84C74363251E4C2F009576C6 /* DummySigner.swift in Sources */, 8454C26A2632B8CE00657DAD /* BalanceDepositEvent.swift in Sources */, 84DD5F3E263DE5FF00425ACF /* DataValidationProtocols.swift in Sources */, + 88F34FD928FFE68B00712BDE /* YourVoteRow.swift in Sources */, 84D8F15F24D8179000AF43E9 /* TitleWithSubtitleViewModel.swift in Sources */, AEE5FB0126415E2A002B8FDC /* StakingRebondSetupInteractor.swift in Sources */, 84C1B98624F5424700FE5470 /* ChainAccountViewModelFactory.swift in Sources */, @@ -14013,7 +15274,9 @@ 8446F5F6281916D300B7A86C /* StakingRewardsHeaderCell.swift in Sources */, 84CA68D126BE99ED003B9453 /* RuntimeProviderFactory.swift in Sources */, 848F8B1928635A5600204BC4 /* TransferSetupPresenter.swift in Sources */, + 841221A028F051EE00715C82 /* GovMetadataLocalStorageSubscriber.swift in Sources */, 84100F3626A6069200A5054E /* IconTitleValueView.swift in Sources */, + 88B560BC28F80DCB00A5EB59 /* VoteRowView.swift in Sources */, 842876AB24AE049B00D91AD8 /* SelectionItemViewProtocol.swift in Sources */, 8472C5AF265CF9C500E2481B /* StakingRewardDestConfirmViewLayout.swift in Sources */, 84796080283B63240084E779 /* LoadableActionView.swift in Sources */, @@ -14036,8 +15299,12 @@ AE7129B4260872ED000AA3F5 /* EraStakersInfoChanged.swift in Sources */, 842D1E9624D2DD6700C30A7A /* MnemonicDisplayView.swift in Sources */, 8411707A285B10F5006F4DFB /* XcmAssetTransferFee.swift in Sources */, + 845B07F729162AB3005785D3 /* Democracy+ConstantPath.swift in Sources */, 84DBEA56265ED62700FDF73C /* BaseErrorPresentable.swift in Sources */, + 845B811928F43D4C0040CE84 /* Treasury+CodingPath.swift in Sources */, 842876B224AE059700D91AD8 /* SupportData.swift in Sources */, + 84D8754228EB5D66004065BD /* ChainBalanceViewModel.swift in Sources */, + 84F1D66B29051A730050F4E3 /* ReferendumLockReuseViewModel.swift in Sources */, 84893C0524DA8663008F6A3F /* AccountCreationError.swift in Sources */, 84282FBD26D05A54002CA322 /* ChainRegistryFacade.swift in Sources */, 842EBB3B2890B06500B952D8 /* WalletSelectionPresenter.swift in Sources */, @@ -14072,6 +15339,7 @@ 841AAC2526F692EF00F0A25E /* AddressConversion.swift in Sources */, 846F758927B5584100536547 /* EthereumRpcResponse.swift in Sources */, 8490147624A94A37008F705E /* RootInteractor.swift in Sources */, + 845B811B28F445E90040CE84 /* Treasury+Calls.swift in Sources */, 846F757E27B53F5100536547 /* DAppMetamaskSigningState.swift in Sources */, 849E17E0279094E7002D1744 /* DAppSearchHeaderView.swift in Sources */, F40966CE26B297D6008CD244 /* AnalyticsStakeProtocols.swift in Sources */, @@ -14083,6 +15351,7 @@ 8490149924AA7892008F705E /* SharingPresentable.swift in Sources */, 84754C9C2513B26000854599 /* AccountPickerTableViewCell.swift in Sources */, 8472C5B1265CF9C500E2481B /* StakingRewardDestConfirmViewFactory.swift in Sources */, + 84532D6128E4234700EF4ADC /* ConvictionVotingForKey.swift in Sources */, F4488CF226143E0000AEE6DB /* EraRewardPoints.swift in Sources */, 849DF02F26C53DB900B702F4 /* RuntimeSyncEvents.swift in Sources */, 84265E042523D20A005EEE2D /* WalletBaseAmountView.swift in Sources */, @@ -14095,6 +15364,7 @@ 8444D1BE2671465A00AF6D8C /* CrowdloanBonusServiceError.swift in Sources */, 8448F7A22882ABF50080CEA9 /* CustomSearchView.swift in Sources */, 84D2F1AF2774CEF00040C680 /* DAppURLBarView.swift in Sources */, + 849D3223291CC43D00D25839 /* MarkdownText.swift in Sources */, 84FFE45B2862076F002432BB /* XcmUnweightedTransferRequest.swift in Sources */, 84D1110C26B922D50016D962 /* ConnectionPool.swift in Sources */, 8490152E24ABD0F5008F705E /* Logger+Wallet.swift in Sources */, @@ -14113,7 +15383,8 @@ 8446F5FA28192FF500B7A86C /* ListLoadingView.swift in Sources */, 844384AC28538D3000611CE2 /* RewardCalculatorEngine.swift in Sources */, 84DBEA5E265EDAD300FDF73C /* BaseDataValidatorFactory.swift in Sources */, - F4F69E282731B0B200214542 /* CrowdloanTableHeaderView.swift in Sources */, + 84B6349F28F5575900503306 /* PreimageRequestStatus.swift in Sources */, + F4F69E282731B0B200214542 /* VoteTableHeaderView.swift in Sources */, 8428768624AE046300D91AD8 /* LanguageSelectionPresenter.swift in Sources */, 8490152724ABCC40008F705E /* NumberFormatter.swift in Sources */, 846A2C4325271CDE00731018 /* TransactionType.swift in Sources */, @@ -14145,6 +15416,8 @@ 84873B0426029B75000A83EE /* StakingEstimationViewModel.swift in Sources */, AE6F7FE32685E812002BBC3E /* ValidatorListFilterViewLayout.swift in Sources */, 847A6C0928817DC700477F77 /* AssetListBaseInteractorProtocol.swift in Sources */, + 84CEF28C290509D600BA25BB /* GovernanceVoteValidatingParams.swift in Sources */, + 8425D0EA28FE9A45003B782A /* GovernanceExtrinsicFactoryProtocol.swift in Sources */, 84E25BEE27E8895400290BF1 /* TransferErrorPresentable.swift in Sources */, 84038FF026FFBE0600C73F3F /* JsonLocalStorageSubscriber.swift in Sources */, 84BEE0F02562897100D05EB3 /* AccountImportJsonFactory.swift in Sources */, @@ -14170,6 +15443,7 @@ 8463A72D25E3A8E1003B8160 /* ChainStorageDecodedItem.swift in Sources */, 84DD5F30263D84F300425ACF /* RuntimeConstantFetching.swift in Sources */, 84B64E412704569D00914E88 /* StakingLocalSubscriptionHandler.swift in Sources */, + 847A25C828D84C0A006AC9F5 /* Referenda+CodingPath.swift in Sources */, 880855F428D09A26004255E7 /* RemoteCrowdloanContribution.swift in Sources */, 848FFE9525E6DF2200652AA5 /* PagedKeysRequest.swift in Sources */, 8428766B24ADF51D00D91AD8 /* UIViewController+Modal.swift in Sources */, @@ -14182,7 +15456,9 @@ 848E6BDB2761E0E100C91022 /* StakingRewardViewModel.swift in Sources */, 84333BDB285772F300C76A4F /* UInt64+TimeInterval.swift in Sources */, 847999AD2888646000D1BAD2 /* WatchOnlyWalletOperationFactory.swift in Sources */, + 8427495128FEB6E500B2B70B /* GovernanceLockState.swift in Sources */, 8472C5B4265CF9C500E2481B /* StakingRewardDestConfirmPresenter.swift in Sources */, + 880059DC28EF092F00E87B9B /* SegmentedSliderView.swift in Sources */, 8402CC9C275B92AC00E5BF30 /* ControlView.swift in Sources */, 2AB7A7FF25CD0E8000767D87 /* GitHubPhishingAPIService.swift in Sources */, AEF507F72625A3280098574D /* ValidatorState+Status.swift in Sources */, @@ -14194,6 +15470,7 @@ 8887813E28B7AA3100E7290F /* RoundedIconTitleCollectionHeaderView.swift in Sources */, 88C017E628C60A65003B2D28 /* AssetLockMapper.swift in Sources */, AEA2C1BA2681E9C50069492E /* ValidatorSearchInteractor.swift in Sources */, + 8824D42629032B410022D778 /* BlurredView.swift in Sources */, 84585A2F251BFC8400390F7A /* TriangularedButton+Style.swift in Sources */, 84C6801A24D75E2A00006BF5 /* BorderedSubtitleActionView+Inspectable.swift in Sources */, 84FACCD425F8B07B00F32ED4 /* ReceiveAccountViewModel.swift in Sources */, @@ -14208,6 +15485,7 @@ F4223F102732D445003D8E4E /* AcalaStatementData.swift in Sources */, 847DD8DC26034B99003DE053 /* LocalizableViewProtocol.swift in Sources */, F4CE0F9527343E630094CD8A /* AcalaContributionConfirmPresenter.swift in Sources */, + 849D3227291CE25E00D25839 /* MarkdownViewContainer.swift in Sources */, 847297CF260B4035009B86D0 /* ChangeTargetConfirmInteractor.swift in Sources */, 8428768724AE046300D91AD8 /* LanguageSelectionViewFactory.swift in Sources */, 84FB9E26285C6C5000B42FC0 /* XcmVersionedMultiasset.swift in Sources */, @@ -14231,6 +15509,8 @@ 8436EDE225895804004D9E97 /* RampProvider.swift in Sources */, 849013AC24A80984008F705E /* AppDelegate.swift in Sources */, 8476D39D27F44E73004D9A7A /* PhishingSiteVerifier+Init.swift in Sources */, + 8442002028E6FDBE00C49C4A /* CrowdloanListViewManager.swift in Sources */, + 8471577B2910F0AF00D7D003 /* GovernanceUnlockInteractor.swift in Sources */, 84CE69E82566750D00559427 /* ByteLengthProcessor.swift in Sources */, 8494D87A2525350000614D8F /* SubscanStatusData.swift in Sources */, 8499FEDA27BFDB8C00712589 /* NFTStreamableSource.swift in Sources */, @@ -14253,11 +15533,13 @@ 88C7165A28C8D3450015D1E9 /* LocksHeaderView.swift in Sources */, 840B3D6E289A56BA00DA1DA9 /* ParitySignerScanWireframe.swift in Sources */, F48EB5462722BB7000AE15ED /* AcalaBonusService.swift in Sources */, + 845B07ED291594E1005785D3 /* DemocracyReferendum.swift in Sources */, 84466B4028B77B4500FA1E0D /* SignatureVerificationWrapper.swift in Sources */, 844DBC62274D1E29009F8351 /* SecretTypeTableViewCell.swift in Sources */, 847297A2260B3146009B86D0 /* ChangeTargetsSelectValidatorsStartWireframe.swift in Sources */, 849D755B2756910A007726C3 /* RoundedView+Style.swift in Sources */, 84038FEC26FFBA4D00C73F3F /* PriceLocalStorageSubscriber.swift in Sources */, + 841221A428F0A3F200715C82 /* ReferendumAccountVoteLocal.swift in Sources */, 8473D4082657E9AD00B394B2 /* CrowdloanLastContribution.swift in Sources */, 841E5557282E531600C8438F /* ParaStkNetworkInfoOperationFactory.swift in Sources */, 84A2C90224E07E440020D3B7 /* CryptoType+Utils.swift in Sources */, @@ -14269,6 +15551,7 @@ AEA0C8BA268113F900F9666F /* YourValidatorList+RecommendedList.swift in Sources */, 88421056289BBA8D00306F2C /* CurrencyPresenter.swift in Sources */, 84D33996262250B800130A89 /* String+Substrate.swift in Sources */, + 8442003428E9BD3200C49C4A /* VoteChildPresenterFactory.swift in Sources */, 843CE3A827D20A8700436F4E /* NftDetailsCollection.swift in Sources */, 841816792825A20E0007684A /* ParaStakingRewardCalculatorService.swift in Sources */, 849014FF24AB69A4008F705E /* WalletContextFactory.swift in Sources */, @@ -14281,6 +15564,7 @@ AE2C32DC271D90DD00D57C91 /* MetaAccountOperationFactory.swift in Sources */, 84D8F16F24D8451F00AF43E9 /* CryptoType+ViewModel.swift in Sources */, AEBE16E6262EA7C100DF257C /* StakingErrors.swift in Sources */, + 848CC93B28D9F6A5009EB4B0 /* OnChainScheduler.swift in Sources */, AEAC68F526E9F93B00346599 /* CoingeckoDefinitions.swift in Sources */, 8410DBCB26EA31DE00FE1738 /* AccountProviderFactory.swift in Sources */, 841E554F282E2C0300C8438F /* StakingParachainInteractor+InputProtocol.swift in Sources */, @@ -14288,6 +15572,7 @@ 84DB9E902640A48E00F23DD3 /* StakingRedeemViewModel.swift in Sources */, 84D8F16124D8193200AF43E9 /* IconWithTitleTableViewCell.swift in Sources */, 844ADE7E28CB351500EE29F7 /* AutomationTimeAutocompound.swift in Sources */, + 84C41F3628EDADE000DB1CD3 /* ReferendaTrackInfo.swift in Sources */, AEF507F226259DF00098574D /* ValidationViewModel.swift in Sources */, 847F2D4827A9DDC700AFD476 /* MultigradientView+Default.swift in Sources */, 8448F7A6288314250080CEA9 /* AssetListAssetsViewModelFactory.swift in Sources */, @@ -14298,6 +15583,7 @@ 8831F10028C65B95009F7682 /* AssetLock.swift in Sources */, 842B1806286506EE0014CC57 /* CrossChainTransferSetupProtocols.swift in Sources */, 84D1F2FB260F51770077DDFE /* SwitchAccount.swift in Sources */, + 84E0EE08292D3C2D008B2953 /* GovernanceAssetSelectionProtocols.swift in Sources */, 84466B3C28B7680300FA1E0D /* LedgerDiscoverInteractor.swift in Sources */, 843CE3AA27D22B5200436F4E /* UniquesDetailsInteractor.swift in Sources */, 8428765D24ADDE0200D91AD8 /* SettingsInteractor.swift in Sources */, @@ -14312,6 +15598,7 @@ F471897B26C29A78006487AD /* AnalyticsValidatorsPageSelector.swift in Sources */, 8482F63128101FB10006C3A0 /* DAppEthereumSignBytesInteractor.swift in Sources */, 8487583527F06AF300495306 /* QRScannerProtocols.swift in Sources */, + 882808C829009CA500AE8089 /* DotsView.swift in Sources */, 8860F3E8289D7CF400C0BF86 /* Atomic.swift in Sources */, 8499FECF27BFA25100712589 /* NftType.swift in Sources */, F40966C226B297D6008CD244 /* AnalyticsPeriod.swift in Sources */, @@ -14331,6 +15618,7 @@ 8497FC6026317783002FEAA7 /* AccountInfoViewModel.swift in Sources */, 84DEE7042797FBF800B9A39E /* ExtrinsicExtension.swift in Sources */, 84B73AD4279B4D570071AE16 /* AssetAccount.swift in Sources */, + 880059DF28EF09E100E87B9B /* GovernanceStyle.swift in Sources */, 84DC3CE7279679230038E2ED /* SubqueryHistory+Wallet.swift in Sources */, 846A835828B8BC7B00D92892 /* LedgerTxConfirmViewController.swift in Sources */, 84BA1F7E27CE23C1000AAB82 /* NftChainModel.swift in Sources */, @@ -14355,6 +15643,7 @@ 84CD82AE263C1452001A6F01 /* SubstrateProviderSubscriber.swift in Sources */, AE6F7FE62685F2C3002BBC3E /* ValidatorListFilterViewModel.swift in Sources */, F40966F626B299FC008CD244 /* SubqueryStakeSource.swift in Sources */, + 8442002B28E9ACDB00C49C4A /* VotePresenter.swift in Sources */, 84FB1F652526879200E0242B /* WalletSingleProviderIdFactory.swift in Sources */, 84EFB78F28AB897D003B8396 /* LedgerResponse.swift in Sources */, F429C3CC272940A2000214EE /* MoonbeamVerifyRemarkRequest.swift in Sources */, @@ -14365,6 +15654,7 @@ 84FA7C1C284F8EB400B648E1 /* PendingExtrinsicInteracting.swift in Sources */, 84BC7043289EEF85008A9758 /* NoSigningSupportWrapper.swift in Sources */, 8460E12925422C5A00826F55 /* WalletCompoundDetailsViewModel.swift in Sources */, + 88A95FA828FAA99D00BE26F3 /* ReferendumDAppView.swift in Sources */, AEA0C8BE2681141700F9666F /* YourValidatorList+SelectedList.swift in Sources */, F466AA90273D188600D14021 /* SettingsRow.swift in Sources */, 8430AAE926022F69005B1066 /* StashState.swift in Sources */, @@ -14393,6 +15683,7 @@ 8479607E283B60AA0084E779 /* ActionLoadingView.swift in Sources */, 84466B3A28B7653E00FA1E0D /* LedgerPerformOperationProtocols.swift in Sources */, 8430AB1726023D2D005B1066 /* BaseStashNextState.swift in Sources */, + 84A6AB64290B021E001B57B2 /* CopyPresentable.swift in Sources */, 841AAC2126F6860B00F0A25E /* AssetBalanceFormatterFactory.swift in Sources */, 8418167528251BBC0007684A /* StorageListSyncResult.swift in Sources */, 88D997B028ABC8C0006135A5 /* BlurredTableViewCell.swift in Sources */, @@ -14459,14 +15750,18 @@ 842A738427DDF55A006EE1EA /* OperationIdOptionsPresentable.swift in Sources */, 849013E224A9288B008F705E /* Language.swift in Sources */, 840D92A1278D8D6F0007B979 /* DAppBrowserStateError.swift in Sources */, + 849707A128F3E0AC00DD0A02 /* ReferendumVoterLocal.swift in Sources */, 84754C882510BAFE00854599 /* ModalAlertFactory.swift in Sources */, 8430AACC2602249B005B1066 /* InitialStakingState.swift in Sources */, 84EE2FA52891205500A98816 /* WalletManageViewController.swift in Sources */, 84786DA825F9F58E0089DFF7 /* EraValidatorService+Fetch.swift in Sources */, 84ACEBFF261E6C7C00AAE665 /* WalletHistoryFilterViewLayout.swift in Sources */, 846A835F28B8D94300D92892 /* MessageSheetNoContentView.swift in Sources */, + 845B811F28F451A40040CE84 /* GovernanceActionOperationFactory.swift in Sources */, 84754CA22513DB8800854599 /* EmptyAccountIcon.swift in Sources */, + 8824D424290324260022D778 /* PrettyPrintedJSONOperationFactory.swift in Sources */, AEA0C8C6268131C500F9666F /* InitiatedBondingSelectedValidatorsListWireframe.swift in Sources */, + 880059E328EF128000E87B9B /* ReferendumInfoView.swift in Sources */, 84CE69922565244700559427 /* WalletAccountOpenCommand.swift in Sources */, 84F2FEFA25E797E8008338D5 /* StorageRequestFactory.swift in Sources */, 8468B87424F63D4B00B76BC6 /* AddAccount+AccountConfirmWireframe.swift in Sources */, @@ -14489,12 +15784,14 @@ 84744953289268770042FD80 /* WalletSwitchViewModel.swift in Sources */, 84FACCD925F8C22A00F32ED4 /* BigInt+Hex.swift in Sources */, F409672626B29B04008CD244 /* UIScrollView+ScrollToPage.swift in Sources */, + 84E0EE0E292D69A9008B2953 /* CallMetadata+TypeCheck.swift in Sources */, 844384AE28538F4700611CE2 /* UniformCurveRewardEngine.swift in Sources */, 846A2C4525271F0100731018 /* DateFormatter.swift in Sources */, F4F65C3326D8B81A002EE838 /* FWChartViewProtocol.swift in Sources */, 8441007C28A3CD5900DCCA11 /* ParitySignerScanInteractor.swift in Sources */, 84DA03D427592FAA00E8B326 /* ChainAccountView.swift in Sources */, 842B18082865923B0014CC57 /* XcmExtrinsicFeeProxy.swift in Sources */, + 889D889728F022AA00C4320F /* UILabel+Style.swift in Sources */, 843612C72790032400DC739E /* DAppOperationProcessedResult.swift in Sources */, 84DED410266659EC00A153BB /* CustomCrowdloanDelegate.swift in Sources */, 8418E7202617602000DCF6C8 /* WalletRemoteHistoryProtocols.swift in Sources */, @@ -14505,6 +15802,7 @@ 848F8B222863BD1000204BC4 /* TransferSetupInputState.swift in Sources */, 84113B6C255B2835009BD21A /* AccountCreateError.swift in Sources */, 849014C024AA87E4008F705E /* ScreenAuthorizationPresenter.swift in Sources */, + 84A1742928ED625D0096F943 /* Gov2OperationFactory.swift in Sources */, 84EC2D1D276C684D009B0BE1 /* PolkadotExtensionSignerResult.swift in Sources */, 84F5105B263AB9F2005D15AE /* NetworkFeeView.swift in Sources */, 84786E2425FBA2A50089DFF7 /* StakingAccountSubscription.swift in Sources */, @@ -14529,6 +15827,7 @@ 846AF8402525B94D00868F37 /* WalletNetworkFacade+Protocol.swift in Sources */, F40966FF26B29A58008CD244 /* FWBarChartView.swift in Sources */, 8468B86C24F63CEF00B76BC6 /* AddAccount+AccountConfirmInteractor.swift in Sources */, + 887A717C28FEF03E00B13C7E /* BaselinedView.swift in Sources */, 84BD388D28A25CB800A9918E /* UILabel+ExpirationTimer.swift in Sources */, 841E554D282DAA8000C8438F /* ParachainStakingServiceFactory.swift in Sources */, F43A597B26D53775005E973D /* AnalyticsBaseViewController.swift in Sources */, @@ -14539,6 +15838,7 @@ 849014DE24AA8F60008F705E /* MainTabBarInteractor.swift in Sources */, 849ABE7226280F3800011A2A /* ControllersReducer.swift in Sources */, 84F30EE425FFAC0800039D09 /* StreamableProviderOptions+Substrate.swift in Sources */, + 845B811228F429BB0040CE84 /* SupportPallet.swift in Sources */, 8470D6D4253E35F0009E9A5D /* StorageUpdate.swift in Sources */, 8460E715284AC0AA002896E9 /* ParaStkBaseUnstakeInteractor.swift in Sources */, 84C2F27D25E297350050A4AD /* CalculatedReward.swift in Sources */, @@ -14560,6 +15860,7 @@ 8448221826B1624E007F4492 /* SelectValidatorsConfirmViewLayout.swift in Sources */, 8490145624A9404E008F705E /* AttributedStringDecorator.swift in Sources */, D9046DBC27453D5C00C29F2E /* ParallelContributionResponse.swift in Sources */, + 8455AB4528F7F05400974E88 /* ReferendumStatusViewModelFactory.swift in Sources */, 8499FED227BFA39300712589 /* DataChangesDiffCalculator.swift in Sources */, 887AFC8C28BCB314002A0422 /* PolkadotIconDetailsView.swift in Sources */, 84CEAAF526D7ADF20021B881 /* KeystoreMigrator.swift in Sources */, @@ -14572,6 +15873,7 @@ 84D8F15D24D8178000AF43E9 /* IconWithTitleViewModel.swift in Sources */, 844DB61F262D9C070025A8F0 /* ChainHistoryRange.swift in Sources */, 842A737127DB7EF1006EE1EA /* OperationSlashViewModel.swift in Sources */, + 84F1D66F29066F740050F4E3 /* ReferendumVotesViewModel.swift in Sources */, 84C5ADE22813E8C1006D7388 /* GradientBannerInfoView.swift in Sources */, 8490142C24A935FE008F705E /* ErrorPresentable.swift in Sources */, 84DF21A5253473B0005454AE /* ModalInfoFactory.swift in Sources */, @@ -14582,7 +15884,9 @@ 849AFEB326DADC1300B65924 /* SubqueryHistory.swift in Sources */, 846A683027469BD500D1A47A /* CrowdloanOffchainProviderFactory.swift in Sources */, 84C11F1C2842B869007F7C05 /* ParaStkCollatorFiltersViewModel.swift in Sources */, + 840302E0292CE4030013F356 /* CodingFactory+TypeCheck.swift in Sources */, AEE5FB1626457AA9002B8FDC /* StakingRewardDestSetupPresenter.swift in Sources */, + 88107D5F290133F8001AB0B0 /* RoundedView+Styles.swift in Sources */, 8468B86E24F63D1400B76BC6 /* AddAccount+OnboardingMainWireframe.swift in Sources */, 84729741260A9C13009B86D0 /* DisplayAddress.swift in Sources */, 8499FEE027C0AE3200712589 /* KnownChainIds.swift in Sources */, @@ -14616,6 +15920,7 @@ 84F43BAA25DEB75000AEDA56 /* StakingMainViewModel.swift in Sources */, 84DD5F35263D86EF00425ACF /* AccountFetching.swift in Sources */, 84E172D128BF383B00DC85B6 /* Array+Dictionary.swift in Sources */, + 84D8754028EB1A59004065BD /* ReferendumsInteractorError.swift in Sources */, 849AFEB726DBC0BE00B65924 /* AssetTransactionData+HistoryItemData.swift in Sources */, 849014A624AA801B008F705E /* TextSharingSource.swift in Sources */, 840AD5FC26B4512100E09D6A /* SelectedLanguageMigrator.swift in Sources */, @@ -14644,12 +15949,14 @@ 8407715C28CBE25B007DBD24 /* ParaStkYieldBoostSetupPresenter+Schedule.swift in Sources */, 848CCB482832EF4400A1FD00 /* GeneralLocalStorageHandler.swift in Sources */, 849013D024A9267F008F705E /* R.generated.swift in Sources */, + 8442003828EAA16600C49C4A /* ReferendumsPresenter.swift in Sources */, 84FB9E22285C5D6200B42FC0 /* XcmNetworkId.swift in Sources */, 84DC3CE52796768A0038E2ED /* SubqueryHistoryContext.swift in Sources */, 848077D22837CAE5003B7C79 /* ParachainStakingErrorPresentable.swift in Sources */, 84F4387025D9BC3900AEDA56 /* EmptyStreamableSource.swift in Sources */, 842A736F27DB7E57006EE1EA /* OperationExtrinsicViewModel.swift in Sources */, - 8498430326592D29006BBB9F /* CrowdloanStatusSectionView.swift in Sources */, + 8483B15D28FA79620048B295 /* ReferendumDisplayStringFactory.swift in Sources */, + 8498430326592D29006BBB9F /* VoteStatusSectionView.swift in Sources */, 840D891D26242AE500AB231B /* StorageRequest.swift in Sources */, 8401AEC82642A71D000B03E3 /* StakingRebondConfirmationProtocols.swift in Sources */, 849014BA24AA87E4008F705E /* PinSetupProtocol.swift in Sources */, @@ -14667,6 +15974,7 @@ 846FB02C28C74F9700CA5444 /* ParaStkYieldBoostState.swift in Sources */, 844B2E7C27C426A7000CC079 /* NftLocalSubscriptionHandler.swift in Sources */, 8487584B27F1834E00495306 /* ImageGalleryPresentable.swift in Sources */, + 8427495328FEB8C800B2B70B /* ReferendumNewVote.swift in Sources */, AE20602C2636EA5800357578 /* MoonPayKeys.swift in Sources */, 840B3D70289A575A00DA1DA9 /* ParitySignerScanProtocols.swift in Sources */, 8452585327ABCA07004F9082 /* HideZeroBalancesChanged.swift in Sources */, @@ -14682,6 +15990,7 @@ 84FF267C28494B13003EC78D /* ParaStkStakeSetupPresenter+StartStaking.swift in Sources */, 842BDB2A278C4F3C00AB4B5A /* DAppBrowserAuthorizingState.swift in Sources */, 84FEADF228783F55001DFC26 /* BaseParaStakingRewardCalculatoService.swift in Sources */, + 848CC93D28D9F6D8009EB4B0 /* OnChainDispatchTime.swift in Sources */, 841E5534282CD9A900C8438F /* StakingType.swift in Sources */, 84CFBC6528756CCB00E93EDA /* EthereumError+Presentable.swift in Sources */, 847C966325536455002D288F /* ExportRestoreJsonViewFactory.swift in Sources */, @@ -14691,13 +16000,18 @@ 844AE53C2861B3BC0020ECBC /* XcmTransferService.swift in Sources */, 2A9F8D52274E4EC4003720E0 /* AccountCreateViewController.swift in Sources */, 84113B91255B2CA0009BD21A /* MainTransitionHelper.swift in Sources */, + 8483B15B28F991550048B295 /* ReferendumVotersTableViewCell.swift in Sources */, + 84B6349D28F4A06D00503306 /* Preimage.swift in Sources */, 8428768524AE046300D91AD8 /* LanguageSelectionProtocols.swift in Sources */, 2A90206E273E6CA200F2D584 /* NetworkFeeConfirmView+Protocol.swift in Sources */, AEA0C8A4267B6B1900F9666F /* SelectedValidatorListProtocols.swift in Sources */, + 84D911AA292C923D0032EF33 /* Data+Fill.swift in Sources */, F4B39C4E27326E8400BB6E10 /* AcalaContributionSetupViewController.swift in Sources */, + 84E63C1728FFC69A0093534A /* DiscreteGradientSlider.swift in Sources */, 84EC2D18276B9DBC009B0BE1 /* PolkadotExtensionAccount.swift in Sources */, 8494D8552524633300614D8F /* WalletTransferTokenView.swift in Sources */, F4E17FCF272182E800FE36D3 /* MoonbeamAgreeRemarkRequest.swift in Sources */, + 841221A228F0520300715C82 /* GovMetadataLocalStorageHandler.swift in Sources */, 84720730277C335000F593DD /* DAppListFlowLayout.swift in Sources */, AE2C84DF25EF98BA00986716 /* AnyValidatorInfoInteractor.swift in Sources */, 8490142E24A935FE008F705E /* LoadableViewProtocol.swift in Sources */, @@ -14709,6 +16023,7 @@ 8473F4B6282BE488007CC55A /* StakingRelaychainProtocols.swift in Sources */, 844D2A40281B0ED70049CF5E /* StackTableHeaderCell.swift in Sources */, 84A2A60A26B82B35000C6C6C /* ValidatorOperationFactory+Protocol.swift in Sources */, + 847A25C628D84BE2006AC9F5 /* Referenda.swift in Sources */, 88421055289BBA8D00306F2C /* CurrencyViewLayout.swift in Sources */, 845C407D2702812E00BFA50B /* StakingAccountUpdatingService.swift in Sources */, 8430D6C92801A2B500FFB6AE /* WebSocketProtocols.swift in Sources */, @@ -14738,9 +16053,12 @@ 84C2064028D1EAD2006D0D52 /* AccountAssetBalanceTrigger.swift in Sources */, 8469D5A628F5E8F20074FEE3 /* Staking.swift in Sources */, 848FFE8325E686C200652AA5 /* StorageDecodingOperation.swift in Sources */, + 8412219E28F0514400715C82 /* ReferendumsMetadataPreviewProviderSource.swift in Sources */, 8488ECDF258CE118004591CC /* PurchaseCompleted.swift in Sources */, + 840302E4292CFCF90013F356 /* AssetSelectionBasePresenter.swift in Sources */, 84AE7AA727D36E4D00495267 /* IconDetailsGenericView.swift in Sources */, 840BF22726C2C8A600E3A955 /* ChainSyncEvents.swift in Sources */, + 843461E8290BF14400379936 /* ReferendumsSorting.swift in Sources */, 843910C3253F39B100E3C217 /* WalletNetworkFacade+Storage.swift in Sources */, 84EC2D16276B92CB009B0BE1 /* DAppScriptResponse.swift in Sources */, F43A596A26D520E0005E973D /* EmptyStateViewCell.swift in Sources */, @@ -14751,8 +16069,10 @@ 84D6D7F627A7D3060094FC33 /* AssetListTotalBalanceCell.swift in Sources */, 849976CC27B3905E00B14A6C /* DAppMetamaskDeniedState.swift in Sources */, 849976B327B2430300B14A6C /* DAppMetamaskTransport.swift in Sources */, + 8425D0EC28FE9ACB003B782A /* Gov2ExtrinsicFactory.swift in Sources */, 84E1CCFA260DCBF9001E81B5 /* SwitchAccount+UsernameSetupWireframe.swift in Sources */, 8473F4BA282C012B007CC55A /* StakingRelaychainInteractor+InputProtocol.swift in Sources */, + 84E0EE0C292D402C008B2953 /* GovernanceAssetSelectionViewFactory.swift in Sources */, 848DAEFE282293DB00D56F55 /* ParachainStaking+Types.swift in Sources */, 8489A6E227FEFC730040C066 /* StakingRebondOption.swift in Sources */, 84CFF1E626526FBC00DB7CF7 /* StakingBondMoreInteractor.swift in Sources */, @@ -14760,6 +16080,7 @@ 84E172CF28BE468D00DC85B6 /* MessageSheetPresentable.swift in Sources */, 8487583727F06AF300495306 /* AddressScanDelegate.swift in Sources */, 3E480EEAF501AEB5D543506D /* UsernameSetupPresenter.swift in Sources */, + 880059DA28EF092800E87B9B /* ThumbView.swift in Sources */, 84F4387525D9C6EB00AEDA56 /* SubstrateDataProviderFactory.swift in Sources */, 841BFD6D27BA8E70000A16CE /* MetamaskSwitchChain.swift in Sources */, 84D2F1AC2774B3A00040C680 /* CustomSearchBar.swift in Sources */, @@ -14803,10 +16124,14 @@ 84963D6E26F91826003FE8E4 /* RemoteSubscriptionRequests.swift in Sources */, 849DEC5925ED756F00C64C19 /* SubstrateCallFactory.swift in Sources */, 843612BD278FE54D00DC739E /* DAppOperationConfirmInteractor+Protocol.swift in Sources */, + 84E0EE0A292D3CB4008B2953 /* GovernanceAssetSelectionWireframe.swift in Sources */, 844DBC5E274D1B13009F8351 /* IconWithTitleSubtitleTableViewCell.swift in Sources */, 84DBEA42265E80DD00FDF73C /* LearnMoreViewModel.swift in Sources */, + 888B853828ED966600AC9614 /* SkeletonableView.swift in Sources */, + 8442002928E7004B00C49C4A /* VoteViewLayout.swift in Sources */, 84DD5F21263CB6BE00425ACF /* UnbondCall.swift in Sources */, AEF50716262359DC0098574D /* WalletSelectPurchaseProviderCommand.swift in Sources */, + 8425D0E828FE8356003B782A /* ReferendumVoteInteractorError.swift in Sources */, 2AF8204F274FD2120092E3E7 /* BaseAccountCreatePresenter.swift in Sources */, 84282294289BB79300163031 /* ParitySignerSigningWrapper.swift in Sources */, 848DE76226D62AFE0045CD29 /* PersistentStoreCoordinator+Extensions.swift in Sources */, @@ -14817,6 +16142,7 @@ 84C4C2D7255D2B780045B582 /* PinChangeWireframe.swift in Sources */, 845353BB2886E3B4006C871A /* OnboardingMainViewLayout.swift in Sources */, 84FB29992639AC2300BE0FCD /* YourValidatorList+SelectionConfirm.swift in Sources */, + 84880C42290172C300CADB06 /* ReferendumLockChangeViewModelFactory.swift in Sources */, 84D17ED828053E3200F7BAFF /* DAppFavoriteMapper.swift in Sources */, 8493D0DF26FE7D7400A28008 /* ChainRepositoryFactory.swift in Sources */, 8411707C285B1214006F4DFB /* XcmTransfers.swift in Sources */, @@ -14834,6 +16160,7 @@ 846C372E26B199D10098F303 /* BabeStakingDurationFactory.swift in Sources */, 8475AE39258B958300B058F3 /* ErrorContent+Wallet.swift in Sources */, 9B4F0484B81BBF8DFA618599 /* AccountCreateViewFactory.swift in Sources */, + 845B811728F43C730040CE84 /* TreasuryProposal.swift in Sources */, 8460E718284CF124002896E9 /* ParachainStakingValidatorFactoryProtocol.swift in Sources */, 846CDECD258D212D009F3E75 /* AlertImageWithTitleView.swift in Sources */, 8419378125442FEE00CFA50C /* WalletQRCoderFactory.swift in Sources */, @@ -14853,6 +16180,7 @@ 84EBC55224F660A700459D15 /* EventProtocols.swift in Sources */, AE6F7FE02685E812002BBC3E /* ValidatorListFilterProtocols.swift in Sources */, 84C6801624D7036B00006BF5 /* SubtitleActionControl.swift in Sources */, + 8425D0F028FE9CF0003B782A /* ConvictionVoting+Call.swift in Sources */, 8461CC8726BC1F1F007460E4 /* ExtrinsicOperationFactory.swift in Sources */, 2A028D2A275688E80061CB4C /* AddChainAccount+AccountCreatePresenter.swift in Sources */, 84EFB78928AB7654003B8396 /* LedgerError.swift in Sources */, @@ -14868,8 +16196,10 @@ AE6DE7322627EA930018D5B5 /* PayoutCall.swift in Sources */, 84DD5F26263D72C400425ACF /* ExtrinsicFeeProxy.swift in Sources */, F4433D7526C16BFB0002A91E /* AnalyticsValidatorItemViewModel.swift in Sources */, + 8442003628EA9DF100C49C4A /* VoteViewFactory.swift in Sources */, 84BC7041289DBF62008A9758 /* QRDisplayView.swift in Sources */, 2AC7BC7E2731604C001D99B0 /* ChainAccountChanged.swift in Sources */, + 845B07F329159C15005785D3 /* Democracy+CodingPath.swift in Sources */, 847C96492553614F002D288F /* ExportRestoreJsonPresenter.swift in Sources */, 8463A71225E30C95003B8160 /* BalanceViewModelFactory.swift in Sources */, 84A04622277DE83E000B24DA /* DAppListErrorView.swift in Sources */, @@ -14882,6 +16212,7 @@ 4A520B7081BE2D7604B69354 /* AccountImportWireframe.swift in Sources */, 840B3D6C2899CD5A00DA1DA9 /* ParitySignerScanMatcher.swift in Sources */, F4433D5F26C166470002A91E /* AnalyticsValidatorsView.swift in Sources */, + 848CC94428D9FBDA009EB4B0 /* ConvictionVoting.swift in Sources */, 846AF8422525BDBF00868F37 /* WalletNetworkFacade+Price.swift in Sources */, 7D281FEA78E2E5F44990C184 /* AccountImportPresenter.swift in Sources */, 6C56AB4AE63AB2DC73DE98E0 /* AccountImportInteractor.swift in Sources */, @@ -14900,6 +16231,7 @@ 84C4C2F9255DB9510045B582 /* PinChangeInteractor.swift in Sources */, 8473F4B2282BD584007CC55A /* StakingRelaychainPresenter.swift in Sources */, 84CA68D726BE9E6F003B9453 /* ChainSyncService.swift in Sources */, + 88F34FE128FFEAFD00712BDE /* VotingDetailsRow.swift in Sources */, 84466B3E28B76A3E00FA1E0D /* LedgerPerformOperationPresenter.swift in Sources */, 8423B0E8251B2DAD00B8687C /* SubstrateOperationFactory.swift in Sources */, 84969732251CE71500C39524 /* WalletAssetId.swift in Sources */, @@ -14929,9 +16261,11 @@ 9DFB37659A6B911A4D54623E /* AccountConfirmInteractor.swift in Sources */, 84BAFCD626AF64CB00871E86 /* SelectValidatorsViewLayout.swift in Sources */, 84C5ADD52812745F006D7388 /* WalletAccountViewModel.swift in Sources */, + 8892284828F353A5003F8B9E /* ReferendumsModelFactory.swift in Sources */, 849A4EF2279A787200AB6709 /* AssetsUpdatingService.swift in Sources */, 84B018AC26E01A4100C75E28 /* StakingStateView.swift in Sources */, 842A737C27DCC489006EE1EA /* OperationDetailsTransferView.swift in Sources */, + 84880C4429026C3E00CADB06 /* ReferendumDelegatingLocal.swift in Sources */, 8472C5B2265CF9C500E2481B /* StakingRewardDestConfirmInteractor.swift in Sources */, 882C29AE28DC7CB4009CA4B6 /* StorageMigrating+CheckVersion.swift in Sources */, 846CA77A27099B1E0011124C /* StakingAnalyticsLocalSubscriptionFactory.swift in Sources */, @@ -14939,6 +16273,7 @@ 8466781127EB4078007935D3 /* StackNetworkFeeCell.swift in Sources */, 8D9BC9C36DC891CDD900A895 /* AccountConfirmViewController.swift in Sources */, 84222986283621F2009F0086 /* StakingRewardInfoViewModel.swift in Sources */, + 84D8754428EB5E6D004065BD /* ChainBalanceViewModelFactory.swift in Sources */, E14F809C3917EFA4B5388AC8 /* AccountConfirmViewFactory.swift in Sources */, 842A738027DCD427006EE1EA /* OperationDetailsRewardView.swift in Sources */, 9D5926790B055C56FB74B282 /* AccountManagementProtocols.swift in Sources */, @@ -14955,6 +16290,7 @@ 84754CA42513E6DC00854599 /* PrimitiveContextWrapper.swift in Sources */, 848B3000286EDE3800465BA2 /* ParaIdOperationFactory.swift in Sources */, 84F47D4B2666EF1C00F7647A /* KaruraStatementData.swift in Sources */, + 84D8753A28EB0A93004065BD /* GovernanceChainSettings.swift in Sources */, 8443FE24255586230092893D /* ExportMnemonicConfirmProtocols.swift in Sources */, 84644A0C256713D5004EAA4B /* TriangularedBlurView+Inspectable.swift in Sources */, 849A4EF6279A7AEF00AB6709 /* StateminAssetExtras.swift in Sources */, @@ -14976,8 +16312,10 @@ F4A11B5A272FEB0B0030E85B /* CrowdloanYourContributionsCell.swift in Sources */, 848E6BDF276218E600C91022 /* GlowingView.swift in Sources */, 843910B6253EE62B00E3C217 /* DataProviderChange+Result.swift in Sources */, + 84D8753D28EB17B2004065BD /* GovernanceSharedState.swift in Sources */, 8436EDE725895846004D9E97 /* PurchaseProvider.swift in Sources */, AEF50556261A04AD0098574D /* MoonpayProvider.swift in Sources */, + 880059D828EEBC0200E87B9B /* SliderView.swift in Sources */, 84FB29942639ABD700BE0FCD /* YourValidatorList+SelectionStart.swift in Sources */, 84DB9E8A26409E8200F23DD3 /* StakingRedeemLayout.swift in Sources */, 84F3B27627F4175500D64CF5 /* PhishingSite.swift in Sources */, @@ -15036,6 +16374,7 @@ 843461CF26E25AD400DCE0CD /* SubscanHistoryItem+Wallet.swift in Sources */, 882A5CED28AFCE3600D0D798 /* ReturnInIntervalsViewModel.swift in Sources */, 88C7165428C894510015D1E9 /* CollectionViewDelegate.swift in Sources */, + 840302DE292CE3EA0013F356 /* StorageEntryMetadata+TypeCheck.swift in Sources */, F458D3982642911B0055CB75 /* ControllerAccountViewModel.swift in Sources */, 84DAC198268D3DD9002D0DF4 /* SNAddressType.swift in Sources */, 84AC0B6A28C0D8CE00FA5B5D /* NoLedgerSupportCommand.swift in Sources */, @@ -15059,6 +16398,8 @@ 8436E94426C853E4003D4EA7 /* RuntimeSnapshotOperationFactory.swift in Sources */, F40966C726B297D6008CD244 /* AnalyticsRewardsViewFactory.swift in Sources */, 846AF83E2525B85100868F37 /* WalletNetworkFacade.swift in Sources */, + 84DD49F428EE91ED00B804F3 /* Gov2LocalMappingFactory.swift in Sources */, + 84E0EE04292D336C008B2953 /* GovernanceType.swift in Sources */, 8489EDBA264DB25500FF997E /* RecommendationsComposing.swift in Sources */, F41CEB88272FFCB700C06154 /* CrowdloanContributionViewModel.swift in Sources */, 8466781327EC5446007935D3 /* MultilineBalanceView.swift in Sources */, @@ -15099,6 +16440,7 @@ 8401AEC62642A71D000B03E3 /* StakingRebondConfirmationLayout.swift in Sources */, 8487584327F08F9600495306 /* AddressScanPresenter.swift in Sources */, 847F2D5127AAB4BC00AFD476 /* GradientModel.swift in Sources */, + 845B07FD291634D4005785D3 /* DemocracyDecidingFunctionProtocol.swift in Sources */, 84981CC32666D95F00C4C691 /* GradientButton+Style.swift in Sources */, 84E258A12892CC0F00DC8A51 /* AccountManagementViewLayout.swift in Sources */, 848FD1A528AE27E700CCD9E2 /* HardwareWalletOption.swift in Sources */, @@ -15113,13 +16455,16 @@ 8496ADDE276B123200306B24 /* PolkadotExtentionMessage.swift in Sources */, 84A15489262888CA0050D557 /* IdentityOperationFactory.swift in Sources */, 8473D4212657FFFB00B394B2 /* Crowdloan.swift in Sources */, + 843461F7290E4AF500379936 /* GovUnlocksCalculator.swift in Sources */, 849E17E327913220002D1744 /* DAppSearchResult.swift in Sources */, + 845B07EB29159190005785D3 /* Democracy.swift in Sources */, 844CB57626FA064700396E13 /* ChainRegistryError.swift in Sources */, 842A737327DB7F75006EE1EA /* OperationRewardViewModel.swift in Sources */, 84CA68CF26BD6872003B9453 /* RuntimeSyncService.swift in Sources */, 84EA0B2A25E579DF00AFB0DC /* AssetBalanceViewModel.swift in Sources */, 84FD3DAF2540BEA000A234E3 /* TransactionHistoryItem+Wallet.swift in Sources */, 84452F9825D6728B00F47EC5 /* RuntimeVersionSubscription.swift in Sources */, + 84880C462902781E00CADB06 /* ReferendumVotingLocal.swift in Sources */, 84CEAAF326D6ED870021B881 /* KeystoreTag.swift in Sources */, 840DCBF625E0059D00D45C6A /* AmountInputView+Inspectable.swift in Sources */, 8488ECEA258CE456004591CC /* PurchaseViewController.swift in Sources */, @@ -15128,10 +16473,12 @@ 8487583227F06AF300495306 /* AddressScanViewFactory.swift in Sources */, 849632072555CE9D00B8E316 /* ExportSeedData.swift in Sources */, 8485D924277E16C400767243 /* DAppBrowserScriptHandler.swift in Sources */, + 8427495528FEB92700B2B70B /* GovernanceLockStateFactory.swift in Sources */, 842BDB2C278C4FFE00AB4B5A /* DAppBrowserAuthorizedState.swift in Sources */, 848919DB26FB663D004DBAD5 /* CrowdloansChainViewModel.swift in Sources */, 842A736D27DB7B5E006EE1EA /* OperationTransferViewModel.swift in Sources */, 842B18022864F9950014CC57 /* CrossChainTransferPresenter.swift in Sources */, + 845B081529190056005785D3 /* Gov1UnlockReferendum.swift in Sources */, 84F3B27427F4130800D64CF5 /* PhishingSites.swift in Sources */, 8430AAF12602306A005B1066 /* BondedState.swift in Sources */, 848F8B1D2863616E00204BC4 /* ChainsStore.swift in Sources */, @@ -15159,6 +16506,7 @@ 842BDB25278C3ACB00AB4B5A /* DAppBrowserMetadataState.swift in Sources */, 64B508A1A3D820AA8DBCFAA3 /* AccountExportPasswordWireframe.swift in Sources */, F462B351260C7DBE0005AB01 /* StakingRewardHistoryTableCell.swift in Sources */, + 840302E8292D00380013F356 /* GovernanceAssetSelectionPresenter.swift in Sources */, AE89720825F12143008EC414 /* ValidatorInfoViewModel.swift in Sources */, 8499FE7327BE305100712589 /* JSONListConvertible.swift in Sources */, 845B821726EF7FED00D25C72 /* SelectedWalletSettings.swift in Sources */, @@ -15202,8 +16550,10 @@ 844CB57A26FA706C00396E13 /* ChainAssetDisplayInfo.swift in Sources */, 848DAEF7282274E700D56F55 /* ParachainStakingRemoteSubscriptionService.swift in Sources */, 845B821F26EF8E8900D25C72 /* ManagedMetaAccountModel.swift in Sources */, + 88F34FD428FFE64400712BDE /* ReferendumDAppCellView.swift in Sources */, 8430AB1226023C9F005B1066 /* PendingBondedState.swift in Sources */, 88421059289BBA8D00306F2C /* CurrencyViewFactory.swift in Sources */, + 84F76ED829006BC400D7206C /* DiscreteGradientSlider+Style.swift in Sources */, 841E6AFE25EC12DE0007DDFE /* SelectedValidatorInfo.swift in Sources */, F4E17FC52721814D00FE36D3 /* MoonbeamVerifiedResponse.swift in Sources */, 8499FECC27BF8F4A00712589 /* NftModelMapper.swift in Sources */, @@ -15216,6 +16566,7 @@ 8496ADE0276B152500306B24 /* NSDictionary+Map.swift in Sources */, 84300B2826C107AD00D64514 /* ConnectionAutobalancing.swift in Sources */, BD571417BD18C711B76E1D62 /* ExportSeedWireframe.swift in Sources */, + 88107D6129015FAB001AB0B0 /* TrackTagsView.swift in Sources */, 841816732824FD0A0007684A /* StorageListSyncService.swift in Sources */, 8463A73825E3AA47003B8160 /* AccountInfo.swift in Sources */, ABA3D873BBECB7F4BD670872 /* ExportSeedPresenter.swift in Sources */, @@ -15223,14 +16574,18 @@ 9A6A55297F41DAE45071BF57 /* ExportSeedInteractor.swift in Sources */, 886E8CF81EF2566D98D9693E /* ExportSeedViewFactory.swift in Sources */, C20ED4531583D0C8E38715E0 /* PurchaseProtocols.swift in Sources */, + 8412219B28F04EA600715C82 /* GovMetadataLocalSubscriptionFactory.swift in Sources */, 848F8B1F2863BB4000204BC4 /* TransferSetupPresenterFactory.swift in Sources */, 3CA86739CB09801714B194BD /* PurchaseWireframe.swift in Sources */, 84FB298C2639ABA500BE0FCD /* YourValidatorList.swift in Sources */, + 8453DE5B28FD32B50055345C /* StorageSubscriptionObserver.swift in Sources */, F4D6FF0E26B3DD6E002313AF /* AnalyticsRewardsProtocols.swift in Sources */, 84873AFF26028E2B000A83EE /* StakingStateMachine.swift in Sources */, + 8442002528E6FEEE00C49C4A /* ReferendumsProtocols.swift in Sources */, 3D1FB0EF87D42F08D9250552 /* PurchasePresenter.swift in Sources */, F4F22976260DBF3F00ACFDB8 /* StakingPayoutRewardTableCell.swift in Sources */, 8428229A289BC8E400163031 /* AddAccount+ParitySignerWelcomeWireframe.swift in Sources */, + 8471577D2910F18300D7D003 /* GovernanceUnlockProtocols.swift in Sources */, 2CF2F93AF862CF54FC46B560 /* PurchaseInteractor.swift in Sources */, 90EFE3768F1375470FDBE6F6 /* PurchaseViewFactory.swift in Sources */, F452D895273D22CF008F7295 /* SettingsTableHeaderView.swift in Sources */, @@ -15270,6 +16625,7 @@ 8423ADD226B2C9D000057EDD /* ImportantViewProtocol.swift in Sources */, 84A3B8A62836E08600DE2669 /* CollatorSelectionInfo.swift in Sources */, 841E5569282EAC2600C8438F /* ParachainStakingNoStakingState.swift in Sources */, + 8438432E2913B3150048595C /* Gov1OperationFactory.swift in Sources */, 84CFF1E926526FBC00DB7CF7 /* StakingBondMoreWireframe.swift in Sources */, 84D17ECE2804290700F7BAFF /* RadioSelectorView.swift in Sources */, 841E5567282EAC1000C8438F /* ParachainStakingInitState.swift in Sources */, @@ -15293,9 +16649,13 @@ 2C3124A5EBC1AD57C01EEA17 /* SelectValidatorsStartInteractor.swift in Sources */, 88A5318028B9328E00AF18F5 /* YourWalletsViewSectionModel.swift in Sources */, 842EBB312890A76A00B952D8 /* WalletSelectionViewController.swift in Sources */, + 8427495728FEBFA400B2B70B /* ConvictionVoting+ConstantPath.swift in Sources */, 84C5ADDF28133F3E006D7388 /* UnknownAddressView.swift in Sources */, 84F6B6502619E1ED0038F10D /* Int+Operations.swift in Sources */, + 8487010E2907DF2F00F2C0C3 /* MultiValueView+Styles.swift in Sources */, + 84770F2A291F864500852A33 /* GovernanceUnlockInitData.swift in Sources */, 85547F698B551ACD387D84E2 /* SelectValidatorsStartViewController.swift in Sources */, + 845B07F129159AE7005785D3 /* DemocracyVoting.swift in Sources */, 41B29C1C9239BB2DCB7903A7 /* SelectValidatorsStartViewFactory.swift in Sources */, 25381484F16FB930B8A90CE3 /* SelectValidatorsConfirmProtocols.swift in Sources */, B02EAF42C91E069FE6872EE0 /* SelectValidatorsConfirmWireframe.swift in Sources */, @@ -15310,6 +16670,7 @@ 84F3B27827F4179A00D64CF5 /* PhishingSiteMapper.swift in Sources */, 0678271BE1BA5BBC084F478A /* RecommendedValidatorListWireframe.swift in Sources */, F441BE0E263984DD0096B67B /* BondExtraCall.swift in Sources */, + 8824D42829032BF60022D778 /* ReferendumStateLocal+Presenter.swift in Sources */, 84FB9E20285C5C9E00B42FC0 /* XcmJunction.swift in Sources */, 84EBA4F027AD26A5000AEEAD /* AssetBalanceId.swift in Sources */, 8436B6DC2848998200F24360 /* StakingAccountDetailsViewModelFactory.swift in Sources */, @@ -15330,6 +16691,7 @@ AEF507AF262423FD0098574D /* HmacSigner.swift in Sources */, 3229E306230161AA99B14BDD /* StakingRewardPayoutsViewFactory.swift in Sources */, 8473D4002657E8BB00B394B2 /* CrowdloanFunds.swift in Sources */, + 845B08102918D65E005785D3 /* GovernanceExtrinsicFactory.swift in Sources */, 7E1A03082260E0D31AD394CA /* StakingRewardDetailsProtocols.swift in Sources */, 65909D701527D99837B439D9 /* StakingRewardDetailsWireframe.swift in Sources */, 84350ACC284569560031EF24 /* ParaStkCollatorInfoViewController.swift in Sources */, @@ -15340,22 +16702,26 @@ 19A29027666EB5388CBFAD61 /* StakingRewardDetailsInteractor.swift in Sources */, 846AC7EF2638D9200075F7DA /* YourValidatorTableCell.swift in Sources */, C937154FA9021AECD72A871B /* StakingRewardDetailsViewController.swift in Sources */, + 84770F27291F7CD400852A33 /* ReferendumDetailsInitData.swift in Sources */, 84E493252731C064000534F2 /* AssetListViewModel.swift in Sources */, AEA0C8B8267C905500F9666F /* SelectedValidatorCell.swift in Sources */, 8422F2EE2887E3D300C7B840 /* TextInputView.swift in Sources */, 847F2D5927AB201200AFD476 /* GradientIconView.swift in Sources */, 84EBFCEE285E82BB0006327E /* XcmExecute.swift in Sources */, 849976C627B2B73900B14A6C /* DAppMetamaskStateMachine.swift in Sources */, + 88F34FDF28FFEAE500712BDE /* TimelineRow.swift in Sources */, 847F2D4427A9822200AFD476 /* AssetIconView.swift in Sources */, 20B2942A4241F6713A1C70D9 /* StakingRewardDetailsViewFactory.swift in Sources */, 84F13F0A26F14122006725FF /* ChainAsset.swift in Sources */, 848CCB442832EE9B00A1FD00 /* GeneralStorageSubscriptionFactory.swift in Sources */, + 8483B15828F98C9F0048B295 /* ReferendumVotersViewModel.swift in Sources */, 84BB3CEE267CD6B500676FFE /* CrowdloanContributionDict.swift in Sources */, 8473F4B4282BD5A1007CC55A /* StakingRelaychainInteractor.swift in Sources */, 845B821B26EF80BC00D25C72 /* MetaAccountModel.swift in Sources */, 841E5536282CDB9E00C8438F /* StakingMainPresenterFactory+Relaychain.swift in Sources */, F409673326B29C9B008CD244 /* RewardAnalyticsWidgetViewModel.swift in Sources */, 8499FEC827BF73F400712589 /* StorageKeyFactory+Size.swift in Sources */, + 847A25CA28D85204006AC9F5 /* ReferendumInfo.swift in Sources */, 5869563D0EA593FBD02C169C /* StakingPayoutConfirmationProtocols.swift in Sources */, 846B749828B4BA0500C39B93 /* LedgerAccountsStore.swift in Sources */, 844ADE7728CA7F7100EE29F7 /* ParaStkYieldBoostSetupPresenter+ViewUpdate.swift in Sources */, @@ -15381,12 +16747,15 @@ 8487583327F06AF300495306 /* QRScannerViewLayout.swift in Sources */, 8448336727FAAF780077FB55 /* TransakProvider.swift in Sources */, 84CFF1E326526FBC00DB7CF7 /* StakingBondMoreProtocols.swift in Sources */, + 8448148128E46881007F64FF /* ConvictionVotingLocks.swift in Sources */, 5FE687B860FC10AB08518A6E /* WalletHistoryFilterPresenter.swift in Sources */, 640A79BD1335394818E70366 /* WalletHistoryFilterViewController.swift in Sources */, DD090C2ED91726FF7779F6C7 /* WalletHistoryFilterViewFactory.swift in Sources */, 84ED6BE0286900B600B3C558 /* TransferNetworkContainerViewModel.swift in Sources */, + 845B0819291905CA005785D3 /* Gov1LockStateFactory.swift in Sources */, AE6F7FE82685F2F0002BBC3E /* ValidatorListFilterViewModelFactory.swift in Sources */, 84948C38287E0B4F00E6DD3E /* FilterImageProcessor.swift in Sources */, + 849D3220291C26BA00D25839 /* GovernanceDAppList.swift in Sources */, F022F1444E0F75CCA42F4648 /* YourValidatorListProtocols.swift in Sources */, 8493D0E326FF571D00A28008 /* PriceProviderFactory.swift in Sources */, F7EB8F835CFA7FC949EF4C22 /* YourValidatorListWireframe.swift in Sources */, @@ -15394,12 +16763,15 @@ 84ED6BE428698D2E00B3C558 /* TransferCrossChainConfirmInteractor.swift in Sources */, DBA436B3B1C90965FE8F9B79 /* YourValidatorListPresenter.swift in Sources */, E7CAD629FF0D4E97594F7A05 /* YourValidatorListInteractor.swift in Sources */, + 88F34FD728FFE66E00712BDE /* FullDetailsRow.swift in Sources */, 8466780F27EB2939007935D3 /* OnChainTransferPresenter.swift in Sources */, 84466B3528B6731B00FA1E0D /* LedgerSigningWrapper.swift in Sources */, F4223ED127329767003D8E4E /* AcalaTransferRequest.swift in Sources */, 8473F4B8282BFFF8007CC55A /* StakingRelaychainInteractor+Subscription.swift in Sources */, 841E2E5027381B2A00F250C1 /* AccountInfoSubscriptionHandlingFactory.swift in Sources */, 88AC186128CA3EE100892A9B /* LocksViewLayout.swift in Sources */, + 8468119428E6234B00BF54F1 /* RoundedSegmentedControl.swift in Sources */, + 8453DE5928FD32780055345C /* NotEqualWrapper.swift in Sources */, A32E1373E3671D518FFC3BC2 /* YourValidatorListViewController.swift in Sources */, 84D2F1A927744C280040C680 /* PolkadotExtensionError.swift in Sources */, 37E1E9782B9752BC50AF2476 /* YourValidatorListViewFactory.swift in Sources */, @@ -15432,8 +16804,10 @@ 0FB6781AB0186A1ED474CAD6 /* StakingUnbondConfirmProtocols.swift in Sources */, 8401AEC52642A71D000B03E3 /* StakingRebondConfirmationViewFactory.swift in Sources */, 27FA1D57A06AA3A030D226B6 /* StakingUnbondConfirmWireframe.swift in Sources */, + 88A95FA628F8664100BE26F3 /* ReferendumTimelineView.swift in Sources */, 843A2C7326A8641400266F53 /* MultiValueView.swift in Sources */, 3FF8EE1158A273D0D50BC7A6 /* StakingUnbondConfirmPresenter.swift in Sources */, + 845B08042918C308005785D3 /* Gov1ActionOperationFactory.swift in Sources */, F0C3DB0CEE1975626B0014A8 /* StakingUnbondConfirmInteractor.swift in Sources */, 849FA21628A26CB500F83EAA /* CountdownTimerMediator.swift in Sources */, D3B48F82A875E301D749AC0B /* StakingUnbondConfirmViewController.swift in Sources */, @@ -15458,7 +16832,9 @@ 8489A6CE27FC5C5E0040C066 /* StakingActionsView.swift in Sources */, 84DED40B266656D400A153BB /* KaruraBonusService.swift in Sources */, 842A736627DB485E006EE1EA /* OperationSlashModel.swift in Sources */, + 845B07EF2915951A005785D3 /* DemocracyVoteThreshold.swift in Sources */, 885551F78A5926D16D5AF0CB /* ControllerAccountPresenter.swift in Sources */, + 8442002F28E9AEFB00C49C4A /* VoteWireframe.swift in Sources */, 841E553C282D44BA00C8438F /* ParachainStakingAccountSubscriptionService.swift in Sources */, 84300B2C26C10C9B00D64514 /* ConnectionStateReporting.swift in Sources */, 9E4E458C92D12B24D5EAD893 /* ControllerAccountInteractor.swift in Sources */, @@ -15467,6 +16843,7 @@ EB5F587A71CCE1F0F86154CF /* ControllerAccountViewFactory.swift in Sources */, 9A940CBA3F309D438945A90C /* ControllerAccountConfirmationProtocols.swift in Sources */, AE1000F226679886004753B7 /* ChangeTargetsRecommendationWireframe.swift in Sources */, + 84C9CF3B291AE328002BF328 /* PolkassemblyOperationFactory.swift in Sources */, D886425A55425810AD070AB5 /* ControllerAccountConfirmationWireframe.swift in Sources */, 84D17EDE28054CC400F7BAFF /* DAppLocalSubscriptionFactory.swift in Sources */, 84E2589F2892B5AF00DC8A51 /* WalletSwitchPresentable.swift in Sources */, @@ -15482,12 +16859,9 @@ 846CA7802709A41E0011124C /* StakingAnalyticsLocalSubscriptionHandler.swift in Sources */, 849DF02D26C40B7900B702F4 /* RuntimeFilesOperationFactory.swift in Sources */, 0B2B9C6E2BA2E924D6A54F4B /* CrowdloanListInteractor.swift in Sources */, - C083E2FC291784BF60EE73BA /* CrowdloanListViewController.swift in Sources */, - 5888936B3D13D92F1534E08B /* CrowdloanListViewLayout.swift in Sources */, 849C066F2765140B00394C82 /* AnyCancellableCleaning.swift in Sources */, 8489A6D627FDA50D0040C066 /* AccountLocalStorageSubscriber.swift in Sources */, 846F758727B5550700536547 /* EthereumRpcRequest.swift in Sources */, - 278F5341DC043EBED7C0733D /* CrowdloanListViewFactory.swift in Sources */, 7CBE9FFAF8394786CA131D4D /* CustomValidatorListProtocols.swift in Sources */, 84D9C8EF28AD97E7007FB23B /* SupportedLedgerApps.swift in Sources */, 8482F62A280C4B770006C3A0 /* DAppAuthSettingsViewModel.swift in Sources */, @@ -15499,6 +16873,7 @@ F47D328226C260CC00CF35A2 /* FWPieChartView.swift in Sources */, 84F1CB4027CF6BEF0095D523 /* UniquesClassDetails.swift in Sources */, 84FEADEE287837E8001DFC26 /* TuringRewardCalculatorService.swift in Sources */, + 845B08062918C3FB005785D3 /* DemocracyProposalCall.swift in Sources */, 78D94A761EFECED60F38232D /* CustomValidatorListViewController.swift in Sources */, 7401E7CAEEE6890BE74ACCE1 /* CustomValidatorListViewLayout.swift in Sources */, 84BFE89C28C23A2500140F1F /* AutomationTime.swift in Sources */, @@ -15530,6 +16905,7 @@ 846A2606267C792000429A7F /* CrowdloanContributionResponse.swift in Sources */, 0C2AA829B5CB89B39E0FA95E /* CrowdloanContributionConfirmProtocols.swift in Sources */, 506F0D372BCC8302E513637C /* CrowdloanContributionConfirmWireframe.swift in Sources */, + 84E0EE06292D3A58008B2953 /* AssetSelectionBaseProtocols.swift in Sources */, D1C6EABB48DC3EE254E5A095 /* CrowdloanContributionConfirmPresenter.swift in Sources */, 843A2C7126A85B5B00266F53 /* GenericTitleValueView.swift in Sources */, 847F2D4F27AA695F00AFD476 /* AssetListGroupModel.swift in Sources */, @@ -15549,6 +16925,7 @@ EB9D8D22AA13BF12F845856B /* ReferralCrowdloanProtocols.swift in Sources */, 51FC48FA6FD4D2FB1781424D /* ReferralCrowdloanWireframe.swift in Sources */, 0F3E58FC800ED8722589F89E /* ReferralCrowdloanPresenter.swift in Sources */, + 84A9ECC1291292900094C763 /* GovernanceUnlockConfirmInteractorError.swift in Sources */, 9F4A48B1BE3A1110A0CF9F36 /* ReferralCrowdloanViewController.swift in Sources */, F4B39C6B2732791900BB6E10 /* RadioButton.swift in Sources */, CE2792E78B14CE02394D8CF4 /* ReferralCrowdloanViewLayout.swift in Sources */, @@ -15586,6 +16963,7 @@ 93434E8E407A6C63D8862A21 /* AssetSelectionProtocols.swift in Sources */, 84E25BEC27E87D5400290BF1 /* TransferDataValidatorFactory.swift in Sources */, 8499FE7127BE214A00712589 /* StorageKeyDecodingOperation.swift in Sources */, + 84CEF288290462C300BA25BB /* GovernanceValidatorFactory.swift in Sources */, CDB78A5A733E4A4F1A2C48C8 /* AssetSelectionWireframe.swift in Sources */, 2FCB062A2D873BD72B795DB3 /* AssetSelectionPresenter.swift in Sources */, BEA539EE97A287868FD8BE46 /* AssetSelectionViewFactory.swift in Sources */, @@ -15598,6 +16976,7 @@ 84117074285B0E92006F4DFB /* XcmChain.swift in Sources */, 844D2A42281B24510049CF5E /* StackUrlCell.swift in Sources */, 98DADEB52480817D191188C1 /* AssetListInteractor.swift in Sources */, + 8442003A28EAA2D400C49C4A /* ReferendumsInteractor.swift in Sources */, 8448D5B6277D717400FAEEBC /* DAppListDecorationView.swift in Sources */, 84CC986B287D7BAA0085431C /* RMRKV2Collection.swift in Sources */, 844384B0285391D800611CE2 /* RewardCalculatorEngineFactory.swift in Sources */, @@ -15606,11 +16985,14 @@ 8487583C27F06AF300495306 /* QRCaptureService.swift in Sources */, 7D707DDD180999C63FD0C4ED /* AssetListViewController.swift in Sources */, 75E689BC8D16786DF2674171 /* AssetListViewLayout.swift in Sources */, + 88FAE78828FCF8E200130B47 /* ReferendumDetailsTitleView.swift in Sources */, + 8483B15328F940080048B295 /* ReferendumVotersModel.swift in Sources */, 2736BAABAE1389260A0B28D6 /* AssetListViewFactory.swift in Sources */, 88E1E896289C021F00C123A8 /* CurrencyCollectionViewCell.swift in Sources */, BE8CF97B6EA62C75277B78AA /* MoonbeamTermsProtocols.swift in Sources */, B316F0D2BDF0F44AD27F58E0 /* MoonbeamTermsWireframe.swift in Sources */, 8027EA456C0C13F6DA73D540 /* MoonbeamTermsPresenter.swift in Sources */, + 845B08082918C8DA005785D3 /* RemoteStorageSizeRequest.swift in Sources */, 8452585527ABF270004F9082 /* AssetListEmptyCell.swift in Sources */, D72773CE9AF638387DA9BA77 /* MoonbeamTermsInteractor.swift in Sources */, 2B1E63AF98584341D670FB40 /* MoonbeamTermsViewController.swift in Sources */, @@ -15618,11 +17000,14 @@ 97F1D128D46B072D68940FC4 /* MoonbeamTermsViewFactory.swift in Sources */, 84C5ADE8281428F1006D7388 /* WalletAccountInfoView.swift in Sources */, 849976BA27B24C2200B14A6C /* DAppBrowserTransportProtocol.swift in Sources */, + 8455AB4A28F80D9300974E88 /* ReferendumTrackType.swift in Sources */, 842822A0289BCAD300163031 /* AddAccount+ParitySignerScanWireframe.swift in Sources */, E04E3ABA985AA3D89AE20BF5 /* CrowdloanYourContributionsProtocols.swift in Sources */, 5E621A350A6DDD78597CC9E5 /* CrowdloanYourContributionsWireframe.swift in Sources */, 716F0819BAB14322E34E416C /* CrowdloanYourContributionsPresenter.swift in Sources */, F0675F495766D07473B065F7 /* CrowdloanYourContributionsInteractor.swift in Sources */, + 845B080D2918D4F8005785D3 /* Democracy+Call.swift in Sources */, + 8425D0EE28FE9BF1003B782A /* ReferendumVoteAction.swift in Sources */, 6857DAF09C8D7D5F9C5A5000 /* CrowdloanYourContributionsViewController.swift in Sources */, 487A912B697604FE3367FAEC /* CrowdloanYourContributionsViewLayout.swift in Sources */, 3F7F10D0E1BDE09CBE64BD2D /* CrowdloanYourContributionsViewFactory.swift in Sources */, @@ -15643,12 +17028,15 @@ 255D7AEBA45EFA5324D92371 /* DAppListPresenter.swift in Sources */, 2C9A416905C692DCFA74A0D6 /* DAppListInteractor.swift in Sources */, CE773CEC15A83AA6D0B404B8 /* DAppListViewController.swift in Sources */, + 845AADA12902D02400B5AE96 /* TitleValueDiffView.swift in Sources */, A07A987DE3047AF1A786D511 /* DAppListViewLayout.swift in Sources */, 8DF76D04C127E0048B253343 /* DAppListViewFactory.swift in Sources */, 848F8B242864448900204BC4 /* TransferSetupPresenterFactory+OnChain.swift in Sources */, - 8402CC9E275B946100E5BF30 /* DAppItemView.swift in Sources */, + 843461EA290C04C400379936 /* Gov2OperationFactory+Protocol.swift in Sources */, + 8402CC9E275B946100E5BF30 /* DAppItemViewCell.swift in Sources */, FFE19A19E5B4ED67A2C61951 /* DAppSearchProtocols.swift in Sources */, F88D85C73094F6A1FC494D87 /* DAppSearchWireframe.swift in Sources */, + 84880C4029016F1500CADB06 /* ReferendumLockChangeViewModel.swift in Sources */, 84350AD4284580F50031EF24 /* StakingTotalStakePresentable.swift in Sources */, 6B393DCF67CF97FDA580C69B /* DAppSearchPresenter.swift in Sources */, DC682E96D056C069902B9C31 /* DAppSearchViewController.swift in Sources */, @@ -15657,21 +17045,25 @@ E325FBFE10A037E58525DA66 /* DAppSearchViewFactory.swift in Sources */, 65C06FCE82EEC0B476DB1CEF /* DAppBrowserProtocols.swift in Sources */, 84FBDBE328C884F000CC1037 /* ParaStkYieldBoostStorageSubscriptionHandler.swift in Sources */, + 845B080A2918D381005785D3 /* Gov1ExtrinsicFactory.swift in Sources */, 846A836128B8DB7700D92892 /* MessageSheetTimerLabel.swift in Sources */, 40087CC8E6A91976807F7D44 /* DAppBrowserWireframe.swift in Sources */, 37E229641DCDF64AC5AF1DCD /* DAppBrowserPresenter.swift in Sources */, 91530F7301CA39654E008580 /* DAppBrowserInteractor.swift in Sources */, - 8820134828EB04300027CD80 /* SkeletonableView.swift in Sources */, DE03CA5AD7F1D0B80DFF13B6 /* DAppBrowserViewController.swift in Sources */, + 8442002328E6FE1E00C49C4A /* ReferendumsViewManager.swift in Sources */, 70C0E48EE41B4C7229F5946C /* DAppBrowserViewLayout.swift in Sources */, + 845AADA62903B32E00B5AE96 /* ReferendumVoteConfirmError.swift in Sources */, FDE2CA45061C620567AC329C /* DAppBrowserViewFactory.swift in Sources */, 882C29AC28DC7B7F009CA4B6 /* SubstrateStorageVersion.swift in Sources */, 84BC7045289EFF44008A9758 /* TransactionDisplayCode.swift in Sources */, 1D1DC32EFF13F41677A084B7 /* DAppOperationConfirmProtocols.swift in Sources */, 841E5561282E9CC700C8438F /* ParaStkStateMachineProtocols.swift in Sources */, 84720732277C370600F593DD /* DAppCategoriesView.swift in Sources */, + 8892284A28F35410003F8B9E /* ReferendumsViewModel.swift in Sources */, E2A9BC1477D81DDDE519404C /* DAppOperationConfirmWireframe.swift in Sources */, 88D997AE28AB86FE006135A5 /* YourContributionsView.swift in Sources */, + 8483B15128F93A080048B295 /* ReferendumVotersType.swift in Sources */, 84ED6BDE28688CA500B3C558 /* TransferNetworkContainerView.swift in Sources */, 849976CE27B3921800B14A6C /* DAppMetamaskAuthorizedState.swift in Sources */, 8445F41328C8C6E0009E61C4 /* ParaStkYieldBoostInitState.swift in Sources */, @@ -15687,6 +17079,7 @@ 847999B12888A4FF00D1BAD2 /* SwitchAccount+CreateWatchOnlyWireframe.swift in Sources */, 8487580727EDEB9600495306 /* BorderedIconLabelView.swift in Sources */, 84AE7AAD27D3839D00495267 /* StackCellViewModel.swift in Sources */, + 848CC94628D9FC46009EB4B0 /* ConvictionVotingTally.swift in Sources */, CD9359A2720F2EE1D4E09DF6 /* DAppTxDetailsWireframe.swift in Sources */, 0E364B6F05D390069D049CC2 /* DAppTxDetailsPresenter.swift in Sources */, 9BADFCBF3AF5186094DB8D67 /* DAppTxDetailsInteractor.swift in Sources */, @@ -15698,6 +17091,7 @@ 84C342092831645800156569 /* EraCountdownDisplay.swift in Sources */, 841E5551282E2C1700C8438F /* StakingParachainInteractor+Subscription.swift in Sources */, F0B74A766BF50518323AB25C /* DAppAuthConfirmWireframe.swift in Sources */, + 84A6AB5E290AA7DF001B57B2 /* ReferendumFullDetailsViewModel.swift in Sources */, 575A729D07A6B984851E6DD0 /* DAppAuthConfirmPresenter.swift in Sources */, 846E501527799B3E0049B659 /* DAppAuthViewModelFactory.swift in Sources */, 3086C94FE01CDFC4F79A9D7F /* DAppAuthConfirmViewController.swift in Sources */, @@ -15718,6 +17112,7 @@ 841816712824F4F30007684A /* ParachainStakingCollatorSnapshot.swift in Sources */, 5B54978244C37502DD592486 /* NftListPresenter.swift in Sources */, 6797F109D7C270DE4877B435 /* NftListInteractor.swift in Sources */, + 845B811528F43C350040CE84 /* Treasury.swift in Sources */, 84C3420B283187D800156569 /* BlockTimeEstimationService.swift in Sources */, EB376E61CD1C39AC148DE80C /* NftListViewController.swift in Sources */, 84C5ADD02811E6FA006D7388 /* LinkCellView.swift in Sources */, @@ -15748,11 +17143,13 @@ 36177C077867DBAEAA2675F7 /* TransferSetupViewController.swift in Sources */, 03348B3D555AA12FF2A95779 /* TransferSetupViewLayout.swift in Sources */, A5880E3789BC9E30835BDCC7 /* TransferSetupViewFactory.swift in Sources */, + 8453DE5728FD27390055345C /* Gov2SubscriptionFactory.swift in Sources */, 90ACE8690DA095E4F45494E9 /* TransferConfirmProtocols.swift in Sources */, 4E262D60ACAF44A1FD18FD1D /* TransferConfirmWireframe.swift in Sources */, BB29490A4E8472A7DB781BC4 /* TransferOnChainConfirmPresenter.swift in Sources */, 28A05FC8B129FE9016AD784D /* TransferOnChainConfirmInteractor.swift in Sources */, 841E555B282E6B0900C8438F /* StorageDecodingOperation+Init.swift in Sources */, + 8453DE5528FD24FF0055345C /* GovernanceSubscriptionProtocol.swift in Sources */, 8446F5EE2817130600B7A86C /* TitleAmountView+Style.swift in Sources */, 842643BB2878572E0031B5B5 /* TuringStakingRemoteSubscriptionService.swift in Sources */, DB37BAF11845A4E5067E07C7 /* TransferConfirmViewController.swift in Sources */, @@ -15766,6 +17163,7 @@ 8321399396FA5B25BC93A090 /* DAppPhishingViewLayout.swift in Sources */, B1BB78684B059A113AB3AD30 /* DAppPhishingViewFactory.swift in Sources */, 6ECB27B386124F87382073FD /* DAppAddFavoriteProtocols.swift in Sources */, + 84033057290FD8AB009C18E6 /* ReferendumsUnlocksTableViewCell.swift in Sources */, 433A3C2B0D1E4BA5974D681B /* DAppAddFavoriteWireframe.swift in Sources */, F5CA222FA684AAC8B556E667 /* DAppAddFavoritePresenter.swift in Sources */, AC904E313DC15AE40C927946 /* DAppAddFavoriteInteractor.swift in Sources */, @@ -15773,6 +17171,7 @@ 84FFE45D28620833002432BB /* XcmTransferResolutionService.swift in Sources */, D3F199376DAEBF380C5FFD9D /* DAppAddFavoriteViewLayout.swift in Sources */, 12734D7CC6ACA5B657F44519 /* DAppAddFavoriteViewFactory.swift in Sources */, + 8483B15528F9406C0048B295 /* ReferendumVotersInteractorError.swift in Sources */, 4E184FFD1532C293BDF6D7C1 /* DAppAuthSettingsProtocols.swift in Sources */, 319124D11B1376B430B6C2EF /* DAppAuthSettingsWireframe.swift in Sources */, EBC1107125C55A65D4E21417 /* DAppAuthSettingsPresenter.swift in Sources */, @@ -15800,6 +17199,7 @@ 8217DCBEB74527D57AC82070 /* ParaStkStakeConfirmViewLayout.swift in Sources */, 06FD6F5999D57B27B29C8738 /* ParaStkStakeConfirmViewFactory.swift in Sources */, 2BBA744323AA0BF6FE53C212 /* ParaStkSelectCollatorsProtocols.swift in Sources */, + 880059E128EF0A5C00E87B9B /* VotingProgressView.swift in Sources */, 84744955289284F50042FD80 /* StakingMainViewLayout.swift in Sources */, 2BB0D54988107FA0C484C530 /* ParaStkSelectCollatorsWireframe.swift in Sources */, DEF53463C2C780D702E9C2CA /* ParaStkSelectCollatorsPresenter.swift in Sources */, @@ -15823,6 +17223,7 @@ 688F73AFD5FF20F77242B57E /* ParaStkCollatorsSearchViewController.swift in Sources */, 3BFD635E852E4D395025BEE8 /* ParaStkCollatorsSearchViewFactory.swift in Sources */, 846AACED28BF94B9009F3D42 /* AccountManagementFilter.swift in Sources */, + 8425D0E628FE82CB003B782A /* ReferendumVoteInteractor.swift in Sources */, 766FE2FAB8509BF0F56EA3C0 /* ParaStkCollatorInfoProtocols.swift in Sources */, 4097A50CF5E5794092354758 /* ParaStkCollatorInfoWireframe.swift in Sources */, A8115BE0BFA6558B46CEA101 /* ParaStkCollatorInfoPresenter.swift in Sources */, @@ -15841,6 +17242,7 @@ 84EBFCEB285E7E130006327E /* XcmWeightLimit.swift in Sources */, D7B4AE688B93EC562F452F4E /* ParaStkUnstakeInteractor.swift in Sources */, 5FD7B3463822BC69AF5E3C72 /* ParaStkUnstakeViewController.swift in Sources */, + 8442002728E6FFBA00C49C4A /* VoteViewController.swift in Sources */, 3E6215E91AE1C1F78246A43C /* ParaStkUnstakeViewLayout.swift in Sources */, 790129F3CB6AEA611639E886 /* ParaStkUnstakeViewFactory.swift in Sources */, C74B44F382EDAE5CB5A8468F /* ParaStkUnstakeConfirmProtocols.swift in Sources */, @@ -15851,6 +17253,7 @@ A748D64F6048192E16E5BE44 /* ParaStkUnstakeConfirmViewLayout.swift in Sources */, A14308E2633921838166C843 /* ParaStkUnstakeConfirmViewFactory.swift in Sources */, 135E979B52DC1BD29A5FC389 /* ParaStkRedeemProtocols.swift in Sources */, + 88F34FDD28FFE6E400712BDE /* MultiValueView+Model.swift in Sources */, 54D334605E9A7C71A4873CFC /* ParaStkRedeemWireframe.swift in Sources */, 413CCB7C7B22831147B8E815 /* ParaStkRedeemPresenter.swift in Sources */, 35F9157CAA182493B2F0E1D3 /* ParaStkRedeemInteractor.swift in Sources */, @@ -15876,6 +17279,7 @@ 6BBD025775841F8B055CA367 /* AssetsSearchViewFactory.swift in Sources */, 5188FF070CD05F92C93A5055 /* CreateWatchOnlyProtocols.swift in Sources */, 97BF7157FE13F723BF4D5713 /* CreateWatchOnlyWireframe.swift in Sources */, + 84770F25291F72D700852A33 /* ReferendumVotingInitData.swift in Sources */, 846A835D28B8D09600D92892 /* LedgerMessageSheetViewFactory.swift in Sources */, 60FFEE5B386E82D70333BE80 /* CreateWatchOnlyPresenter.swift in Sources */, 454D41CC5C7CC2FDAB778026 /* CreateWatchOnlyInteractor.swift in Sources */, @@ -15886,6 +17290,7 @@ 6003DF3EBB77510EFB70B4E4 /* MessageSheetProtocols.swift in Sources */, 2450083471CD071346371995 /* MessageSheetWireframe.swift in Sources */, 411E74233593A329298C6405 /* MessageSheetPresenter.swift in Sources */, + 843461EC290D0D9400379936 /* GovernanceUnlockSchedule.swift in Sources */, 3FC436AED4098456EDEAF484 /* MessageSheetViewController.swift in Sources */, 842822A4289BCBB200163031 /* SwitchAccount+ParitySignerAddressesWireframe.swift in Sources */, 355476A5AECD2FFE4ED3DE39 /* MessageSheetViewLayout.swift in Sources */, @@ -15898,6 +17303,7 @@ 28B4C94DBAF461CBF18B1B63 /* WalletsListViewController.swift in Sources */, 233CB11F486DE1953D977295 /* WalletsListViewLayout.swift in Sources */, FD43B68CFBD5C3497B446F53 /* ChangeWatchOnlyProtocols.swift in Sources */, + 88B438E728F6C629001FC08A /* StatusTimeViewModel.swift in Sources */, E65FDA8BF9DBE7F50AE9D733 /* ChangeWatchOnlyWireframe.swift in Sources */, 02838B00DD7C9BC3BD78FF65 /* ChangeWatchOnlyPresenter.swift in Sources */, 493A9637BE5A1BF4B0744A4C /* ChangeWatchOnlyInteractor.swift in Sources */, @@ -15915,25 +17321,31 @@ 2F6FA089995FD12FB2AA814B /* ParitySignerWelcomePresenter.swift in Sources */, 012AE9F8BDA682C691B6F9FD /* ParitySignerWelcomeViewController.swift in Sources */, DC2867A7DC1415052D090C53 /* ParitySignerWelcomeViewLayout.swift in Sources */, + 845B07F5291627A3005785D3 /* Gov1OperationFactory+Protocol.swift in Sources */, 97608590E8D770A86CCFBE86 /* ParitySignerWelcomeViewFactory.swift in Sources */, + 8425D0E028FE738D003B782A /* ReferendumVoteSetupInteractorError.swift in Sources */, 5443122935BBFDD55AE9E6FD /* ParitySignerAddressesProtocols.swift in Sources */, 6A2B6DF2D6AE912D5FA62D94 /* ParitySignerAddressesWireframe.swift in Sources */, 65083CD11AE1998A1F4D98F1 /* ParitySignerAddressesPresenter.swift in Sources */, 3AD7635AFA1F7E66A3C00F56 /* ParitySignerAddressesInteractor.swift in Sources */, 940DA38E4586A27D7F3E0C67 /* ParitySignerAddressesViewController.swift in Sources */, E8F04B9E557AD6BD0279EA6F /* ParitySignerAddressesViewLayout.swift in Sources */, + 84DD49F628EE974B00B804F3 /* ReferendumDecidingFunctionProtocol.swift in Sources */, 01F973625B78736D5EEA86F6 /* ParitySignerAddressesViewFactory.swift in Sources */, ECD4EB7314609007CE35461E /* ParitySignerAddConfirmProtocols.swift in Sources */, 6D622CD4A83EEC1F135B66A8 /* ParitySignerAddConfirmWireframe.swift in Sources */, 41FA237A4AA56AC99322A040 /* ParitySignerAddConfirmPresenter.swift in Sources */, 663DB041307C59E939BF0BE2 /* ParitySignerAddConfirmInteractor.swift in Sources */, 13CF38563E1849EAF1B4E4B6 /* ParitySignerAddConfirmViewFactory.swift in Sources */, + 84F76ED629006A0900D7206C /* ReferendumConvictionView.swift in Sources */, 9979A61C1677B7B1D44E58B4 /* ParitySignerTxQrProtocols.swift in Sources */, 535E9CD08FCA2DA52D37A134 /* ParitySignerTxQrWireframe.swift in Sources */, 95AF91994555227D52FCDA24 /* ParitySignerTxQrPresenter.swift in Sources */, 211725E26764530359F53A38 /* ParitySignerTxQrInteractor.swift in Sources */, + 845B0817291902CF005785D3 /* Gov2LockStateFactory.swift in Sources */, 41DE96F778AE909978775438 /* ParitySignerTxQrViewController.swift in Sources */, 87F7556E02F6F5BB6F1B1AEA /* ParitySignerTxQrViewLayout.swift in Sources */, + 84770F2C291F893200852A33 /* GovernanceUnlockConfirmInitData.swift in Sources */, 84E90BA128D0B51000529633 /* CheckboxControlView.swift in Sources */, 821518375113295E41E0481C /* ParitySignerTxQrViewFactory.swift in Sources */, 641D7CF89F37B1890516015E /* ParitySignerTxScanProtocols.swift in Sources */, @@ -15952,7 +17364,9 @@ CA8D91616B55AF9A02215FBB /* LedgerPerformOperationViewLayout.swift in Sources */, 8CF040889DBCA0E9D40BDC82 /* LedgerDiscoverViewFactory.swift in Sources */, 30542C0BD486FD1583F36BA2 /* LedgerNetworkSelectionProtocols.swift in Sources */, + 84F1D66D29051F240050F4E3 /* ReferendumReuseLockModel.swift in Sources */, 84FBDBE128C884DA00CC1037 /* ParaStkYieldBoostStorageSubscriber.swift in Sources */, + 845B07F929162D24005785D3 /* Gov1LocalMappingFactory.swift in Sources */, C102544345E604976BF7AFFC /* LedgerNetworkSelectionWireframe.swift in Sources */, D71B2C6056D803C196DF4CDA /* LedgerNetworkSelectionPresenter.swift in Sources */, 19D3739A3C7800A5A18DA41C /* LedgerNetworkSelectionInteractor.swift in Sources */, @@ -15969,14 +17383,17 @@ 99A045F3C6403FB48B39971D /* LedgerWalletConfirmProtocols.swift in Sources */, DCE9FE8A75C2FE7B5CB92CC2 /* LedgerWalletConfirmWireframe.swift in Sources */, 106CC4BFC48B6BFFF31434A9 /* LedgerWalletConfirmPresenter.swift in Sources */, + 882808CA29009CDC00AE8089 /* UIView+frame.swift in Sources */, 4541F886953E046C16E42997 /* LedgerWalletConfirmInteractor.swift in Sources */, 2A652719FB31E3C8FF36F46A /* LedgerWalletConfirmViewFactory.swift in Sources */, + 84CEF28E29050A3300BA25BB /* DataValidationRunner+GovVote.swift in Sources */, 95EBC71EAE906B0DFA758AB8 /* LedgerTxConfirmProtocols.swift in Sources */, 992678FD5D3F9D39FFC2BB53 /* LedgerTxConfirmWireframe.swift in Sources */, ED529AA4ED05E8847C4C067F /* LedgerTxConfirmPresenter.swift in Sources */, E488F3E052650FF525D41D63 /* LedgerTxConfirmInteractor.swift in Sources */, 75DAB313623E900EC475E215 /* LedgerTxConfirmViewFactory.swift in Sources */, 44D9F74D7851B874F2045E7E /* LedgerInstructionsProtocols.swift in Sources */, + 84715783291132B400D7D003 /* GovernanceUnlockTableViewCell.swift in Sources */, CD4240B756F20C338A8B3589 /* LedgerInstructionsWireframe.swift in Sources */, 91A1286763617DE022BD495F /* LedgerInstructionsPresenter.swift in Sources */, 529B87AC9E500CC2A503A859 /* LedgerInstructionsViewController.swift in Sources */, @@ -15998,11 +17415,14 @@ 7C0135CA49EF6B535030643E /* ParaStkYieldBoostSetupPresenter.swift in Sources */, 21B297239CC294307EF20B58 /* ParaStkYieldBoostSetupInteractor.swift in Sources */, AE180C8B30831C9BAA39763A /* ParaStkYieldBoostSetupViewController.swift in Sources */, + 8824D4222902D92F0022D778 /* ReferendumFullDetailsInteractor.swift in Sources */, + 88B1862A28EF30A600D49854 /* YourVoteView.swift in Sources */, C19EF49636E698D87D5D18FA /* ParaStkYieldBoostSetupViewLayout.swift in Sources */, B3E567D46F54E8E735792FE1 /* ParaStkYieldBoostSetupViewFactory.swift in Sources */, E221892A5B6A41A944B88336 /* ParaStkYieldBoostStartProtocols.swift in Sources */, 8F131D86B269B7FAB96CF3B5 /* ParaStkYieldBoostStartWireframe.swift in Sources */, EEDDE41F8445C0CB2E99AFE4 /* ParaStkYieldBoostStartPresenter.swift in Sources */, + 84A1742728ED607B0096F943 /* GovernanceOperationProtocols.swift in Sources */, B6D4C073B3F984FE0348B7D4 /* ParaStkYieldBoostStartInteractor.swift in Sources */, 72EF67BA5380D1CDBB73E23F /* ParaStkYieldBoostStartViewController.swift in Sources */, DB20B86D7BDE3788947ED9A4 /* ParaStkYieldBoostStartViewLayout.swift in Sources */, @@ -16014,6 +17434,65 @@ A2BE8967FC1609D61E4131BE /* ParaStkYieldBoostStopViewController.swift in Sources */, 7584B6DC2C7F8B2B6671908F /* ParaStkYieldBoostStopViewLayout.swift in Sources */, 3E0DDDE01391F9041C8D7382 /* ParaStkYieldBoostStopViewFactory.swift in Sources */, + 0B48B02E973CB304B765BBC9 /* ReferendumDetailsProtocols.swift in Sources */, + C644308270C29AC6F90CFEA6 /* ReferendumDetailsWireframe.swift in Sources */, + 7D2906130F25492872637EFC /* ReferendumDetailsPresenter.swift in Sources */, + 5E3B1E6B9E94848B186FD4D1 /* ReferendumDetailsInteractor.swift in Sources */, + 488E4467895040EA85FDCC79 /* ReferendumDetailsViewController.swift in Sources */, + 845B811D28F44A700040CE84 /* ReferendumActionLocal.swift in Sources */, + 3403F3DCDE932B9F9C6D32B6 /* ReferendumDetailsViewLayout.swift in Sources */, + 1A029717AD309487B70FFD02 /* ReferendumDetailsViewFactory.swift in Sources */, + 9DED20EB20A872E682CB402A /* ReferendumFullDetailsProtocols.swift in Sources */, + 1269C0103216CDBDA25A5101 /* ReferendumFullDetailsWireframe.swift in Sources */, + 2B287EEF431ED9FE9510BAA4 /* ReferendumFullDetailsPresenter.swift in Sources */, + 85600C63BB1BEC76EDFA04CB /* ReferendumFullDetailsViewController.swift in Sources */, + EAAFB082E2BB0CA418714061 /* ReferendumFullDetailsViewLayout.swift in Sources */, + 74F470AE889B0E49D9808802 /* ReferendumFullDetailsViewFactory.swift in Sources */, + 84033055290FD745009C18E6 /* ReferendumsUnlocksViewModel.swift in Sources */, + 003063A17B04BA6327EA355F /* ReferendumVotersProtocols.swift in Sources */, + E4021A6E90432CC5C797A647 /* ReferendumVotersWireframe.swift in Sources */, + 93EB8C73108944E9C576936C /* ReferendumVotersPresenter.swift in Sources */, + F3BB50CCA38C9B47FDBEDF53 /* ReferendumVotersInteractor.swift in Sources */, + 1A3608A12079F00796FA9718 /* ReferendumVotersViewController.swift in Sources */, + 4D44B178F1F57FD8607E8095 /* ReferendumVotersViewLayout.swift in Sources */, + 89724EA9F732D0C967253597 /* ReferendumVotersViewFactory.swift in Sources */, + 1F496969FEE3E160BABDAC66 /* ReferendumVoteSetupProtocols.swift in Sources */, + F1BED07F67119E1BD052952A /* ReferendumVoteSetupWireframe.swift in Sources */, + 7E2800371BE3B166F3475E90 /* ReferendumVoteSetupPresenter.swift in Sources */, + 04D86D5341406305E60F6D18 /* ReferendumVoteSetupInteractor.swift in Sources */, + 2CEFF4C2574F0AABE0E9BF89 /* ReferendumVoteSetupViewController.swift in Sources */, + D1C4208A89633395AF2FDB74 /* ReferendumVoteSetupViewLayout.swift in Sources */, + 811096BAAA6BD237DF2769EA /* ReferendumVoteSetupViewFactory.swift in Sources */, + 441FFD82C502D7300B79EE66 /* ReferendumVoteConfirmProtocols.swift in Sources */, + F35B520D7955A70588AB593C /* ReferendumVoteConfirmWireframe.swift in Sources */, + F0ADB63765A8EAA19D85C30B /* ReferendumVoteConfirmPresenter.swift in Sources */, + 84C9CF3D291AF1B1002BF328 /* GovernanceOffchainApi.swift in Sources */, + DE52F23521D54A07F558EB1B /* ReferendumVoteConfirmInteractor.swift in Sources */, + B30FEC6F62918BC6F38396A2 /* ReferendumVoteConfirmViewController.swift in Sources */, + 163709FEE6203813261DD771 /* ReferendumVoteConfirmViewLayout.swift in Sources */, + 71533ED31DD45841CA8296A3 /* ReferendumVoteConfirmViewFactory.swift in Sources */, + 879D493C025963619CFADF4F /* GovernanceUnlockSetupProtocols.swift in Sources */, + 46298240F3528B5C62AEC29E /* GovernanceUnlockSetupWireframe.swift in Sources */, + 9097EE6D11E2E023D2637BE5 /* GovernanceUnlockSetupPresenter.swift in Sources */, + 38D0977931828C7894579968 /* GovernanceUnlockSetupInteractor.swift in Sources */, + 16098DABB1C9C058C1965F1D /* GovernanceUnlockSetupViewController.swift in Sources */, + 8493FF38291A59D800F09F1B /* ReferendumMetadataMapper.swift in Sources */, + 0E71EA5AE04940824AEA01C7 /* GovernanceUnlockSetupViewLayout.swift in Sources */, + E28F3762EAC9A4E5D21342D4 /* GovernanceUnlockSetupViewFactory.swift in Sources */, + AE6C737BD94BCD88A06287E2 /* ReferendumFullDescriptionProtocols.swift in Sources */, + 62B2298F132DB0CE0794DD7A /* ReferendumFullDescriptionWireframe.swift in Sources */, + A05C2B3458F12EFE1633D917 /* ReferendumFullDescriptionPresenter.swift in Sources */, + 1752940C07D7BA41801E3853 /* ReferendumFullDescriptionInteractor.swift in Sources */, + 91201789084DD9A419CA8CD3 /* ReferendumFullDescriptionViewController.swift in Sources */, + 3A4743C7C74BE4F74F6390F6 /* ReferendumFullDescriptionViewLayout.swift in Sources */, + F8C0CA3DDBCB5E509295F099 /* ReferendumFullDescriptionViewFactory.swift in Sources */, + 9DE1757D047A4D1E97913774 /* GovernanceUnlockConfirmProtocols.swift in Sources */, + 2272FB0A01000A46D097634E /* GovernanceUnlockConfirmWireframe.swift in Sources */, + A3BDFA01A32B6C7463E6EFFA /* GovernanceUnlockConfirmPresenter.swift in Sources */, + 62649D3FB6AACB508872C67A /* GovernanceUnlockConfirmInteractor.swift in Sources */, + 6D603098CCF0B65AA726AD38 /* GovernanceUnlockConfirmViewController.swift in Sources */, + 7DB7E81CC2F880E4736DE062 /* GovernanceUnlockConfirmViewLayout.swift in Sources */, + D5BB3A36DB9ADD25EE43109F /* GovernanceUnlockConfirmViewFactory.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -16050,12 +17529,14 @@ 84B7C73B289BFA79001A3566 /* StakingUnbondConfirmTests.swift in Sources */, 842A738E27DEF592006EE1EA /* AssetTransactionGenerator.swift in Sources */, 84CE69ED25667A5600559427 /* ByteLengthEncodingTests.swift in Sources */, + 843461FA290E55D100379936 /* GovernanceUnlocksTestBuilding.swift in Sources */, 84B7C73D289BFA79001A3566 /* StakingPayoutsConfirmTests.swift in Sources */, 84B7C72E289BFA79001A3566 /* CustomValidatorListTestDataGenerator.swift in Sources */, 84B7C746289BFA79001A3566 /* WalletHistoryFilterTests.swift in Sources */, 843EC7A82701F63600C7DC7E /* PriceProviderFactoryStub.swift in Sources */, 8890E51628DDC98C001D3994 /* SubstrateStorageMigrationTests.swift in Sources */, 84B7C70E289BFA79001A3566 /* SettingsTests.swift in Sources */, + 84B4E12C28EC038C00AC4FA8 /* ChainModelMapperV2V3.swift in Sources */, 84563D0924F46B7F0055591D /* ManagedAccountItemMapperTests.swift in Sources */, 845B822726EFFE0200D25C72 /* MetaAccountMapperTests.swift in Sources */, 84B7C738289BFA79001A3566 /* StakingRebondSetupTests.swift in Sources */, @@ -16081,6 +17562,7 @@ 84CE9AE926CAA83100B4EF62 /* RuntimeProviderTests.swift in Sources */, 849ECD3526DE70B900F542A3 /* SingleToMultiassetUserMigrationTests.swift in Sources */, 8467FD0D24E5E585005D486C /* KeystoreImportTests.swift in Sources */, + 84741ADF290F116B00C98E17 /* Gov2UnlockScheduleTests.swift in Sources */, 8476CA0B25EFB17A003EEAE1 /* RewardCalculatorServiceStub.swift in Sources */, 84F81318265B9E990043FA1D /* CrowdloansOperationFactoryStub.swift in Sources */, 847F2D5727AB08D200AFD476 /* GradientColorFactoryTests.swift in Sources */, @@ -16129,6 +17611,7 @@ 8400F0BA252BBD2200E6B4CB /* WalletCommandFactoryProtocolMock.swift in Sources */, 84B7C729289BFA79001A3566 /* StartSelectValidatorsTests.swift in Sources */, 84B7C737289BFA79001A3566 /* StakingBondMoreTests.swift in Sources */, + 84DD49F828EEAFFF00B804F3 /* DecimalTests.swift in Sources */, F477CD75262FFA4F004DF739 /* PayoutRewardsServiceStub.swift in Sources */, 84B7C710289BFA79001A3566 /* CrowdloanYourContributionsTests.swift in Sources */, 8476D39827F431D5004D9A7A /* MockApplicationService.swift in Sources */, @@ -16815,10 +18298,13 @@ 843910CA253F7E6500E3C217 /* SubstrateDataModel.xcdatamodeld */ = { isa = XCVersionGroup; children = ( + 8493FF36291A3D4C00F09F1B /* SubstrateDataModel5.xcdatamodel */, + 845B08112918E343005785D3 /* SubstrateDataModel4.xcdatamodel */, + 84D8754628EB726E004065BD /* SubstrateDataModel3.xcdatamodel */, 88787F0328DB3A7B00B115AB /* SubstrateDataModel2.xcdatamodel */, 843910CB253F7E6500E3C217 /* SubstrateDataModel.xcdatamodel */, ); - currentVersion = 88787F0328DB3A7B00B115AB /* SubstrateDataModel2.xcdatamodel */; + currentVersion = 8493FF36291A3D4C00F09F1B /* SubstrateDataModel5.xcdatamodel */; path = SubstrateDataModel.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; diff --git a/novawallet/Assets.xcassets/colorBlack48.colorset/Contents.json b/novawallet/Assets.xcassets/colorBlack48.colorset/Contents.json new file mode 100644 index 0000000000..fb08a6620b --- /dev/null +++ b/novawallet/Assets.xcassets/colorBlack48.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.480", + "blue" : "0.000", + "green" : "0.000", + "red" : "0.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/colorBlack72.colorset/Contents.json b/novawallet/Assets.xcassets/colorBlack72.colorset/Contents.json new file mode 100644 index 0000000000..ec4360ef43 --- /dev/null +++ b/novawallet/Assets.xcassets/colorBlack72.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.720", + "blue" : "0.000", + "green" : "0.000", + "red" : "0.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/colorDarkYellow.colorset/Contents.json b/novawallet/Assets.xcassets/colorDarkYellow.colorset/Contents.json new file mode 100644 index 0000000000..a258bc28af --- /dev/null +++ b/novawallet/Assets.xcassets/colorDarkYellow.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x0A", + "green" : "0xC5", + "red" : "0xEB" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/colorGreen.colorset/Contents.json b/novawallet/Assets.xcassets/colorGreen.colorset/Contents.json index 202ae10a81..303b6db44a 100644 --- a/novawallet/Assets.xcassets/colorGreen.colorset/Contents.json +++ b/novawallet/Assets.xcassets/colorGreen.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x19", - "green" : "0xFF", - "red" : "0x00" + "blue" : "0x37", + "green" : "0xCF", + "red" : "0x15" } }, "idiom" : "universal" diff --git a/novawallet/Assets.xcassets/colorGreen15CF37.colorset/Contents.json b/novawallet/Assets.xcassets/colorGreen15CF37.colorset/Contents.json new file mode 100644 index 0000000000..303b6db44a --- /dev/null +++ b/novawallet/Assets.xcassets/colorGreen15CF37.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x37", + "green" : "0xCF", + "red" : "0x15" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/colorGreen24.colorset/Contents.json b/novawallet/Assets.xcassets/colorGreen24.colorset/Contents.json index 7345a0cf04..fbf30a4b8a 100644 --- a/novawallet/Assets.xcassets/colorGreen24.colorset/Contents.json +++ b/novawallet/Assets.xcassets/colorGreen24.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "0.240", - "blue" : "0.231", - "green" : "0.827", - "red" : "0.055" + "blue" : "0x3A", + "green" : "0xD2", + "red" : "0x0E" } }, "idiom" : "universal" diff --git a/novawallet/Assets.xcassets/colorRed40.colorset/Contents.json b/novawallet/Assets.xcassets/colorRed40.colorset/Contents.json index d8875167a6..abd37d824e 100644 --- a/novawallet/Assets.xcassets/colorRed40.colorset/Contents.json +++ b/novawallet/Assets.xcassets/colorRed40.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "0.400", - "blue" : "0.361", - "green" : "0.157", - "red" : "1.000" + "blue" : "0x5C", + "green" : "0x28", + "red" : "0xFF" } }, "idiom" : "universal" diff --git a/novawallet/Assets.xcassets/colorYellow12.colorset/Contents.json b/novawallet/Assets.xcassets/colorRedFF3A69.colorset/Contents.json similarity index 74% rename from novawallet/Assets.xcassets/colorYellow12.colorset/Contents.json rename to novawallet/Assets.xcassets/colorRedFF3A69.colorset/Contents.json index fb456b3570..aeb18d1dfb 100644 --- a/novawallet/Assets.xcassets/colorYellow12.colorset/Contents.json +++ b/novawallet/Assets.xcassets/colorRedFF3A69.colorset/Contents.json @@ -4,9 +4,9 @@ "color" : { "color-space" : "srgb", "components" : { - "alpha" : "0.120", - "blue" : "0x11", - "green" : "0xE7", + "alpha" : "1.000", + "blue" : "0x69", + "green" : "0x3A", "red" : "0xFF" } }, diff --git a/novawallet/Assets.xcassets/colorSliderOverlay.colorset/Contents.json b/novawallet/Assets.xcassets/colorSliderOverlay.colorset/Contents.json new file mode 100644 index 0000000000..232e3744cf --- /dev/null +++ b/novawallet/Assets.xcassets/colorSliderOverlay.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0x3A", + "green" : "0x3A", + "red" : "0x3A" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/colorYellow.colorset/Contents.json b/novawallet/Assets.xcassets/colorYellow.colorset/Contents.json index c6f7ebc14e..a258bc28af 100644 --- a/novawallet/Assets.xcassets/colorYellow.colorset/Contents.json +++ b/novawallet/Assets.xcassets/colorYellow.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x11", - "green" : "0xE7", - "red" : "0xFF" + "blue" : "0x0A", + "green" : "0xC5", + "red" : "0xEB" } }, "idiom" : "universal" diff --git a/novawallet/Assets.xcassets/colorYellow16.colorset/Contents.json b/novawallet/Assets.xcassets/colorYellow16.colorset/Contents.json new file mode 100644 index 0000000000..8d362450b0 --- /dev/null +++ b/novawallet/Assets.xcassets/colorYellow16.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.160", + "blue" : "0x0A", + "green" : "0xC5", + "red" : "0xEB" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/gov/Contents.json b/novawallet/Assets.xcassets/gov/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/novawallet/Assets.xcassets/gov/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloanFilled.imageset/Contents.json b/novawallet/Assets.xcassets/gov/iconGovCrowdloan.imageset/Contents.json similarity index 71% rename from novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloanFilled.imageset/Contents.json rename to novawallet/Assets.xcassets/gov/iconGovCrowdloan.imageset/Contents.json index 5e8bfe071f..a31827657a 100644 --- a/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloanFilled.imageset/Contents.json +++ b/novawallet/Assets.xcassets/gov/iconGovCrowdloan.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "iconTabCrowloanFilled.pdf", + "filename" : "iconGovCrowdloan.pdf", "idiom" : "universal" } ], diff --git a/novawallet/Assets.xcassets/gov/iconGovCrowdloan.imageset/iconGovCrowdloan.pdf b/novawallet/Assets.xcassets/gov/iconGovCrowdloan.imageset/iconGovCrowdloan.pdf new file mode 100644 index 0000000000..0d2ec2ee3f Binary files /dev/null and b/novawallet/Assets.xcassets/gov/iconGovCrowdloan.imageset/iconGovCrowdloan.pdf differ diff --git a/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloan.imageset/Contents.json b/novawallet/Assets.xcassets/gov/iconGovFellowship.imageset/Contents.json similarity index 52% rename from novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloan.imageset/Contents.json rename to novawallet/Assets.xcassets/gov/iconGovFellowship.imageset/Contents.json index c6f459a162..cb841ceddb 100644 --- a/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloan.imageset/Contents.json +++ b/novawallet/Assets.xcassets/gov/iconGovFellowship.imageset/Contents.json @@ -1,15 +1,12 @@ { "images" : [ { - "filename" : "iconTabCrowloan.pdf", + "filename" : "iconGovFellowship.pdf", "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 - }, - "properties" : { - "template-rendering-intent" : "template" } } diff --git a/novawallet/Assets.xcassets/gov/iconGovFellowship.imageset/iconGovFellowship.pdf b/novawallet/Assets.xcassets/gov/iconGovFellowship.imageset/iconGovFellowship.pdf new file mode 100644 index 0000000000..486865d5e5 Binary files /dev/null and b/novawallet/Assets.xcassets/gov/iconGovFellowship.imageset/iconGovFellowship.pdf differ diff --git a/novawallet/Assets.xcassets/gov/iconGovGovernance.imageset/Contents.json b/novawallet/Assets.xcassets/gov/iconGovGovernance.imageset/Contents.json new file mode 100644 index 0000000000..da33984138 --- /dev/null +++ b/novawallet/Assets.xcassets/gov/iconGovGovernance.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconGovGovernance.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/gov/iconGovGovernance.imageset/iconGovGovernance.pdf b/novawallet/Assets.xcassets/gov/iconGovGovernance.imageset/iconGovGovernance.pdf new file mode 100644 index 0000000000..90c345b3cf Binary files /dev/null and b/novawallet/Assets.xcassets/gov/iconGovGovernance.imageset/iconGovGovernance.pdf differ diff --git a/novawallet/Assets.xcassets/gov/iconGovStaking.imageset/Contents.json b/novawallet/Assets.xcassets/gov/iconGovStaking.imageset/Contents.json new file mode 100644 index 0000000000..b7a1bf8b52 --- /dev/null +++ b/novawallet/Assets.xcassets/gov/iconGovStaking.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconGovStaking.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/gov/iconGovStaking.imageset/iconGovStaking.pdf b/novawallet/Assets.xcassets/gov/iconGovStaking.imageset/iconGovStaking.pdf new file mode 100644 index 0000000000..5efa3dbe9c Binary files /dev/null and b/novawallet/Assets.xcassets/gov/iconGovStaking.imageset/iconGovStaking.pdf differ diff --git a/novawallet/Assets.xcassets/gov/iconGovTreasury.imageset/Contents.json b/novawallet/Assets.xcassets/gov/iconGovTreasury.imageset/Contents.json new file mode 100644 index 0000000000..b304ffe67f --- /dev/null +++ b/novawallet/Assets.xcassets/gov/iconGovTreasury.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconGovTreasury.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/gov/iconGovTreasury.imageset/iconGovTreasury.pdf b/novawallet/Assets.xcassets/gov/iconGovTreasury.imageset/iconGovTreasury.pdf new file mode 100644 index 0000000000..95189c63f9 Binary files /dev/null and b/novawallet/Assets.xcassets/gov/iconGovTreasury.imageset/iconGovTreasury.pdf differ diff --git a/novawallet/Assets.xcassets/iconAmountDec.imageset/Contents.json b/novawallet/Assets.xcassets/iconAmountDec.imageset/Contents.json new file mode 100644 index 0000000000..8ac2cbae37 --- /dev/null +++ b/novawallet/Assets.xcassets/iconAmountDec.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconAmountDec.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconAmountDec.imageset/iconAmountDec.pdf b/novawallet/Assets.xcassets/iconAmountDec.imageset/iconAmountDec.pdf new file mode 100644 index 0000000000..534e496d82 Binary files /dev/null and b/novawallet/Assets.xcassets/iconAmountDec.imageset/iconAmountDec.pdf differ diff --git a/novawallet/Assets.xcassets/iconAmountInc.imageset/Contents.json b/novawallet/Assets.xcassets/iconAmountInc.imageset/Contents.json new file mode 100644 index 0000000000..154eab6ba1 --- /dev/null +++ b/novawallet/Assets.xcassets/iconAmountInc.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconAmountInc.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconAmountInc.imageset/iconAmountInc.pdf b/novawallet/Assets.xcassets/iconAmountInc.imageset/iconAmountInc.pdf new file mode 100644 index 0000000000..fc140d6771 Binary files /dev/null and b/novawallet/Assets.xcassets/iconAmountInc.imageset/iconAmountInc.pdf differ diff --git a/novawallet/Assets.xcassets/iconFire.imageset/Contents.json b/novawallet/Assets.xcassets/iconFire.imageset/Contents.json new file mode 100644 index 0000000000..29a2ceb48c --- /dev/null +++ b/novawallet/Assets.xcassets/iconFire.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "Fire.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconFire.imageset/Fire.pdf b/novawallet/Assets.xcassets/iconFire.imageset/Fire.pdf new file mode 100644 index 0000000000..142adbb98c Binary files /dev/null and b/novawallet/Assets.xcassets/iconFire.imageset/Fire.pdf differ diff --git a/novawallet/Assets.xcassets/iconGovAmountLock.imageset/Contents.json b/novawallet/Assets.xcassets/iconGovAmountLock.imageset/Contents.json new file mode 100644 index 0000000000..2ba4a67f7f --- /dev/null +++ b/novawallet/Assets.xcassets/iconGovAmountLock.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconGovAmountLock.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconGovAmountLock.imageset/iconGovAmountLock.pdf b/novawallet/Assets.xcassets/iconGovAmountLock.imageset/iconGovAmountLock.pdf new file mode 100644 index 0000000000..c353228ba2 Binary files /dev/null and b/novawallet/Assets.xcassets/iconGovAmountLock.imageset/iconGovAmountLock.pdf differ diff --git a/novawallet/Assets.xcassets/iconGovLockTransition.imageset/Contents.json b/novawallet/Assets.xcassets/iconGovLockTransition.imageset/Contents.json new file mode 100644 index 0000000000..67c40ac641 --- /dev/null +++ b/novawallet/Assets.xcassets/iconGovLockTransition.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconGovLockTransition.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconGovLockTransition.imageset/iconGovLockTransition.pdf b/novawallet/Assets.xcassets/iconGovLockTransition.imageset/iconGovLockTransition.pdf new file mode 100644 index 0000000000..86b906867f Binary files /dev/null and b/novawallet/Assets.xcassets/iconGovLockTransition.imageset/iconGovLockTransition.pdf differ diff --git a/novawallet/Assets.xcassets/iconGovPeriodLock.imageset/Contents.json b/novawallet/Assets.xcassets/iconGovPeriodLock.imageset/Contents.json new file mode 100644 index 0000000000..93514f2cb3 --- /dev/null +++ b/novawallet/Assets.xcassets/iconGovPeriodLock.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconGovPeriodLock.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconGovPeriodLock.imageset/iconGovPeriodLock.pdf b/novawallet/Assets.xcassets/iconGovPeriodLock.imageset/iconGovPeriodLock.pdf new file mode 100644 index 0000000000..472659ce3e Binary files /dev/null and b/novawallet/Assets.xcassets/iconGovPeriodLock.imageset/iconGovPeriodLock.pdf differ diff --git a/novawallet/Assets.xcassets/iconGovTransferable.imageset/Contents.json b/novawallet/Assets.xcassets/iconGovTransferable.imageset/Contents.json new file mode 100644 index 0000000000..0ee609ba44 --- /dev/null +++ b/novawallet/Assets.xcassets/iconGovTransferable.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconGovTransferable.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconGovTransferable.imageset/iconGovTransferable.pdf b/novawallet/Assets.xcassets/iconGovTransferable.imageset/iconGovTransferable.pdf new file mode 100644 index 0000000000..b0e3147740 Binary files /dev/null and b/novawallet/Assets.xcassets/iconGovTransferable.imageset/iconGovTransferable.pdf differ diff --git a/novawallet/Assets.xcassets/iconSliderThumb.imageset/Contents.json b/novawallet/Assets.xcassets/iconSliderThumb.imageset/Contents.json new file mode 100644 index 0000000000..85d874050c --- /dev/null +++ b/novawallet/Assets.xcassets/iconSliderThumb.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconSliderThumb.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconSliderThumb.imageset/iconSliderThumb.pdf b/novawallet/Assets.xcassets/iconSliderThumb.imageset/iconSliderThumb.pdf new file mode 100644 index 0000000000..5765cca0b4 Binary files /dev/null and b/novawallet/Assets.xcassets/iconSliderThumb.imageset/iconSliderThumb.pdf differ diff --git a/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloan.imageset/iconTabCrowloan.pdf b/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloan.imageset/iconTabCrowloan.pdf deleted file mode 100644 index afe9a0ebbf..0000000000 Binary files a/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloan.imageset/iconTabCrowloan.pdf and /dev/null differ diff --git a/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloanFilled.imageset/iconTabCrowloanFilled.pdf b/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloanFilled.imageset/iconTabCrowloanFilled.pdf deleted file mode 100644 index 1a50de0606..0000000000 Binary files a/novawallet/Assets.xcassets/iconsTabBar/iconTabCrowloanFilled.imageset/iconTabCrowloanFilled.pdf and /dev/null differ diff --git a/novawallet/Assets.xcassets/iconsTabBar/iconTabVote.imageset/Contents.json b/novawallet/Assets.xcassets/iconsTabBar/iconTabVote.imageset/Contents.json new file mode 100644 index 0000000000..4957ed23ae --- /dev/null +++ b/novawallet/Assets.xcassets/iconsTabBar/iconTabVote.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconTabVote.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconsTabBar/iconTabVote.imageset/iconTabVote.pdf b/novawallet/Assets.xcassets/iconsTabBar/iconTabVote.imageset/iconTabVote.pdf new file mode 100644 index 0000000000..dd36e63ee6 Binary files /dev/null and b/novawallet/Assets.xcassets/iconsTabBar/iconTabVote.imageset/iconTabVote.pdf differ diff --git a/novawallet/Assets.xcassets/iconsTabBar/iconTabVoteFilled.imageset/Contents.json b/novawallet/Assets.xcassets/iconsTabBar/iconTabVoteFilled.imageset/Contents.json new file mode 100644 index 0000000000..5a701f427d --- /dev/null +++ b/novawallet/Assets.xcassets/iconsTabBar/iconTabVoteFilled.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "iconTabFilled.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/novawallet/Assets.xcassets/iconsTabBar/iconTabVoteFilled.imageset/iconTabFilled.pdf b/novawallet/Assets.xcassets/iconsTabBar/iconTabVoteFilled.imageset/iconTabFilled.pdf new file mode 100644 index 0000000000..e325ebffdd Binary files /dev/null and b/novawallet/Assets.xcassets/iconsTabBar/iconTabVoteFilled.imageset/iconTabFilled.pdf differ diff --git a/novawallet/Common/Configs/ApplicationConfigs.swift b/novawallet/Common/Configs/ApplicationConfigs.swift index d532093f61..feea4c6d04 100644 --- a/novawallet/Common/Configs/ApplicationConfigs.swift +++ b/novawallet/Common/Configs/ApplicationConfigs.swift @@ -22,6 +22,7 @@ protocol ApplicationConfigProtocol { var chainListURL: URL { get } var xcmTransfersURL: URL { get } var dAppsListURL: URL { get } + var governanceDAppsListURL: URL { get } var commonTypesURL: URL { get } var learnPayoutURL: URL { get } var learnControllerAccountURL: URL { get } @@ -143,6 +144,14 @@ extension ApplicationConfig: ApplicationConfigProtocol { #endif } + var governanceDAppsListURL: URL { + #if F_RELEASE + URL(string: "https://raw.githubusercontent.com/nova-wallet/nova-utils/master/governance/dapps.json")! + #else + URL(string: "https://raw.githubusercontent.com/nova-wallet/nova-utils/master/governance/dapps_dev.json")! + #endif + } + var canDebugDApp: Bool { #if F_RELEASE false diff --git a/novawallet/Common/DataProvider/GovMetadataLocalSubscriptionFactory.swift b/novawallet/Common/DataProvider/GovMetadataLocalSubscriptionFactory.swift new file mode 100644 index 0000000000..fb6337f676 --- /dev/null +++ b/novawallet/Common/DataProvider/GovMetadataLocalSubscriptionFactory.swift @@ -0,0 +1,171 @@ +import Foundation +import RobinHood + +typealias ReferendumMetadataMapping = [ReferendumIdLocal: ReferendumMetadataLocal] + +protocol GovMetadataLocalSubscriptionFactoryProtocol: AnyObject { + func getMetadataProvider( + for option: GovernanceSelectedOption + ) -> StreamableProvider? + + func getMetadataProvider( + for option: GovernanceSelectedOption, + referendumId: ReferendumIdLocal + ) -> StreamableProvider? +} + +final class GovMetadataLocalSubscriptionFactory { + private var providers: [String: WeakWrapper] = [:] + + let storageFacade: StorageFacadeProtocol + let operationQueue: OperationQueue + let logger: LoggerProtocol + + init(storageFacade: StorageFacadeProtocol, operationQueue: OperationQueue, logger: LoggerProtocol) { + self.storageFacade = storageFacade + self.operationQueue = operationQueue + self.logger = logger + } + + private func createOperationFactory( + for apiType: GovernanceOffchainApi, + url: URL, + chainId: ChainModel.Id + ) -> PolkassemblyOperationFactoryProtocol { + switch apiType { + case .polkassembly: + return PolkassemblyChainOperationFactory( + chainId: chainId, + url: url + ) + } + } +} + +extension GovMetadataLocalSubscriptionFactory: GovMetadataLocalSubscriptionFactoryProtocol { + func getMetadataProvider( + for option: GovernanceSelectedOption + ) -> StreamableProvider? { + guard + case .governanceV1 = option.type, + let governanceApi = option.chain.externalApi?.governance, + let apiType = GovernanceOffchainApi(rawValue: governanceApi.type) else { + return nil + } + + let chain = option.chain + + let chainId = chain.chainId + let url = governanceApi.url + + let identifier = "gov-metadata-preview" + chainId + + if let provider = providers[identifier]?.target as? StreamableProvider { + return provider + } + + let mapper = ReferendumMetadataMapper() + let repository = storageFacade.createRepository( + filter: NSPredicate.referendums(for: chainId), + sortDescriptors: [], + mapper: AnyCoreDataMapper(mapper) + ) + + let operationFactory = createOperationFactory(for: apiType, url: url, chainId: chainId) + + let source = ReferendumsMetadataPreviewProviderSource( + operationFactory: operationFactory, + repository: AnyDataProviderRepository(repository), + operationQueue: operationQueue + ) + + let observable = CoreDataContextObservable( + service: storageFacade.databaseService, + mapper: AnyCoreDataMapper(mapper), + predicate: { entity in + chainId == entity.chainId + } + ) + + observable.start { [weak self] error in + if let error = error { + self?.logger.error("Did receive error: \(error)") + } + } + + let provider = StreamableProvider( + source: AnyStreamableSource(source), + repository: AnyDataProviderRepository(repository), + observable: AnyDataProviderRepositoryObservable(observable), + operationManager: OperationManager(operationQueue: operationQueue) + ) + + providers[identifier] = WeakWrapper(target: provider) + + return provider + } + + func getMetadataProvider( + for option: GovernanceSelectedOption, + referendumId: ReferendumIdLocal + ) -> StreamableProvider? { + guard + case .governanceV1 = option.type, + let governanceApi = option.chain.externalApi?.governance, + let apiType = GovernanceOffchainApi(rawValue: governanceApi.type) else { + return nil + } + + let chainId = option.chain.chainId + let url = governanceApi.url + + let identifier = "gov-metadata-details" + chainId + String(referendumId) + + if let provider = providers[identifier]?.target as? StreamableProvider { + return provider + } + + let mapper = ReferendumMetadataMapper() + let repository = storageFacade.createRepository( + filter: NSPredicate.referendums(for: chainId, referendumId: referendumId), + sortDescriptors: [], + mapper: AnyCoreDataMapper(mapper) + ) + + let operationFactory = createOperationFactory(for: apiType, url: url, chainId: chainId) + + let source = ReferendumMetadataDetailsProviderSource( + chainId: chainId, + referendumId: referendumId, + operationFactory: operationFactory, + repository: AnyDataProviderRepository(repository), + operationQueue: operationQueue + ) + + let observable = CoreDataContextObservable( + service: storageFacade.databaseService, + mapper: AnyCoreDataMapper(mapper), + predicate: { entity in + chainId == entity.chainId && + referendumId == entity.referendumId + } + ) + + observable.start { [weak self] error in + if let error = error { + self?.logger.error("Did receive error: \(error)") + } + } + + let provider = StreamableProvider( + source: AnyStreamableSource(source), + repository: AnyDataProviderRepository(repository), + observable: AnyDataProviderRepositoryObservable(observable), + operationManager: OperationManager(operationQueue: operationQueue) + ) + + providers[identifier] = WeakWrapper(target: provider) + + return provider + } +} diff --git a/novawallet/Common/DataProvider/Sources/Governance/ReferendumMetadataDetailsProviderSource.swift b/novawallet/Common/DataProvider/Sources/Governance/ReferendumMetadataDetailsProviderSource.swift new file mode 100644 index 0000000000..ee19837547 --- /dev/null +++ b/novawallet/Common/DataProvider/Sources/Governance/ReferendumMetadataDetailsProviderSource.swift @@ -0,0 +1,96 @@ +import Foundation +import RobinHood +import SubstrateSdk + +final class ReferendumMetadataDetailsProviderSource { + typealias Model = ReferendumMetadataLocal + + let chainId: ChainModel.Id + let referendumId: ReferendumIdLocal + let operationFactory: PolkassemblyOperationFactoryProtocol + let repository: AnyDataProviderRepository + let operationQueue: OperationQueue + + init( + chainId: ChainModel.Id, + referendumId: ReferendumIdLocal, + operationFactory: PolkassemblyOperationFactoryProtocol, + repository: AnyDataProviderRepository, + operationQueue: OperationQueue + ) { + self.chainId = chainId + self.referendumId = referendumId + self.operationFactory = operationFactory + self.repository = repository + self.operationQueue = operationQueue + } +} + +extension ReferendumMetadataDetailsProviderSource: StreamableSourceProtocol { + func fetchHistory( + runningIn queue: DispatchQueue?, + commitNotificationBlock: ((Result?) -> Void)? + ) { + guard let closure = commitNotificationBlock else { + return + } + + let result: Result = Result.success(0) + + if let queue = queue { + queue.async { + closure(result) + } + } else { + closure(result) + } + } + + func refresh( + runningIn queue: DispatchQueue?, + commitNotificationBlock: ((Result?) -> Void)? + ) { + let remoteFetchOperation = operationFactory.createDetailsOperation(for: referendumId) + + let identifier = ReferendumMetadataLocal.identifier(from: chainId, referendumId: referendumId) + let saveOperation = repository.saveOperation({ + let optItem = try remoteFetchOperation.extractNoCancellableResultData() + if let item = optItem { + return [item] + } else { + return [] + } + }, { + let optItem = try remoteFetchOperation.extractNoCancellableResultData() + + if optItem == nil { + return [identifier] + } else { + return [] + } + }) + + saveOperation.addDependency(remoteFetchOperation) + + saveOperation.completionBlock = { + do { + try saveOperation.extractNoCancellableResultData() + + let item = try remoteFetchOperation.extractNoCancellableResultData() + let count = item != nil ? 1 : 0 + + dispatchInQueueWhenPossible(queue) { + commitNotificationBlock?(.success(count)) + } + } catch { + dispatchInQueueWhenPossible(queue) { + commitNotificationBlock?(.failure(error)) + } + } + } + + let operations = [remoteFetchOperation, saveOperation] + + operationQueue.addOperations(operations, waitUntilFinished: false) + } +} diff --git a/novawallet/Common/DataProvider/Sources/Governance/ReferendumsMetadataPreviewProviderSource.swift b/novawallet/Common/DataProvider/Sources/Governance/ReferendumsMetadataPreviewProviderSource.swift new file mode 100644 index 0000000000..43e07a2df6 --- /dev/null +++ b/novawallet/Common/DataProvider/Sources/Governance/ReferendumsMetadataPreviewProviderSource.swift @@ -0,0 +1,97 @@ +import Foundation +import RobinHood +import SubstrateSdk + +final class ReferendumsMetadataPreviewProviderSource { + typealias Model = ReferendumMetadataLocal + + let operationFactory: PolkassemblyOperationFactoryProtocol + let repository: AnyDataProviderRepository + let operationQueue: OperationQueue + + init( + operationFactory: PolkassemblyOperationFactoryProtocol, + repository: AnyDataProviderRepository, + operationQueue: OperationQueue + ) { + self.operationFactory = operationFactory + self.repository = repository + self.operationQueue = operationQueue + } +} + +extension ReferendumsMetadataPreviewProviderSource: StreamableSourceProtocol { + func fetchHistory( + runningIn queue: DispatchQueue?, + commitNotificationBlock: ((Result?) -> Void)? + ) { + guard let closure = commitNotificationBlock else { + return + } + + let result: Result = Result.success(0) + + if let queue = queue { + queue.async { + closure(result) + } + } else { + closure(result) + } + } + + func refresh( + runningIn queue: DispatchQueue?, + commitNotificationBlock: ((Result?) -> Void)? + ) { + let remoteFetchOperation = operationFactory.createPreviewsOperation() + let localFetchOperation = repository.fetchAllOperation(with: RepositoryFetchOptions()) + + let changesOperation = ClosureOperation<[ReferendumMetadataLocal]> { + let localItems = try localFetchOperation.extractNoCancellableResultData().reduceToDict() + let remoteItems = try remoteFetchOperation.extractNoCancellableResultData() + + return remoteItems.map { remoteItem in + let localItem = localItems[remoteItem.identifier] + + return ReferendumMetadataLocal( + chainId: remoteItem.chainId, + referendumId: remoteItem.referendumId, + title: remoteItem.title, + content: localItem?.content, + proposer: localItem?.proposer, + timeline: localItem?.timeline + ) + } + } + + changesOperation.addDependency(remoteFetchOperation) + changesOperation.addDependency(localFetchOperation) + + let saveOperation = repository.replaceOperation { + try changesOperation.extractNoCancellableResultData() + } + + saveOperation.addDependency(changesOperation) + + saveOperation.completionBlock = { + do { + try saveOperation.extractNoCancellableResultData() + + let count = try changesOperation.extractNoCancellableResultData().count + + dispatchInQueueWhenPossible(queue) { + commitNotificationBlock?(.success(count)) + } + } catch { + dispatchInQueueWhenPossible(queue) { + commitNotificationBlock?(.failure(error)) + } + } + } + + let operations = [remoteFetchOperation, localFetchOperation, changesOperation, saveOperation] + + operationQueue.addOperations(operations, waitUntilFinished: false) + } +} diff --git a/novawallet/Common/DataProvider/Sources/StorageProviderSource.swift b/novawallet/Common/DataProvider/Sources/StorageProviderSource.swift index 945c62fc64..e3ffe1b259 100644 --- a/novawallet/Common/DataProvider/Sources/StorageProviderSource.swift +++ b/novawallet/Common/DataProvider/Sources/StorageProviderSource.swift @@ -52,15 +52,18 @@ final class StorageProviderSource: DataProviderSourceP // MARK: Private private func replaceAndNotifyIfNeeded(_ newItem: ChainStorageItem?) { - let newValue = LastSeen.received(value: newItem) - if newValue != lastSeenResult || lastSeenError != nil { - lock.lock() + lock.lock() + let newValue = LastSeen.received(value: newItem) + let shouldUpdate = newValue != lastSeenResult || lastSeenError != nil + if shouldUpdate { lastSeenError = nil lastSeenResult = newValue + } - lock.unlock() + lock.unlock() + if shouldUpdate { trigger.delegate?.didTrigger() } } diff --git a/novawallet/Common/DataProvider/Subscription/GovMetadataLocalStorageHandler.swift b/novawallet/Common/DataProvider/Subscription/GovMetadataLocalStorageHandler.swift new file mode 100644 index 0000000000..6d8958b3d0 --- /dev/null +++ b/novawallet/Common/DataProvider/Subscription/GovMetadataLocalStorageHandler.swift @@ -0,0 +1,28 @@ +import Foundation +import RobinHood + +protocol GovMetadataLocalStorageHandler: AnyObject { + func handleGovernanceMetadataPreview( + result: Result<[DataProviderChange], Error>, + option: GovernanceSelectedOption + ) + + func handleGovernanceMetadataDetails( + result: Result, + option: GovernanceSelectedOption, + referendumId: ReferendumIdLocal + ) +} + +extension GovMetadataLocalStorageHandler { + func handleGovernanceMetadataPreview( + result _: Result<[DataProviderChange], Error>, + option _: GovernanceSelectedOption + ) {} + + func handleGovernanceMetadataDetails( + result _: Result, + option _: GovernanceSelectedOption, + referendumId _: ReferendumIdLocal + ) {} +} diff --git a/novawallet/Common/DataProvider/Subscription/GovMetadataLocalStorageSubscriber.swift b/novawallet/Common/DataProvider/Subscription/GovMetadataLocalStorageSubscriber.swift new file mode 100644 index 0000000000..6e36cbe26c --- /dev/null +++ b/novawallet/Common/DataProvider/Subscription/GovMetadataLocalStorageSubscriber.swift @@ -0,0 +1,116 @@ +import Foundation +import RobinHood + +protocol GovMetadataLocalStorageSubscriber: AnyObject { + var govMetadataLocalSubscriptionFactory: GovMetadataLocalSubscriptionFactoryProtocol { get } + + var govMetadataLocalSubscriptionHandler: GovMetadataLocalStorageHandler { get } + + func subscribeGovernanceMetadata( + for option: GovernanceSelectedOption + ) -> StreamableProvider? + + func subscribeGovernanceMetadata( + for option: GovernanceSelectedOption, + referendumId: ReferendumIdLocal + ) -> StreamableProvider? +} + +extension GovMetadataLocalStorageSubscriber { + func subscribeGovernanceMetadata( + for option: GovernanceSelectedOption + ) -> StreamableProvider? { + guard let provider = govMetadataLocalSubscriptionFactory.getMetadataProvider(for: option) else { + return nil + } + + let updateClosure: ([DataProviderChange]) -> Void + updateClosure = { [weak self] changes in + self?.govMetadataLocalSubscriptionHandler.handleGovernanceMetadataPreview( + result: .success(changes), + option: option + ) + return + } + + let failureClosure: (Error) -> Void = { [weak self] error in + self?.govMetadataLocalSubscriptionHandler.handleGovernanceMetadataPreview( + result: .failure(error), + option: option + ) + return + } + + let options = StreamableProviderObserverOptions( + alwaysNotifyOnRefresh: false, + waitsInProgressSyncOnAdd: false, + initialSize: 0, + refreshWhenEmpty: true + ) + + provider.addObserver( + self, + deliverOn: .main, + executing: updateClosure, + failing: failureClosure, + options: options + ) + + return provider + } + + func subscribeGovernanceMetadata( + for option: GovernanceSelectedOption, + referendumId: ReferendumIdLocal + ) -> StreamableProvider? { + guard + let provider = govMetadataLocalSubscriptionFactory.getMetadataProvider( + for: option, + referendumId: referendumId + ) else { + return nil + } + + let updateClosure: ([DataProviderChange]) -> Void + updateClosure = { [weak self] changes in + let item = changes.reduceToLastChange() + + self?.govMetadataLocalSubscriptionHandler.handleGovernanceMetadataDetails( + result: .success(item), + option: option, + referendumId: referendumId + ) + return + } + + let failureClosure: (Error) -> Void = { [weak self] error in + self?.govMetadataLocalSubscriptionHandler.handleGovernanceMetadataDetails( + result: .failure(error), + option: option, + referendumId: referendumId + ) + return + } + + let options = StreamableProviderObserverOptions( + alwaysNotifyOnRefresh: false, + waitsInProgressSyncOnAdd: false, + initialSize: 0, + refreshWhenEmpty: true + ) + + provider.addObserver( + self, + deliverOn: .main, + executing: updateClosure, + failing: failureClosure, + options: options + ) + + return provider + } +} + +extension GovMetadataLocalStorageSubscriber where Self: GovMetadataLocalStorageHandler { + var govMetadataLocalSubscriptionHandler: GovMetadataLocalStorageHandler { self } +} diff --git a/novawallet/Common/Extension/Foundation/Data+Fill.swift b/novawallet/Common/Extension/Foundation/Data+Fill.swift new file mode 100644 index 0000000000..4e338a02a3 --- /dev/null +++ b/novawallet/Common/Extension/Foundation/Data+Fill.swift @@ -0,0 +1,13 @@ +import Foundation + +extension Data { + func fillRightWithZeros(ifLess size: Int) -> Data { + guard count < size else { + return self + } + + let neededZeros = size - count + + return self + Data(repeating: 0, count: neededZeros) + } +} diff --git a/novawallet/Common/Extension/Foundation/DateFormatter.swift b/novawallet/Common/Extension/Foundation/DateFormatter.swift index c0ef02b587..b5d6705adb 100644 --- a/novawallet/Common/Extension/Foundation/DateFormatter.swift +++ b/novawallet/Common/Extension/Foundation/DateFormatter.swift @@ -31,4 +31,30 @@ extension DateFormatter { return dateFormatter } } + + static var shortDateAndTime: LocalizableResource { + LocalizableResource { locale in + let format = DateFormatter.dateFormat(fromTemplate: "ddMMMyyyyHHmmss", options: 0, locale: locale) + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = format + dateFormatter.locale = locale + return dateFormatter + } + } +} + +extension DateComponentsFormatter { + static var fullTime: LocalizableResource { + LocalizableResource { locale in + var calendar = Calendar.current + calendar.locale = locale + let dateFormatter = DateComponentsFormatter() + dateFormatter.allowedUnits = [.hour, .minute, .second] + dateFormatter.unitsStyle = .positional + dateFormatter.zeroFormattingBehavior = .pad + dateFormatter.calendar = calendar + + return dateFormatter + } + } } diff --git a/novawallet/Common/Extension/Foundation/Decimal+Conversion.swift b/novawallet/Common/Extension/Foundation/Decimal+Conversion.swift index d1c0266a6b..3b30f2b135 100644 --- a/novawallet/Common/Extension/Foundation/Decimal+Conversion.swift +++ b/novawallet/Common/Extension/Foundation/Decimal+Conversion.swift @@ -7,7 +7,20 @@ extension Decimal { return decimalValue.multiplying(byPowerOf10: -2).decimalValue } + static func fromFixedI64(value: Int64) -> Decimal { + Decimal(value) / 1_000_000_000 + } + init?(_ bigUInt: BigUInt) { self.init(string: String(bigUInt)) } + + func floor() -> Decimal { + var originValue = self + var rounded = Decimal() + + NSDecimalRound(&rounded, &originValue, 0, .down) + + return rounded + } } diff --git a/novawallet/Common/Extension/Foundation/NSPredicate+Filter.swift b/novawallet/Common/Extension/Foundation/NSPredicate+Filter.swift index 793a0d6d32..8d46b74259 100644 --- a/novawallet/Common/Extension/Foundation/NSPredicate+Filter.swift +++ b/novawallet/Common/Extension/Foundation/NSPredicate+Filter.swift @@ -309,4 +309,28 @@ extension NSPredicate { return NSCompoundPredicate(andPredicateWithSubpredicates: [chainPredicate, accountPredicate]) } + + static func referendums(for chainId: ChainModel.Id) -> NSPredicate { + NSPredicate( + format: "%K == %@", + #keyPath(CDReferendumMetadata.chainId), + chainId + ) + } + + static func referendums(for chainId: ChainModel.Id, referendumId: ReferendumIdLocal) -> NSPredicate { + let chainPredicate = NSPredicate( + format: "%K == %@", + #keyPath(CDReferendumMetadata.chainId), + chainId + ) + + let referendumPredicate = NSPredicate( + format: "%K == %d", + #keyPath(CDReferendumMetadata.referendumId), + referendumId + ) + + return NSCompoundPredicate(andPredicateWithSubpredicates: [chainPredicate, referendumPredicate]) + } } diff --git a/novawallet/Common/Extension/Foundation/NumberFormatter.swift b/novawallet/Common/Extension/Foundation/NumberFormatter.swift index 9c415359a2..f013207c90 100644 --- a/novawallet/Common/Extension/Foundation/NumberFormatter.swift +++ b/novawallet/Common/Extension/Foundation/NumberFormatter.swift @@ -71,6 +71,24 @@ extension NumberFormatter { return numberFormatter } + static var percentHalfEven: NumberFormatter { + let numberFormatter = percent + numberFormatter.roundingMode = .halfEven + return numberFormatter + } + + static var referendumPercent: NumberFormatter { + let numberFormatter = percentHalfEven + numberFormatter.minimumFractionDigits = 0 + return numberFormatter + } + + static var index: NumberFormatter { + let numberFormatter = quantity + numberFormatter.positivePrefix = "#" + return numberFormatter + } + static var quantity: NumberFormatter { let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal diff --git a/novawallet/Common/Extension/Foundation/String+Helpers.swift b/novawallet/Common/Extension/Foundation/String+Helpers.swift index 48671998e5..5c56470548 100644 --- a/novawallet/Common/Extension/Foundation/String+Helpers.swift +++ b/novawallet/Common/Extension/Foundation/String+Helpers.swift @@ -2,8 +2,17 @@ import Foundation extension String { static var returnKey: String { "\n" } + static var readMore: String { "..." } func firstLetterCapitalized() -> String { prefix(1).capitalized + dropFirst() } + + func convertToReadMore(after threshold: Int) -> String { + if count > threshold { + return String(prefix(threshold)) + String.readMore + } else { + return self + } + } } diff --git a/novawallet/Common/Extension/Foundation/String+Substrate.swift b/novawallet/Common/Extension/Foundation/String+Substrate.swift index 55d7da07f8..a692efa286 100644 --- a/novawallet/Common/Extension/Foundation/String+Substrate.swift +++ b/novawallet/Common/Extension/Foundation/String+Substrate.swift @@ -28,6 +28,20 @@ extension String { return replacedCamelCase } + func twoLineString(with threshold: Int) -> String { + guard count > threshold else { + return self + } + + let leftPartCount = count / 2 + + guard leftPartCount > 0 else { + return self + } + + return prefix(leftPartCount) + "\n" + suffix(count - leftPartCount) + } + var twoLineAddress: String { let leftPartCount = count / 2 diff --git a/novawallet/Common/Extension/Foundation/TimeInterval+Localization.swift b/novawallet/Common/Extension/Foundation/TimeInterval+Localization.swift index cdcfc415c2..a87b82af41 100644 --- a/novawallet/Common/Extension/Foundation/TimeInterval+Localization.swift +++ b/novawallet/Common/Extension/Foundation/TimeInterval+Localization.swift @@ -1,4 +1,5 @@ import Foundation +import SoraFoundation extension TimeInterval { func localizedDaysHours(for locale: Locale) -> String { @@ -25,6 +26,51 @@ extension TimeInterval { return components.joined(separator: " ") } + + func localizedDaysHoursIncludingZero(for locale: Locale) -> String { + let days = daysFromSeconds + let hours = (self - TimeInterval(days).secondsFromDays).hoursFromSeconds + + guard days > 0 || hours > 0 else { + return R.string.localizable.commonDaysFormat(format: 0, preferredLanguages: locale.rLanguages) + } + + return localizedDaysHours(for: locale) + } + + func localizedFractionDays(for locale: Locale, shouldAnnotate: Bool) -> String { + let days = fractionDaysFromSeconds + let formatter = NumberFormatter.decimalFormatter(precision: 1, rounding: .down) + formatter.locale = locale + let optDaysString = formatter.stringFromDecimal(days) + + if shouldAnnotate { + if let daysString = optDaysString { + return R.string.localizable.commonDaysFractionFormat( + daysString, + preferredLanguages: locale.rLanguages + ) + } else { + return "" + } + } else { + return optDaysString ?? "" + } + } + + func localizedDaysOrTime(for locale: Locale) -> String? { + let days = daysFromSeconds + + if days > 0 { + let daysString = R.string.localizable.commonDaysFormat( + format: days, preferredLanguages: locale.rLanguages + ) + return daysString + } else { + let formatter = DateComponentsFormatter.fullTime + return formatter.value(for: locale).string(from: self) + } + } } extension UInt { diff --git a/novawallet/Common/Extension/Foundation/TimeInterval+Time.swift b/novawallet/Common/Extension/Foundation/TimeInterval+Time.swift index 1d742c7c6f..94c84c5538 100644 --- a/novawallet/Common/Extension/Foundation/TimeInterval+Time.swift +++ b/novawallet/Common/Extension/Foundation/TimeInterval+Time.swift @@ -16,8 +16,10 @@ extension TimeInterval { var seconds: TimeInterval { self / 1000 } var minutesFromSeconds: Int { Int(self / Self.secondsInMinute) } var daysFromSeconds: Int { Int(self / Self.secondsInDay) } + var fractionDaysFromSeconds: Decimal { Decimal(self) / Decimal(Self.secondsInDay) } var secondsFromDays: TimeInterval { self * Self.secondsInDay } var hoursFromSeconds: Int { Int(self / Self.secondsInHour) } + var secondsFromHours: TimeInterval { self * Self.secondsInHour } var intervalsInDay: Int { self > 0.0 ? Int(Self.secondsInDay / self) : 0 } func roundingUpToHour() -> TimeInterval { diff --git a/novawallet/Common/Extension/SettingsExtension.swift b/novawallet/Common/Extension/SettingsExtension.swift index c4a468aad4..7c46fb768a 100644 --- a/novawallet/Common/Extension/SettingsExtension.swift +++ b/novawallet/Common/Extension/SettingsExtension.swift @@ -10,6 +10,8 @@ enum SettingsKey: String { case stakingNetworkExpansion case hidesZeroBalances case selectedCurrency + case governanceChainId + case governanceType } extension SettingsManagerProtocol { @@ -41,6 +43,41 @@ extension SettingsManagerProtocol { } } + var governanceChainId: String? { + get { + string(for: SettingsKey.governanceChainId.rawValue) + } + + set { + if let existingValue = newValue { + set(value: existingValue, for: SettingsKey.governanceChainId.rawValue) + } else { + removeValue(for: SettingsKey.governanceChainId.rawValue) + } + } + } + + var governanceType: GovernanceType? { + get { + if let rawValue = string(for: SettingsKey.governanceType.rawValue) { + return GovernanceType(rawValue: rawValue) + } else { + return nil + } + } + + set { + if let existingValue = newValue { + set( + value: existingValue.rawValue, + for: SettingsKey.governanceType.rawValue + ) + } else { + removeValue(for: SettingsKey.governanceType.rawValue) + } + } + } + var stakingAsset: ChainAssetId? { get { value(of: ChainAssetId.self, for: SettingsKey.stakingAsset.rawValue) diff --git a/novawallet/Common/Extension/SubstrateSdk/CallMetadata+TypeCheck.swift b/novawallet/Common/Extension/SubstrateSdk/CallMetadata+TypeCheck.swift new file mode 100644 index 0000000000..4f83ab47d1 --- /dev/null +++ b/novawallet/Common/Extension/SubstrateSdk/CallMetadata+TypeCheck.swift @@ -0,0 +1,12 @@ +import Foundation +import SubstrateSdk + +extension CallMetadata { + func isArgumentTypeOf(_ name: String, closure: (String) -> Bool) -> Bool { + guard let argument = arguments.first(where: { $0.name == name }) else { + return false + } + + return closure(argument.type) + } +} diff --git a/novawallet/Common/Extension/SubstrateSdk/CodingFactory+TypeCheck.swift b/novawallet/Common/Extension/SubstrateSdk/CodingFactory+TypeCheck.swift new file mode 100644 index 0000000000..46ba7cde1d --- /dev/null +++ b/novawallet/Common/Extension/SubstrateSdk/CodingFactory+TypeCheck.swift @@ -0,0 +1,24 @@ +import Foundation +import SubstrateSdk + +extension RuntimeCoderFactoryProtocol { + func isBytesArrayType(_ type: String) -> Bool { + guard let vectorNode = getTypeNode(for: type) as? VectorNode else { + return false + } + + return getTypeNode(for: vectorNode.underlying.typeName) is U8Node + } + + func isUInt64Type(_ type: String) -> Bool { + getTypeNode(for: type) is U64Node + } + + func isStructHasFieldsCount(_ type: String, count: Int) -> Bool { + guard let structNode = getTypeNode(for: type) as? StructNode else { + return false + } + + return structNode.typeMapping.count == count + } +} diff --git a/novawallet/Common/Extension/SubstrateSdk/StorageEntryMetadata+TypeCheck.swift b/novawallet/Common/Extension/SubstrateSdk/StorageEntryMetadata+TypeCheck.swift new file mode 100644 index 0000000000..a6d86d9d1d --- /dev/null +++ b/novawallet/Common/Extension/SubstrateSdk/StorageEntryMetadata+TypeCheck.swift @@ -0,0 +1,26 @@ +import Foundation +import SubstrateSdk + +extension RuntimeMetadataProtocol { + func isMapStorageKeyOfType(_ storagePath: StorageCodingPath, closure: (String) -> Bool) -> Bool { + guard let storage = getStorageMetadata( + in: storagePath.moduleName, + storageName: storagePath.itemName + ) else { + return false + } + + return storage.isMapKeyOfType(closure) + } +} + +extension StorageEntryMetadata { + func isMapKeyOfType(_ closure: (String) -> Bool) -> Bool { + switch type { + case let .map(entry): + return closure(entry.key) + default: + return false + } + } +} diff --git a/novawallet/Common/Extension/UIKit/UITableView+Reuse.swift b/novawallet/Common/Extension/UIKit/UITableView+Reuse.swift index 3081cbd546..21eb7f65af 100644 --- a/novawallet/Common/Extension/UIKit/UITableView+Reuse.swift +++ b/novawallet/Common/Extension/UIKit/UITableView+Reuse.swift @@ -5,6 +5,11 @@ extension UITableView { register(cellClass, forCellReuseIdentifier: cellClass.reuseIdentifier) } + func unregisterClassForCell(_ cellClass: UITableViewCell.Type) { + let registeredClass: UITableViewCell.Type? = nil + register(registeredClass, forCellReuseIdentifier: cellClass.reuseIdentifier) + } + func registerClassesForCell(_ cellClasses: [UITableViewCell.Type]) { cellClasses.forEach { cellClass in register(cellClass, forCellReuseIdentifier: cellClass.reuseIdentifier) @@ -15,6 +20,11 @@ extension UITableView { register(viewClass, forHeaderFooterViewReuseIdentifier: viewClass.reuseIdentifier) } + func unregisterHeaderFooterView(withClass viewClass: UITableViewHeaderFooterView.Type) { + let registeredView: UITableViewHeaderFooterView.Type? = nil + register(registeredView, forHeaderFooterViewReuseIdentifier: viewClass.reuseIdentifier) + } + func dequeueReusableCellWithType(_ cellClass: T.Type) -> T? { dequeueReusableCell(withIdentifier: cellClass.reuseIdentifier) as? T } diff --git a/novawallet/Common/Helpers/NotEqualWrapper.swift b/novawallet/Common/Helpers/NotEqualWrapper.swift new file mode 100644 index 0000000000..c7c931c4e9 --- /dev/null +++ b/novawallet/Common/Helpers/NotEqualWrapper.swift @@ -0,0 +1,9 @@ +import Foundation + +struct NotEqualWrapper: Equatable { + let value: V + + static func == (_: NotEqualWrapper, _: NotEqualWrapper) -> Bool { + false + } +} diff --git a/novawallet/Common/Helpers/StorageSubscriptionObserver.swift b/novawallet/Common/Helpers/StorageSubscriptionObserver.swift new file mode 100644 index 0000000000..f3ff8a2e98 --- /dev/null +++ b/novawallet/Common/Helpers/StorageSubscriptionObserver.swift @@ -0,0 +1,11 @@ +import Foundation + +final class StorageSubscriptionObserver: Observable { + let subscription: CallbackStorageSubscription + + init(subscription: CallbackStorageSubscription) { + self.subscription = subscription + + super.init(state: nil) + } +} diff --git a/novawallet/Common/Ledger/SupportedLedgerApps.swift b/novawallet/Common/Ledger/SupportedLedgerApps.swift index e6ed95098a..c9cf2f7b95 100644 --- a/novawallet/Common/Ledger/SupportedLedgerApps.swift +++ b/novawallet/Common/Ledger/SupportedLedgerApps.swift @@ -19,6 +19,9 @@ extension SupportedLedgerApp { SupportedLedgerApp(chainId: KnowChainId.kusama, coin: 434, cla: 0x99, type: .substrate), SupportedLedgerApp(chainId: KnowChainId.statemint, coin: 354, cla: 0x96, type: .substrate), SupportedLedgerApp(chainId: KnowChainId.statemine, coin: 434, cla: 0x97, type: .substrate), + SupportedLedgerApp(chainId: KnowChainId.karura, coin: 686, cla: 0x9A, type: .substrate), + SupportedLedgerApp(chainId: KnowChainId.acala, coin: 787, cla: 0x9B, type: .substrate), + SupportedLedgerApp(chainId: KnowChainId.nodle, coin: 1003, cla: 0x98, type: .substrate), SupportedLedgerApp(chainId: KnowChainId.edgeware, coin: 523, cla: 0x94, type: .substrate) ] } diff --git a/novawallet/Common/Migration/SubstrateStorageVersion.swift b/novawallet/Common/Migration/SubstrateStorageVersion.swift index 70e23a87f5..8aaa68d99e 100644 --- a/novawallet/Common/Migration/SubstrateStorageVersion.swift +++ b/novawallet/Common/Migration/SubstrateStorageVersion.swift @@ -1,6 +1,9 @@ enum SubstrateStorageVersion: String, CaseIterable { case version1 = "SubstrateDataModel" case version2 = "SubstrateDataModel2" + case version3 = "SubstrateDataModel3" + case version4 = "SubstrateDataModel4" + case version5 = "SubstrateDataModel5" static var current: SubstrateStorageVersion { allCases.last! @@ -11,6 +14,12 @@ enum SubstrateStorageVersion: String, CaseIterable { case .version1: return .version2 case .version2: + return .version3 + case .version3: + return .version4 + case .version4: + return .version5 + case .version5: return nil } } diff --git a/novawallet/Common/Model/AssetBalance.swift b/novawallet/Common/Model/AssetBalance.swift index 6e3171623f..f768e55805 100644 --- a/novawallet/Common/Model/AssetBalance.swift +++ b/novawallet/Common/Model/AssetBalance.swift @@ -12,6 +12,10 @@ struct AssetBalance: Equatable { var totalInPlank: BigUInt { freeInPlank + reservedInPlank } var transferable: BigUInt { freeInPlank > frozenInPlank ? freeInPlank - frozenInPlank : 0 } var locked: BigUInt { frozenInPlank + reservedInPlank } + + func newTransferable(for frozen: BigUInt) -> BigUInt { + freeInPlank > frozen ? freeInPlank - frozen : 0 + } } extension AssetBalance: Identifiable { diff --git a/novawallet/Common/Model/BalanceLockType.swift b/novawallet/Common/Model/BalanceLockType.swift index 8eb19e293c..66490654c8 100644 --- a/novawallet/Common/Model/BalanceLockType.swift +++ b/novawallet/Common/Model/BalanceLockType.swift @@ -6,6 +6,7 @@ enum LockType: String { case vesting case democracy = "democrac" case elections = "phrelect" + case governance = "pyconvot" static var locksOrder: [Self] = [.vesting, .staking, .democracy, .elections] @@ -20,7 +21,7 @@ enum LockType: String { return R.string.localizable.stakingTitle( preferredLanguages: locale.rLanguages ) - case .democracy: + case .democracy, .governance: return R.string.localizable.walletAccountLocksDemocracy( preferredLanguages: locale.rLanguages ) diff --git a/novawallet/Common/Model/BlockWeights.swift b/novawallet/Common/Model/BlockWeights.swift index 3670c6901a..8b1bd7a229 100644 --- a/novawallet/Common/Model/BlockWeights.swift +++ b/novawallet/Common/Model/BlockWeights.swift @@ -1,12 +1,18 @@ import Foundation import SubstrateSdk +import BigInt enum BlockchainWeight { typealias WeightV1 = StringScaleMapper - struct WeightV2: Decodable { + struct WeightV1P5: Codable { @StringCodable var refTime: UInt64 } + + struct WeightV2: Codable { + @StringCodable var refTime: BigUInt + @StringCodable var proofSize: UInt64 + } } struct BlockWeights: Decodable { @@ -19,7 +25,7 @@ struct BlockWeights: Decodable { init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - if let weight = try? container.decode(BlockchainWeight.WeightV2.self, forKey: .maxBlock) { + if let weight = try? container.decode(BlockchainWeight.WeightV1P5.self, forKey: .maxBlock) { maxBlock = weight.refTime } else { maxBlock = try container.decode(BlockchainWeight.WeightV1.self, forKey: .maxBlock).value diff --git a/novawallet/Common/Model/ChainRegistry/ChainModel.swift b/novawallet/Common/Model/ChainRegistry/ChainModel.swift index 4abad4b479..95f6841e81 100644 --- a/novawallet/Common/Model/ChainRegistry/ChainModel.swift +++ b/novawallet/Common/Model/ChainRegistry/ChainModel.swift @@ -21,6 +21,7 @@ struct ChainModel: Equatable, Codable, Hashable { let staking: ExternalApi? let history: ExternalApi? let crowdloans: ExternalApi? + let governance: ExternalApi? } struct Explorer: Codable, Hashable { @@ -119,6 +120,18 @@ struct ChainModel: Equatable, Codable, Hashable { options?.contains(.crowdloans) ?? false } + var hasGovernance: Bool { + options?.contains(where: { $0 == .governance || $0 == .governanceV1 }) ?? false + } + + var hasGovernanceV1: Bool { + options?.contains(where: { $0 == .governanceV1 }) ?? false + } + + var hasGovernanceV2: Bool { + options?.contains(where: { $0 == .governance }) ?? false + } + var isRelaychain: Bool { parentId == nil } func utilityAssets() -> Set { @@ -129,6 +142,18 @@ struct ChainModel: Equatable, Codable, Hashable { utilityAssets().first } + func utilityAssetDisplayInfo() -> AssetBalanceDisplayInfo? { + utilityAsset()?.displayInfo(with: icon) + } + + func utilityChainAssetId() -> ChainAssetId? { + guard let utilityAsset = utilityAssets().first else { + return nil + } + + return ChainAssetId(chainId: chainId, assetId: utilityAsset.assetId) + } + var typesUsage: TypesUsage { if let types = types { return types.overridesCommon ? .onlyOwn : .both @@ -154,4 +179,6 @@ enum ChainOptions: String, Codable { case ethereumBased case testnet case crowdloans + case governance + case governanceV1 = "governance-v1" } diff --git a/novawallet/Common/Model/KnownChainIds.swift b/novawallet/Common/Model/KnownChainIds.swift index c78bb04cc3..00031049c3 100644 --- a/novawallet/Common/Model/KnownChainIds.swift +++ b/novawallet/Common/Model/KnownChainIds.swift @@ -7,4 +7,6 @@ enum KnowChainId { static let acala = "fc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c" static let statemint = "68d56f15f85d3136970ec16946040bc1752654e906147f7e43e9d539d7c3de2f" static let edgeware = "742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b" + static let karura = "baf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b" + static let nodle = "97da7ede98d7bad4e36b4d734b6055425a3be036da2a332ea5a7037656427a21" } diff --git a/novawallet/Common/Model/MarkdownText.swift b/novawallet/Common/Model/MarkdownText.swift new file mode 100644 index 0000000000..f4632aa5db --- /dev/null +++ b/novawallet/Common/Model/MarkdownText.swift @@ -0,0 +1,10 @@ +import UIKit + +struct MarkdownText { + static let readMoreThreshold = 180 + + let originalString: String + let attributedString: NSAttributedString + let preferredSize: CGSize + let isFull: Bool +} diff --git a/novawallet/Common/Network/JSONRPC/RemoteStorageSizeRequest.swift b/novawallet/Common/Network/JSONRPC/RemoteStorageSizeRequest.swift new file mode 100644 index 0000000000..027c086ddb --- /dev/null +++ b/novawallet/Common/Network/JSONRPC/RemoteStorageSizeRequest.swift @@ -0,0 +1,5 @@ +import Foundation + +enum RemoteStorageSize { + static var method: String { "state_getStorageSize" } +} diff --git a/novawallet/Common/Network/JSONRPC/RuntimeDispatchInfo.swift b/novawallet/Common/Network/JSONRPC/RuntimeDispatchInfo.swift index 3e2e3324b1..2f039fa6f7 100644 --- a/novawallet/Common/Network/JSONRPC/RuntimeDispatchInfo.swift +++ b/novawallet/Common/Network/JSONRPC/RuntimeDispatchInfo.swift @@ -67,7 +67,7 @@ struct RemoteRuntimeDispatchInfo: Decodable { fee = try container.decode(StringScaleMapper.self, forKey: .fee).value - if let remoteWeight = try? container.decode(BlockchainWeight.WeightV2.self, forKey: .weight) { + if let remoteWeight = try? container.decode(BlockchainWeight.WeightV1P5.self, forKey: .weight) { weight = remoteWeight.refTime } else { weight = try container.decode(BlockchainWeight.WeightV1.self, forKey: .weight).value diff --git a/novawallet/Common/Network/Polkassembly/PolkassemblyOperationFactory.swift b/novawallet/Common/Network/Polkassembly/PolkassemblyOperationFactory.swift new file mode 100644 index 0000000000..22df28891e --- /dev/null +++ b/novawallet/Common/Network/Polkassembly/PolkassemblyOperationFactory.swift @@ -0,0 +1,162 @@ +import Foundation +import RobinHood +import SubstrateSdk + +protocol PolkassemblyOperationFactoryProtocol { + func createPreviewsOperation() -> BaseOperation<[ReferendumMetadataPreview]> + + func createDetailsOperation( + for referendumId: ReferendumIdLocal + ) -> BaseOperation +} + +final class PolkassemblyChainOperationFactory { + let chainId: ChainModel.Id + let url: URL + + init(chainId: ChainModel.Id, url: URL) { + self.chainId = chainId + self.url = url + } + + private func createPreviewQuery() -> String { + """ + { + posts( + where: {type: {id: {_eq: 2}}, onchain_link: {onchain_referendum_id: {_is_null: false}}} + ) { + title + onchain_link { + onchain_referendum_id + } + } + } + """ + } + + private func createDetailsQuery(for referendumId: ReferendumIdLocal) -> String { + """ + { + posts( + where: {onchain_link: {onchain_referendum_id: {_eq: \(referendumId)}}} + ) { + title + content + onchain_link { + onchain_referendum_id + proposer_address + onchain_referendum { + referendumStatus { + blockNumber { + number + } + status + } + } + } + } + } + """ + } + + private func createRequestFactory(for url: URL, query: String) -> NetworkRequestFactoryProtocol { + BlockNetworkRequestFactory { + var request = URLRequest(url: url) + let info = JSON.dictionaryValue(["query": JSON.stringValue(query)]) + request.httpBody = try JSONEncoder().encode(info) + request.setValue( + HttpContentType.json.rawValue, + forHTTPHeaderField: HttpHeaderKey.contentType.rawValue + ) + request.httpMethod = HttpMethod.post.rawValue + return request + } + } + + private func createPreviewResultFactory( + for chainId: ChainModel.Id + ) -> AnyNetworkResultFactory<[ReferendumMetadataPreview]> { + AnyNetworkResultFactory<[ReferendumMetadataPreview]> { data in + let resultData = try JSONDecoder().decode(JSON.self, from: data) + let nodes = resultData.data?.posts?.arrayValue ?? [] + + return nodes.compactMap { remotePreview in + let title = remotePreview.title?.stringValue + + guard let referendumId = remotePreview.onchain_link? + .onchain_referendum_id?.unsignedIntValue else { + return nil + } + + return .init( + chainId: chainId, + referendumId: ReferendumIdLocal(referendumId), + title: title + ) + } + } + } + + private func createDetailsResultFactory( + for chainId: ChainModel.Id + ) -> AnyNetworkResultFactory { + AnyNetworkResultFactory { data in + let resultData = try JSONDecoder().decode(JSON.self, from: data) + guard let remoteDetails = resultData.data?.posts?.arrayValue?.first else { + return nil + } + + let title = remoteDetails.title?.stringValue + let content = remoteDetails.content?.stringValue + let onChainLink = remoteDetails.onchain_link + + guard let referendumId = onChainLink?.onchain_referendum_id?.unsignedIntValue else { + return nil + } + + let proposer = onChainLink?.proposer_address?.stringValue + + let remoteTimeline = onChainLink?.onchain_referendum?.arrayValue?.first?.referendumStatus?.arrayValue + + let timeline: [ReferendumMetadataLocal.TimelineItem]? + timeline = remoteTimeline?.compactMap { item in + guard + let block = item.blockNumber?.number?.unsignedIntValue, + let status = item.status?.stringValue else { + return nil + } + + return .init(block: BlockNumber(block), status: status) + } + + return .init( + chainId: chainId, + referendumId: ReferendumIdLocal(referendumId), + title: title, + content: content, + proposer: proposer, + timeline: timeline + ) + } + } +} + +extension PolkassemblyChainOperationFactory: PolkassemblyOperationFactoryProtocol { + func createPreviewsOperation() -> BaseOperation<[ReferendumMetadataPreview]> { + let query = createPreviewQuery() + let requestFactory = createRequestFactory(for: url, query: query) + let resultFactory = createPreviewResultFactory(for: chainId) + + return NetworkOperation(requestFactory: requestFactory, resultFactory: resultFactory) + } + + func createDetailsOperation( + for referendumId: ReferendumIdLocal + ) -> BaseOperation { + let query = createDetailsQuery(for: referendumId) + let requestFactory = createRequestFactory(for: url, query: query) + let resultFactory = createDetailsResultFactory(for: chainId) + + return NetworkOperation(requestFactory: requestFactory, resultFactory: resultFactory) + } +} diff --git a/novawallet/Common/Operation/PrettyPrintedJSONOperationFactory.swift b/novawallet/Common/Operation/PrettyPrintedJSONOperationFactory.swift new file mode 100644 index 0000000000..fe3ff14582 --- /dev/null +++ b/novawallet/Common/Operation/PrettyPrintedJSONOperationFactory.swift @@ -0,0 +1,43 @@ +import Foundation +import SubstrateSdk +import RobinHood + +protocol PrettyPrintedJSONOperationFactoryProtocol { + func createProcessingOperation( + for json: JSON + ) -> BaseOperation +} + +final class PrettyPrintedJSONOperationFactory: PrettyPrintedJSONOperationFactoryProtocol { + let preprocessor: JSONPrettyPrinting + + init(preprocessor: JSONPrettyPrinting) { + self.preprocessor = preprocessor + } + + func createProcessingOperation( + for json: JSON + ) -> BaseOperation { + ClosureOperation { [weak self] in + guard let self = self else { + return "" + } + let prettyPrintedJson = self.preprocessor.prettyPrinted(from: json) + + if case let .stringValue(value) = prettyPrintedJson { + return value + } else { + let encoder = JSONEncoder() + encoder.outputFormatting = .prettyPrinted + + let data = try encoder.encode(prettyPrintedJson) + + if let displayString = String(data: data, encoding: .utf8) { + return displayString + } else { + throw CommonError.undefined + } + } + } + } +} diff --git a/novawallet/Common/Protocols/CopyPresentable.swift b/novawallet/Common/Protocols/CopyPresentable.swift new file mode 100644 index 0000000000..838f694a04 --- /dev/null +++ b/novawallet/Common/Protocols/CopyPresentable.swift @@ -0,0 +1,55 @@ +import Foundation +import SoraFoundation + +protocol CopyPresentable { + func presentCopy( + from view: ControllerBackedProtocol, + value: String, + locale: Locale + ) +} + +extension CopyPresentable where Self: AlertPresentable { + private func copyAddress( + from view: ControllerBackedProtocol, + value: String, + locale: Locale + ) { + UIPasteboard.general.string = value + + let title = R.string.localizable.commonCopied(preferredLanguages: locale.rLanguages) + let controller = ModalAlertFactory.createSuccessAlert(title) + + view.controller.present( + controller, + animated: true, + completion: nil + ) + } + + func presentCopy( + from view: ControllerBackedProtocol, + value: String, + locale: Locale + ) { + let copyTitle = R.string.localizable.commonCopy(preferredLanguages: locale.rLanguages) + + let title = value.twoLineString(with: 16) + + let action = AlertPresentableAction( + title: copyTitle, + style: .normal + ) { [weak self] in + self?.copyAddress(from: view, value: value, locale: locale) + } + + let viewModel = AlertPresentableViewModel( + title: title, + message: nil, + actions: [action], + closeAction: R.string.localizable.commonCancel(preferredLanguages: locale.rLanguages) + ) + + present(viewModel: viewModel, style: .actionSheet, from: view) + } +} diff --git a/novawallet/Common/Protocols/WebPresentable.swift b/novawallet/Common/Protocols/WebPresentable.swift index 40f7de5cbf..8b63a764be 100644 --- a/novawallet/Common/Protocols/WebPresentable.swift +++ b/novawallet/Common/Protocols/WebPresentable.swift @@ -13,6 +13,11 @@ protocol WebPresentable: AnyObject { extension WebPresentable { func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + let supportedSafariScheme = ["https", "http"] + guard let scheme = url.scheme, supportedSafariScheme.contains(scheme) else { + return + } + let webController = WebViewFactory.createWebViewController(for: url, style: style) view.controller.present(webController, animated: true, completion: nil) } diff --git a/novawallet/Common/Services/ChainRegistry/ConnectionPool/ConnectionPool.swift b/novawallet/Common/Services/ChainRegistry/ConnectionPool/ConnectionPool.swift index 25b43549ec..772f66b7d4 100644 --- a/novawallet/Common/Services/ChainRegistry/ConnectionPool/ConnectionPool.swift +++ b/novawallet/Common/Services/ChainRegistry/ConnectionPool/ConnectionPool.swift @@ -135,6 +135,12 @@ extension ConnectionPool: WebSocketEngineDelegate { extension ConnectionPool: ApplicationHandlerDelegate { func didReceiveDidBecomeActive(notification _: Notification) { + mutex.lock() + + defer { + mutex.unlock() + } + connections.values.forEach { wrapper in guard let connection = wrapper.target as? ChainConnection else { return @@ -145,6 +151,12 @@ extension ConnectionPool: ApplicationHandlerDelegate { } func didReceiveDidEnterBackground(notification _: Notification) { + mutex.lock() + + defer { + mutex.unlock() + } + connections.values.forEach { wrapper in guard let connection = wrapper.target as? ChainConnection else { return diff --git a/novawallet/Common/Services/ChainRegistry/RuntimeProviderPool/RuntimeCoderFactory.swift b/novawallet/Common/Services/ChainRegistry/RuntimeProviderPool/RuntimeCoderFactory.swift index da05d2f90f..a67e476e72 100644 --- a/novawallet/Common/Services/ChainRegistry/RuntimeProviderPool/RuntimeCoderFactory.swift +++ b/novawallet/Common/Services/ChainRegistry/RuntimeProviderPool/RuntimeCoderFactory.swift @@ -9,7 +9,10 @@ protocol RuntimeCoderFactoryProtocol { func createEncoder() -> DynamicScaleEncoding func createDecoder(from data: Data) throws -> DynamicScaleDecoding func createRuntimeJsonContext() -> RuntimeJsonContext + func hasType(for name: String) -> Bool + func getTypeNode(for name: String) -> Node? + func getCall(for codingPath: CallCodingPath) -> CallMetadata? } final class RuntimeCoderFactory: RuntimeCoderFactoryProtocol { @@ -57,4 +60,20 @@ final class RuntimeCoderFactory: RuntimeCoderFactoryProtocol { func hasType(for name: String) -> Bool { catalog.node(for: name, version: UInt64(specVersion)) != nil } + + func getTypeNode(for name: String) -> Node? { + let node = catalog.node(for: name, version: UInt64(specVersion)) + + if let aliasNode = node as? AliasNode { + return getTypeNode(for: aliasNode.underlyingTypeName) + } else if let proxyNode = node as? ProxyNode { + return getTypeNode(for: proxyNode.typeName) + } else { + return node + } + } + + func getCall(for codingPath: CallCodingPath) -> CallMetadata? { + metadata.getCall(from: codingPath.moduleName, with: codingPath.callName) + } } diff --git a/novawallet/Common/Services/ExtrinsicService/XcmTransferService.swift b/novawallet/Common/Services/ExtrinsicService/XcmTransferService.swift index 16ce95466c..c774a4a390 100644 --- a/novawallet/Common/Services/ExtrinsicService/XcmTransferService.swift +++ b/novawallet/Common/Services/ExtrinsicService/XcmTransferService.swift @@ -39,7 +39,7 @@ final class XcmTransferService { let moduleResolutionOperation = ClosureOperation { let metadata = try coderFactoryOperation.extractNoCancellableResultData().metadata - guard let moduleName = Xcm.ExecuteCall.possibleModuleNames.first( + guard let moduleName = Xcm.possibleModuleNames.first( where: { metadata.getModuleIndex($0) != nil } ) else { throw XcmTransferServiceError.noXcmPalletFound @@ -113,13 +113,22 @@ final class XcmTransferService { let optChainAccount = wallet.fetch(for: chain.accountRequest()) let operationFactory = try createOperationFactory(for: chain, chainAccount: optChainAccount) + let coderFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + let wrapper = operationFactory.estimateFeeOperation { builder in let moduleName = try moduleWrapper.targetOperation.extractNoCancellableResultData() - let call = Xcm.ExecuteCall(message: message, maxWeight: maxWeight) - return try builder.adding(call: call.runtimeCall(for: moduleName)) + let codingFactory = try coderFactoryOperation.extractNoCancellableResultData() + return try Xcm.appendExecuteCall( + for: message, + maxWeight: maxWeight, + module: moduleName, + codingFactory: codingFactory, + builder: builder + ) } wrapper.addDependency(wrapper: moduleWrapper) + wrapper.addDependency(operations: [coderFactoryOperation]) let mapperOperation = ClosureOperation { let response = try wrapper.targetOperation.extractNoCancellableResultData() @@ -133,7 +142,8 @@ final class XcmTransferService { mapperOperation.addDependency(wrapper.targetOperation) - let dependencies = moduleWrapper.allOperations + wrapper.allOperations + let dependencies = [coderFactoryOperation] + moduleWrapper.allOperations + + wrapper.allOperations return CompoundOperationWrapper(targetOperation: mapperOperation, dependencies: dependencies) } catch { diff --git a/novawallet/Common/Services/WebSocketService/StorageSubscription/CallbackStorageSubscription.swift b/novawallet/Common/Services/WebSocketService/StorageSubscription/CallbackStorageSubscription.swift index aa09c54fb1..6480871cf1 100644 --- a/novawallet/Common/Services/WebSocketService/StorageSubscription/CallbackStorageSubscription.swift +++ b/novawallet/Common/Services/WebSocketService/StorageSubscription/CallbackStorageSubscription.swift @@ -2,6 +2,11 @@ import Foundation import SubstrateSdk import RobinHood +struct CallbackStorageSubscriptionResult { + let value: T? + let blockHash: Data? +} + final class CallbackStorageSubscription { let request: SubscriptionRequestProtocol let runtimeService: RuntimeCodingServiceProtocol @@ -10,7 +15,8 @@ final class CallbackStorageSubscription { let repository: AnyDataProviderRepository? let callbackQueue: DispatchQueue - let callbackClosure: (Result) -> Void + let callbackClosure: ((Result) -> Void)? + let callbackWithBlockClosure: ((Result, Error>) -> Void)? private var subscriptionId: UInt16? @@ -35,6 +41,28 @@ final class CallbackStorageSubscription { self.operationQueue = operationQueue self.callbackQueue = callbackQueue self.callbackClosure = callbackClosure + callbackWithBlockClosure = nil + + encodeKeyAndSubscribe() + } + + init( + request: SubscriptionRequestProtocol, + connection: JSONRPCEngine, + runtimeService: RuntimeCodingServiceProtocol, + repository: AnyDataProviderRepository?, + operationQueue: OperationQueue, + callbackWithBlockQueue: DispatchQueue, + callbackWithBlockClosure: @escaping (Result, Error>) -> Void + ) { + self.request = request + self.connection = connection + self.runtimeService = runtimeService + self.repository = repository + self.operationQueue = operationQueue + callbackQueue = callbackWithBlockQueue + self.callbackWithBlockClosure = callbackWithBlockClosure + callbackClosure = nil encodeKeyAndSubscribe() } @@ -131,17 +159,29 @@ final class CallbackStorageSubscription { connection.cancelForIdentifier(subscriptionId) } - private func notify(result: Result) { + private func notify(result: Result, Error>) { callbackQueue.async { [weak self] in - self?.callbackClosure(result) + if let withBlockClosure = self?.callbackWithBlockClosure { + withBlockClosure(result) + } + + if let withoutBlockClosure = self?.callbackClosure { + do { + let value = try result.get().value + withoutBlockClosure(.success(value)) + } catch { + withoutBlockClosure(.failure(error)) + } + } } } - func processUpdate(_ data: Data?, blockHash _: Data?) { + func processUpdate(_ data: Data?, blockHash: Data?) { saveIfNeeded(data: data, localKey: request.localKey) guard let data = data else { - notify(result: .success(nil)) + let result = CallbackStorageSubscriptionResult(value: nil, blockHash: blockHash) + notify(result: .success(result)) return } @@ -166,7 +206,8 @@ final class CallbackStorageSubscription { decodingOperation.completionBlock = { [weak self] in do { let value = try decodingOperation.extractNoCancellableResultData() - self?.notify(result: .success(value)) + let result = CallbackStorageSubscriptionResult(value: value, blockHash: blockHash) + self?.notify(result: .success(result)) } catch { self?.notify(result: .failure(error)) } diff --git a/novawallet/Common/Storage/EntityToModel/ChainModelMapper.swift b/novawallet/Common/Storage/EntityToModel/ChainModelMapper.swift index b259f03ee5..df3c6ad2b6 100644 --- a/novawallet/Common/Storage/EntityToModel/ChainModelMapper.swift +++ b/novawallet/Common/Storage/EntityToModel/ChainModelMapper.swift @@ -195,8 +195,21 @@ final class ChainModelMapper { crowdloans = nil } - if staking != nil || history != nil || crowdloans != nil { - return ChainModel.ExternalApiSet(staking: staking, history: history, crowdloans: crowdloans) + let governance: ChainModel.ExternalApi? + + if let type = entity.governanceApiType, let url = entity.governanceApiUrl { + governance = .init(type: type, url: url) + } else { + governance = nil + } + + if staking != nil || history != nil || crowdloans != nil || governance != nil { + return ChainModel.ExternalApiSet( + staking: staking, + history: history, + crowdloans: crowdloans, + governance: governance + ) } else { return nil } @@ -211,6 +224,35 @@ final class ChainModelMapper { entity.crowdloansApiType = apis?.crowdloans?.type entity.crowdloansApiUrl = apis?.crowdloans?.url + + entity.governanceApiType = apis?.governance?.type + entity.governanceApiUrl = apis?.governance?.url + } + + private func createChainOptions(from entity: CDChain) -> [ChainOptions]? { + var options: [ChainOptions] = [] + + if entity.isEthereumBased { + options.append(.ethereumBased) + } + + if entity.isTestnet { + options.append(.testnet) + } + + if entity.hasCrowdloans { + options.append(.crowdloans) + } + + if entity.hasGovernance { + options.append(.governance) + } + + if entity.hasGovernanceV1 { + options.append(.governanceV1) + } + + return !options.isEmpty ? options : nil } } @@ -240,23 +282,11 @@ extension ChainModelMapper: CoreDataMapperProtocol { types = nil } - var options: [ChainOptions] = [] - - if entity.isEthereumBased { - options.append(.ethereumBased) - } - - if entity.isTestnet { - options.append(.testnet) - } - - if entity.hasCrowdloans { - options.append(.crowdloans) - } - let externalApiSet = createExternalApi(from: entity) let explorers = createExplorers(from: entity) + let options = createChainOptions(from: entity) + let additional: JSON? = try entity.additional.map { try jsonDecoder.decode(JSON.self, from: $0) } @@ -270,7 +300,7 @@ extension ChainModelMapper: CoreDataMapperProtocol { addressPrefix: UInt16(bitPattern: entity.addressPrefix), types: types, icon: entity.icon!, - options: options.isEmpty ? nil : options, + options: options, externalApi: externalApiSet, explorers: explorers, order: entity.order, @@ -294,6 +324,8 @@ extension ChainModelMapper: CoreDataMapperProtocol { entity.isEthereumBased = model.isEthereumBased entity.isTestnet = model.isTestnet entity.hasCrowdloans = model.hasCrowdloans + entity.hasGovernanceV1 = model.hasGovernanceV1 + entity.hasGovernance = model.hasGovernanceV2 entity.order = model.order entity.additional = try model.additional.map { try jsonEncoder.encode($0) diff --git a/novawallet/Common/Storage/EntityToModel/ReferendumMetadataMapper.swift b/novawallet/Common/Storage/EntityToModel/ReferendumMetadataMapper.swift new file mode 100644 index 0000000000..ca15c8d5dd --- /dev/null +++ b/novawallet/Common/Storage/EntityToModel/ReferendumMetadataMapper.swift @@ -0,0 +1,54 @@ +import Foundation +import RobinHood +import SubstrateSdk +import CoreData + +final class ReferendumMetadataMapper { + var entityIdentifierFieldName: String { #keyPath(CDReferendumMetadata.identifier) } + + typealias DataProviderModel = ReferendumMetadataLocal + typealias CoreDataEntity = CDReferendumMetadata +} + +extension ReferendumMetadataMapper: CoreDataMapperProtocol { + func transform(entity: CoreDataEntity) throws -> DataProviderModel { + let timeline: [ReferendumMetadataLocal.TimelineItem]? + + if let timelineData = entity.timeline { + timeline = try JSONDecoder().decode( + [ReferendumMetadataLocal.TimelineItem].self, + from: timelineData + ) + } else { + timeline = nil + } + + return ReferendumMetadataLocal( + chainId: entity.chainId!, + referendumId: ReferendumIdLocal(entity.referendumId), + title: entity.title, + content: entity.content, + proposer: entity.proposer, + timeline: timeline + ) + } + + func populate( + entity: CoreDataEntity, + from model: DataProviderModel, + using _: NSManagedObjectContext + ) throws { + entity.identifier = model.identifier + entity.chainId = model.chainId + entity.referendumId = Int32(model.referendumId) + entity.title = model.title + entity.content = model.content + entity.proposer = model.proposer + + if let timeline = model.timeline, !timeline.isEmpty { + entity.timeline = try JSONEncoder().encode(timeline) + } else { + entity.timeline = nil + } + } +} diff --git a/novawallet/Common/Storage/GovernanceChainSettings.swift b/novawallet/Common/Storage/GovernanceChainSettings.swift new file mode 100644 index 0000000000..5137ae526a --- /dev/null +++ b/novawallet/Common/Storage/GovernanceChainSettings.swift @@ -0,0 +1,122 @@ +import Foundation +import SoraKeystore +import RobinHood + +struct GovernanceSelectedOption: Equatable { + let chain: ChainModel + let type: GovernanceType + + static func == (lhs: Self, rhs: Self) -> Bool { + lhs.chain.chainId == rhs.chain.chainId && lhs.type == rhs.type + } +} + +final class GovernanceChainSettings: PersistentValueSettings { + let chainRegistry: ChainRegistryProtocol + let settings: SettingsManagerProtocol + + init( + chainRegistry: ChainRegistryProtocol, + settings: SettingsManagerProtocol + ) { + self.chainRegistry = chainRegistry + self.settings = settings + } + + override func performSetup( + completionClosure: @escaping (Result) -> Void + ) { + let maybeChainId = settings.governanceChainId + let maybeGovernanceType = settings.governanceType + + var completed: Bool = false + let mutex = NSLock() + + chainRegistry.chainsSubscribe( + self, + runningInQueue: DispatchQueue.global(qos: .userInteractive) + ) { [weak self] changes in + mutex.lock() + + defer { + mutex.unlock() + } + + guard let strongSelf = self else { + return + } + + let chains: [ChainModel] = changes.allChangedItems() + + guard !chains.isEmpty, !completed else { + return + } + + completed = true + + strongSelf.completeSetup( + for: chains, + currentChainId: maybeChainId, + currentGovernanceType: maybeGovernanceType, + completionClosure: completionClosure + ) + } + } + + override func performSave( + value: GovernanceSelectedOption, + completionClosure: @escaping (Result + ) -> Void + ) { + settings.governanceChainId = value.chain.chainId + settings.governanceType = value.type + completionClosure(.success(value)) + } + + private func completeSetup( + for chains: [ChainModel], + currentChainId: ChainModel.Id?, + currentGovernanceType: GovernanceType?, + completionClosure: @escaping (Result) -> Void + ) { + let selectedOption: GovernanceSelectedOption? + + if + let chain = chains.first(where: { $0.chainId == currentChainId }), + chain.hasGovernance { + if + let currentGovernanceType = currentGovernanceType, + currentGovernanceType.compatible(with: chain) { + selectedOption = .init(chain: chain, type: currentGovernanceType) + } else { + selectedOption = createSelectedOption(for: chain) + } + } else if let firstChain = chains.first(where: { $0.hasGovernance }) { + selectedOption = createSelectedOption(for: firstChain) + } else { + selectedOption = nil + } + + if let chainId = selectedOption?.chain.chainId, chainId != currentChainId { + settings.governanceChainId = chainId + } + + if let type = selectedOption?.type, type != currentGovernanceType { + settings.governanceType = type + } + + chainRegistry.chainsUnsubscribe(self) + + completionClosure(.success(selectedOption)) + } + + private func createSelectedOption(for chain: ChainModel) -> GovernanceSelectedOption? { + if chain.hasGovernanceV2 { + return .init(chain: chain, type: .governanceV2) + } else if chain.hasGovernanceV1 { + return .init(chain: chain, type: .governanceV1) + } else { + return nil + } + } +} diff --git a/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/.xccurrentversion b/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/.xccurrentversion index 16a19db870..29dcbb1506 100644 --- a/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/.xccurrentversion +++ b/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - SubstrateDataModel2.xcdatamodel + SubstrateDataModel5.xcdatamodel diff --git a/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel3.xcdatamodel/contents b/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel3.xcdatamodel/contents new file mode 100644 index 0000000000..5e32b56928 --- /dev/null +++ b/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel3.xcdatamodel/contents @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel4.xcdatamodel/contents b/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel4.xcdatamodel/contents new file mode 100644 index 0000000000..a1876740fe --- /dev/null +++ b/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel4.xcdatamodel/contents @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel5.xcdatamodel/contents b/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel5.xcdatamodel/contents new file mode 100644 index 0000000000..2be33b8e20 --- /dev/null +++ b/novawallet/Common/Storage/SubstrateDataModel.xcdatamodeld/SubstrateDataModel5.xcdatamodel/contents @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/novawallet/Common/Storage/SubstrateDataStorageFacade.swift b/novawallet/Common/Storage/SubstrateDataStorageFacade.swift index 2f131715ef..05986fd5aa 100644 --- a/novawallet/Common/Storage/SubstrateDataStorageFacade.swift +++ b/novawallet/Common/Storage/SubstrateDataStorageFacade.swift @@ -4,7 +4,7 @@ import CoreData enum SubstrateStorageParams { static let databaseName = "SubstrateDataModel.sqlite" static let modelDirectory: String = "SubstrateDataModel.momd" - static let modelVersion: SubstrateStorageVersion = .version2 + static let modelVersion: SubstrateStorageVersion = .version5 static let storageDirectoryURL: URL = { let baseURL = FileManager.default.urls( diff --git a/novawallet/Common/Substrate/Calls/ConvictionVoting/ConvictionVoting+Call.swift b/novawallet/Common/Substrate/Calls/ConvictionVoting/ConvictionVoting+Call.swift new file mode 100644 index 0000000000..83ba52451f --- /dev/null +++ b/novawallet/Common/Substrate/Calls/ConvictionVoting/ConvictionVoting+Call.swift @@ -0,0 +1,46 @@ +import Foundation +import SubstrateSdk + +extension ConvictionVoting { + struct VoteCall: Codable { + enum CodingKeys: String, CodingKey { + case referendumIndex = "poll_index" + case vote + } + + @StringCodable var referendumIndex: Referenda.ReferendumIndex + let vote: ConvictionVoting.AccountVote + + var runtimeCall: RuntimeCall { + RuntimeCall(moduleName: "ConvictionVoting", callName: "vote", args: self) + } + } + + struct RemoveVoteCall: Codable { + enum CodingKeys: String, CodingKey { + case track = "class" + case index + } + + @OptionStringCodable var track: Referenda.TrackId? + @StringCodable var index: Referenda.ReferendumIndex + + var runtimeCall: RuntimeCall { + RuntimeCall(moduleName: "ConvictionVoting", callName: "remove_vote", args: self) + } + } + + struct UnlockCall: Codable { + enum CodingKeys: String, CodingKey { + case track = "class" + case target + } + + @StringCodable var track: Referenda.TrackId + let target: MultiAddress + + var runtimeCall: RuntimeCall { + RuntimeCall(moduleName: "ConvictionVoting", callName: "unlock", args: self) + } + } +} diff --git a/novawallet/Common/Substrate/Calls/Democracy/Democracy+Call.swift b/novawallet/Common/Substrate/Calls/Democracy/Democracy+Call.swift new file mode 100644 index 0000000000..d7f3966d42 --- /dev/null +++ b/novawallet/Common/Substrate/Calls/Democracy/Democracy+Call.swift @@ -0,0 +1,34 @@ +import Foundation +import SubstrateSdk + +extension Democracy { + struct VoteCall: Codable { + enum CodingKeys: String, CodingKey { + case referendumIndex = "ref_index" + case vote + } + + @StringCodable var referendumIndex: Referenda.ReferendumIndex + let vote: ConvictionVoting.AccountVote + + var runtimeCall: RuntimeCall { + RuntimeCall(moduleName: "Democracy", callName: "vote", args: self) + } + } + + struct RemoveVoteCall: Codable { + @StringCodable var index: Referenda.ReferendumIndex + + var runtimeCall: RuntimeCall { + RuntimeCall(moduleName: "Democracy", callName: "remove_vote", args: self) + } + } + + struct UnlockCall: Codable { + let target: MultiAddress + + var runtimeCall: RuntimeCall { + RuntimeCall(moduleName: "Democracy", callName: "unlock", args: self) + } + } +} diff --git a/novawallet/Common/Substrate/Calls/Xcm/XcmExecute.swift b/novawallet/Common/Substrate/Calls/Xcm/XcmExecute.swift index dd883dade6..6cb2fbcc50 100644 --- a/novawallet/Common/Substrate/Calls/Xcm/XcmExecute.swift +++ b/novawallet/Common/Substrate/Calls/Xcm/XcmExecute.swift @@ -3,7 +3,10 @@ import SubstrateSdk import BigInt extension Xcm { - struct ExecuteCall: Codable { + static var possibleModuleNames: [String] { ["XcmPallet", "PolkadotXcm"] } + static var executeCallName: String { "execute" } + + struct ExecuteCall: Codable { // swiftlint:disable:next nesting enum CodingKeys: String, CodingKey { case message @@ -11,12 +14,57 @@ extension Xcm { } let message: Xcm.Message - @StringCodable var maxWeight: BigUInt + let maxWeight: M + + func runtimeCall(for moduleName: String) -> RuntimeCall { + RuntimeCall(moduleName: moduleName, callName: Xcm.executeCallName, args: self) + } + } + + static func appendExecuteCall( + for message: Xcm.Message, + maxWeight: BigUInt, + module: String, + codingFactory: RuntimeCoderFactoryProtocol, + builder: ExtrinsicBuilderProtocol + ) throws -> ExtrinsicBuilderProtocol { + let path = CallCodingPath(moduleName: module, callName: Xcm.executeCallName) + + guard let callType = codingFactory.getCall(for: path) else { + return builder + } + + let paramName = ExecuteCall.CodingKeys.maxWeight.rawValue - func runtimeCall(for moduleName: String) -> RuntimeCall { - RuntimeCall(moduleName: moduleName, callName: "execute", args: self) + // v1 require only uint64 weight + let isV1 = callType.isArgumentTypeOf(paramName) { argumentType in + codingFactory.isUInt64Type(argumentType) } - static var possibleModuleNames: [String] { ["XcmPallet", "PolkadotXcm"] } + if isV1 { + let call = ExecuteCall(message: message, maxWeight: StringScaleMapper(value: maxWeight)) + return try builder.adding(call: call.runtimeCall(for: module)) + } else { + // verision 1.5 contains only 1 field and v2 contains 2 fields + let isV1P5 = callType.isArgumentTypeOf(paramName) { argumentType in + codingFactory.isStructHasFieldsCount(argumentType, count: 1) + } + + if isV1P5 { + let call = ExecuteCall( + message: message, + maxWeight: BlockchainWeight.WeightV1P5(refTime: UInt64(maxWeight)) + ) + + return try builder.adding(call: call.runtimeCall(for: module)) + } else { + let call = ExecuteCall( + message: message, + maxWeight: BlockchainWeight.WeightV2(refTime: maxWeight, proofSize: 0) + ) + + return try builder.adding(call: call.runtimeCall(for: module)) + } + } } } diff --git a/novawallet/Common/Substrate/Types/AccountInfo.swift b/novawallet/Common/Substrate/Types/AccountInfo.swift index e8f9ebb894..b8df2f41cd 100644 --- a/novawallet/Common/Substrate/Types/AccountInfo.swift +++ b/novawallet/Common/Substrate/Types/AccountInfo.swift @@ -18,5 +18,5 @@ extension AccountData { var total: BigUInt { free + reserved } var frozen: BigUInt { reserved + locked } var locked: BigUInt { max(miscFrozen, feeFrozen) } - var available: BigUInt { free - locked } + var available: BigUInt { free > locked ? free - locked : 0 } } diff --git a/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting+ConstantPath.swift b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting+ConstantPath.swift new file mode 100644 index 0000000000..978113151e --- /dev/null +++ b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting+ConstantPath.swift @@ -0,0 +1,11 @@ +import Foundation + +extension ConvictionVoting { + static var voteLockingPeriodPath: ConstantCodingPath { + ConstantCodingPath(moduleName: "ConvictionVoting", constantName: "VoteLockingPeriod") + } + + static var maxVotes: ConstantCodingPath { + ConstantCodingPath(moduleName: "ConvictionVoting", constantName: "MaxVotes") + } +} diff --git a/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting+StoragePath.swift b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting+StoragePath.swift new file mode 100644 index 0000000000..b4e3628df0 --- /dev/null +++ b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting+StoragePath.swift @@ -0,0 +1,11 @@ +import Foundation + +extension ConvictionVoting { + static var votingFor: StorageCodingPath { + StorageCodingPath(moduleName: "ConvictionVoting", itemName: "VotingFor") + } + + static var trackLocksFor: StorageCodingPath { + StorageCodingPath(moduleName: "ConvictionVoting", itemName: "ClassLocksFor") + } +} diff --git a/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting.swift b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting.swift new file mode 100644 index 0000000000..1991955e73 --- /dev/null +++ b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVoting.swift @@ -0,0 +1,301 @@ +import Foundation +import SubstrateSdk +import BigInt + +enum ConvictionVoting { + typealias PollIndex = UInt32 + + static var lockId: String = "pyconvot" + + enum Conviction: UInt8, Decodable { + /// 0.1x votes, unlocked. + case none + /// 1x votes, locked for an enactment period following a successful vote. + case locked1x + /// 2x votes, locked for 2x enactment periods following a successful vote. + case locked2x + /// 3x votes, locked for 4x... + case locked3x + /// 4x votes, locked for 8x... + case locked4x + /// 5x votes, locked for 16x... + case locked5x + /// 6x votes, locked for 32x... + case locked6x + + case unknown + + func votes(for balance: BigUInt) -> BigUInt? { + switch self { + case .none: + return balance / 10 + case .locked1x: + return balance + case .locked2x: + return 2 * balance + case .locked3x: + return 3 * balance + case .locked4x: + return 4 * balance + case .locked5x: + return 5 * balance + case .locked6x: + return 6 * balance + case .unknown: + return nil + } + } + + func conviction(for period: Moment) -> Moment? { + switch self { + case .none: + return 0 + case .locked1x: + return period + case .locked2x: + return 2 * period + case .locked3x: + return 4 * period + case .locked4x: + return 8 * period + case .locked5x: + return 16 * period + case .locked6x: + return 32 * period + case .unknown: + return nil + } + } + + var decimalValue: Decimal? { + switch self { + case .none: + return 0.1 + case .locked1x: + return 1 + case .locked2x: + return 2 + case .locked3x: + return 3 + case .locked4x: + return 4 + case .locked5x: + return 5 + case .locked6x: + return 6 + case .unknown: + return nil + } + } + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "None": + self = .none + case "Locked1x": + self = .locked1x + case "Locked2x": + self = .locked2x + case "Locked3x": + self = .locked3x + case "Locked4x": + self = .locked4x + case "Locked5x": + self = .locked5x + case "Locked6x": + self = .locked6x + default: + self = .unknown + } + } + } + + struct Vote: Codable { + static let ayeMask: UInt8 = 1 << 7 + static var voteMask: UInt8 { ~ayeMask } + + let aye: Bool + let conviction: Conviction + + init(aye: Bool, conviction: Conviction) { + self.aye = aye + self.conviction = conviction + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + let compactVote = try container.decode(StringScaleMapper.self).value + + aye = (compactVote & Self.ayeMask) == Self.ayeMask + let rawConviction = compactVote & Self.voteMask + + conviction = Conviction(rawValue: rawConviction) ?? .unknown + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + + let rawConviction = conviction.rawValue + let compactVote = aye ? Self.ayeMask | rawConviction : rawConviction + + try container.encode(StringScaleMapper(value: compactVote)) + } + } + + struct AccountVoteStandard: Codable { + let vote: Vote + @StringCodable var balance: BigUInt + } + + struct AccountVoteSplit: Codable { + @StringCodable var aye: BigUInt + @StringCodable var nay: BigUInt + } + + enum AccountVote: Codable { + static let standardField = "Standard" + static let splitField = "Split" + + case unknown + + /// A standard vote, one-way (approve or reject) with a given amount of conviction. + case standard(_ vote: AccountVoteStandard) + + /** + * A split vote with balances given for both ways, and with no conviction, useful for + * parachains when voting. + */ + case split(_ vote: AccountVoteSplit) + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case Self.standardField: + let vote = try container.decode(AccountVoteStandard.self) + self = .standard(vote) + case Self.splitField: + let vote = try container.decode(AccountVoteSplit.self) + self = .split(vote) + default: + self = .unknown + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.unkeyedContainer() + + switch self { + case let .standard(model): + try container.encode(Self.standardField) + try container.encode(model) + case let .split(model): + try container.encode(Self.splitField) + try container.encode(model) + case .unknown: + throw EncodingError.invalidValue( + self, + .init( + codingPath: container.codingPath, + debugDescription: "Account vote type is unknown" + ) + ) + } + } + } + + struct Delegations: Decodable { + /// The number of votes (this is post-conviction). + @StringCodable var votes: BigUInt + + /// The amount of raw capital, used for the support. + @StringCodable var capital: BigUInt + } + + struct PriorLock: Decodable { + enum CodingKeys: String, CodingKey { + case unlockAt = "0" + case amount = "1" + } + + @StringCodable var unlockAt: BlockNumber + @StringCodable var amount: BigUInt + + var exists: Bool { + unlockAt > 0 || amount > 0 + } + + static var notExisting: PriorLock { + PriorLock(unlockAt: 0, amount: 0) + } + } + + struct CastingVotes: Decodable { + let pollIndex: PollIndex + let accountVote: AccountVote + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + + pollIndex = try container.decode(StringScaleMapper.self).value + accountVote = try container.decode(AccountVote.self) + } + } + + struct Casting: Decodable { + /// The current votes of the account + let votes: [CastingVotes] + + /// The total amount of delegations that this account has received, post-conviction-weighting + let delegations: Delegations + + /// Any pre-existing locks from past voting/delegating activity. + let prior: PriorLock + } + + struct Delegating: Decodable { + /// The amount of balance delegated. + @StringCodable var balance: BigUInt + + /// The account to which the voting power is delegated. + @BytesCodable var target: AccountId + + /** + * The conviction with which the voting power is delegated. When this gets undelegated, the + * relevant lock begins. + */ + let conviction: Conviction + + /// The total amount of delegations that this account has received, post-conviction-weighting. + let delegations: Delegations + + /// Any pre-existing locks from past voting/delegating activity. + let prior: PriorLock + } + + enum Voting: Decodable { + case unknown + case casting(_ voting: Casting) + case delegating(_ voting: Delegating) + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "Casting": + let voting = try container.decode(Casting.self) + self = .casting(voting) + case "Delegating": + let voting = try container.decode(Delegating.self) + self = .delegating(voting) + default: + self = .unknown + } + } + } +} diff --git a/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingForKey.swift b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingForKey.swift new file mode 100644 index 0000000000..84fbb27d0d --- /dev/null +++ b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingForKey.swift @@ -0,0 +1,23 @@ +import Foundation +import SubstrateSdk + +extension ConvictionVoting { + struct VotingForKey: JSONListConvertible, Hashable { + let accountId: AccountId + let trackId: Referenda.TrackId + + init(jsonList: [JSON], context: [CodingUserInfoKey: Any]?) throws { + let expectedFieldsCount = 2 + let actualFieldsCount = jsonList.count + guard expectedFieldsCount == actualFieldsCount else { + throw JSONListConvertibleError.unexpectedNumberOfItems( + expected: expectedFieldsCount, + actual: actualFieldsCount + ) + } + + accountId = try jsonList[0].map(to: BytesCodable.self, with: context).wrappedValue + trackId = try jsonList[1].map(to: StringScaleMapper.self, with: context).value + } + } +} diff --git a/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingLocks.swift b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingLocks.swift new file mode 100644 index 0000000000..2516c498cf --- /dev/null +++ b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingLocks.swift @@ -0,0 +1,22 @@ +import Foundation +import BigInt +import SubstrateSdk + +extension ConvictionVoting { + struct ClassLock: Decodable { + let trackId: Referenda.TrackId + let amount: BigUInt + + init(trackId: Referenda.TrackId, amount: BigUInt) { + self.trackId = trackId + self.amount = amount + } + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + + trackId = try container.decode(StringScaleMapper.self).value + amount = try container.decode(StringScaleMapper.self).value + } + } +} diff --git a/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingTally.swift b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingTally.swift new file mode 100644 index 0000000000..7215a7354f --- /dev/null +++ b/novawallet/Common/Substrate/Types/ConvictionVoting/ConvictionVotingTally.swift @@ -0,0 +1,11 @@ +import Foundation +import SubstrateSdk +import BigInt + +extension ConvictionVoting { + struct Tally: Decodable { + @StringCodable var ayes: BigUInt + @StringCodable var nays: BigUInt + @StringCodable var support: BigUInt + } +} diff --git a/novawallet/Common/Substrate/Types/Democracy/Democracy+CodingPath.swift b/novawallet/Common/Substrate/Types/Democracy/Democracy+CodingPath.swift new file mode 100644 index 0000000000..235b394da1 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Democracy/Democracy+CodingPath.swift @@ -0,0 +1,15 @@ +import Foundation + +extension Democracy { + static var referendumInfo: StorageCodingPath { + StorageCodingPath(moduleName: "Democracy", itemName: "ReferendumInfoOf") + } + + static var votingOf: StorageCodingPath { + StorageCodingPath(moduleName: "Democracy", itemName: "VotingOf") + } + + static var preimages: StorageCodingPath { + StorageCodingPath(moduleName: "Democracy", itemName: "Preimages") + } +} diff --git a/novawallet/Common/Substrate/Types/Democracy/Democracy+ConstantPath.swift b/novawallet/Common/Substrate/Types/Democracy/Democracy+ConstantPath.swift new file mode 100644 index 0000000000..205aae39ce --- /dev/null +++ b/novawallet/Common/Substrate/Types/Democracy/Democracy+ConstantPath.swift @@ -0,0 +1,19 @@ +import Foundation + +extension Democracy { + static var votingPeriod: ConstantCodingPath { + ConstantCodingPath(moduleName: "Democracy", constantName: "VotingPeriod") + } + + static var voteLockingPeriod: ConstantCodingPath { + ConstantCodingPath(moduleName: "Democracy", constantName: "VoteLockingPeriod") + } + + static var enactmentPeriod: ConstantCodingPath { + ConstantCodingPath(moduleName: "Democracy", constantName: "EnactmentPeriod") + } + + static var maxVotes: ConstantCodingPath { + ConstantCodingPath(moduleName: "Democracy", constantName: "MaxVotes") + } +} diff --git a/novawallet/Common/Substrate/Types/Democracy/Democracy.swift b/novawallet/Common/Substrate/Types/Democracy/Democracy.swift new file mode 100644 index 0000000000..e860f5123d --- /dev/null +++ b/novawallet/Common/Substrate/Types/Democracy/Democracy.swift @@ -0,0 +1,5 @@ +import Foundation + +enum Democracy { + static var lockId: String = "democrac" +} diff --git a/novawallet/Common/Substrate/Types/Democracy/DemocracyProposalCall.swift b/novawallet/Common/Substrate/Types/Democracy/DemocracyProposalCall.swift new file mode 100644 index 0000000000..7590c2614c --- /dev/null +++ b/novawallet/Common/Substrate/Types/Democracy/DemocracyProposalCall.swift @@ -0,0 +1,26 @@ +import Foundation +import SubstrateSdk + +extension Democracy { + struct ProposalCallAvailable: Decodable { + @BytesCodable var data: Data + } + + enum ProposalCall: Decodable { + case available(ProposalCallAvailable) + case unknown + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "Available": + let model = try container.decode(ProposalCallAvailable.self) + self = .available(model) + default: + self = .unknown + } + } + } +} diff --git a/novawallet/Common/Substrate/Types/Democracy/DemocracyReferendum.swift b/novawallet/Common/Substrate/Types/Democracy/DemocracyReferendum.swift new file mode 100644 index 0000000000..1a977342ba --- /dev/null +++ b/novawallet/Common/Substrate/Types/Democracy/DemocracyReferendum.swift @@ -0,0 +1,67 @@ +import Foundation +import SubstrateSdk +import BigInt + +extension Democracy { + typealias Proposal = SupportPallet.Bounded> + + struct Tally: Decodable { + /// The number of aye votes, expressed in terms of post-conviction lock-vote. + @StringCodable var ayes: BigUInt + + /// The number of nay votes, expressed in terms of post-conviction lock-vote. + @StringCodable var nays: BigUInt + + /// The amount of funds currently expressing its opinion. Pre-conviction. + @StringCodable var turnout: BigUInt + } + + struct OngoingStatus: Decodable { + @StringCodable var end: BlockNumber + @StringCodable var delay: BlockNumber + + /// legacy proposal hash for backward compatability + let proposalHash: BytesCodable? + + /// actual proposal + let proposal: Proposal? + + let threshold: Democracy.VoteThreshold + let tally: Tally + + var universalProposal: Proposal? { + if let proposalHash = proposalHash { + return .legacy(hash: proposalHash.wrappedValue) + } else { + return proposal + } + } + } + + struct FinishedStatus: Decodable { + let approved: Bool + @StringCodable var end: BlockNumber + } + + enum ReferendumInfo: Decodable { + case ongoing(OngoingStatus) + case finished(FinishedStatus) + case unknown + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "Ongoing": + let status = try container.decode(OngoingStatus.self) + self = .ongoing(status) + case "Finished": + let status = try container.decode(FinishedStatus.self) + self = .finished(status) + default: + self = .unknown + } + } + } +} diff --git a/novawallet/Common/Substrate/Types/Democracy/DemocracyVoteThreshold.swift b/novawallet/Common/Substrate/Types/Democracy/DemocracyVoteThreshold.swift new file mode 100644 index 0000000000..f69dbde546 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Democracy/DemocracyVoteThreshold.swift @@ -0,0 +1,32 @@ +import Foundation + +extension Democracy { + enum VoteThreshold: Decodable { + /// A supermajority of approvals is needed to pass this vote. + case superMajorityApprove + + /// A supermajority of rejects is needed to fail this vote. + case superMajorityAgainst + + /// A simple majority of approvals is needed to pass this vote. + case simpleMajority + + case unknown + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "SuperMajorityApprove": + self = .superMajorityApprove + case "SuperMajorityAgainst": + self = .superMajorityAgainst + case "SimpleMajority": + self = .simpleMajority + default: + self = .unknown + } + } + } +} diff --git a/novawallet/Common/Substrate/Types/Democracy/DemocracyVoting.swift b/novawallet/Common/Substrate/Types/Democracy/DemocracyVoting.swift new file mode 100644 index 0000000000..02e4cadc00 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Democracy/DemocracyVoting.swift @@ -0,0 +1,43 @@ +import Foundation +import SubstrateSdk + +extension Democracy { + enum Voting: Decodable { + case direct(ConvictionVoting.Casting) + case delegating(ConvictionVoting.Delegating) + case unknown + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "Direct": + let voting = try container.decode(ConvictionVoting.Casting.self) + self = .direct(voting) + case "Delegating": + let voting = try container.decode(ConvictionVoting.Delegating.self) + self = .delegating(voting) + default: + self = .unknown + } + } + } + + struct VotingOfKey: JSONListConvertible, Hashable { + let accountId: AccountId + + init(jsonList: [JSON], context: [CodingUserInfoKey: Any]?) throws { + let expectedFieldsCount = 1 + let actualFieldsCount = jsonList.count + guard expectedFieldsCount == actualFieldsCount else { + throw JSONListConvertibleError.unexpectedNumberOfItems( + expected: expectedFieldsCount, + actual: actualFieldsCount + ) + } + + accountId = try jsonList[0].map(to: BytesCodable.self, with: context).wrappedValue + } + } +} diff --git a/novawallet/Common/Substrate/Types/Preimage/Preimage.swift b/novawallet/Common/Substrate/Types/Preimage/Preimage.swift new file mode 100644 index 0000000000..ee0d884d78 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Preimage/Preimage.swift @@ -0,0 +1,24 @@ +import Foundation +import SubstrateSdk + +enum Preimage { + static var preimageForStoragePath: StorageCodingPath { + StorageCodingPath(moduleName: "Preimage", itemName: "PreimageFor") + } + + static var statusForStoragePath: StorageCodingPath { + StorageCodingPath(moduleName: "Preimage", itemName: "StatusFor") + } + + struct PreimageKey: Encodable { + let hash: Data + let length: UInt32 + + func encode(to encoder: Encoder) throws { + var container = encoder.unkeyedContainer() + + try container.encode(hash) + try container.encode(StringScaleMapper(value: length)) + } + } +} diff --git a/novawallet/Common/Substrate/Types/Preimage/PreimageRequestStatus.swift b/novawallet/Common/Substrate/Types/Preimage/PreimageRequestStatus.swift new file mode 100644 index 0000000000..0587fd04c5 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Preimage/PreimageRequestStatus.swift @@ -0,0 +1,45 @@ +import Foundation +import SubstrateSdk + +extension Preimage { + struct RequestStatusUnrequested: Decodable { + @StringCodable var len: UInt32 + } + + struct RequestStatusRequested: Decodable { + @OptionStringCodable var len: UInt32? + } + + enum RequestStatus: Decodable { + case unrequested(RequestStatusUnrequested) + case requested(RequestStatusRequested) + case unknown + + init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "Unrequested": + let status = try container.decode(RequestStatusUnrequested.self) + self = .unrequested(status) + case "Requested": + let status = try container.decode(RequestStatusRequested.self) + self = .requested(status) + default: + self = .unknown + } + } + + var length: UInt32? { + switch self { + case let .unrequested(requestStatusUnrequested): + return requestStatusUnrequested.len + case let .requested(requestStatusRequested): + return requestStatusRequested.len + case .unknown: + return nil + } + } + } +} diff --git a/novawallet/Common/Substrate/Types/Referenda/Referenda+CodingPath.swift b/novawallet/Common/Substrate/Types/Referenda/Referenda+CodingPath.swift new file mode 100644 index 0000000000..49e40f465b --- /dev/null +++ b/novawallet/Common/Substrate/Types/Referenda/Referenda+CodingPath.swift @@ -0,0 +1,19 @@ +import Foundation + +extension Referenda { + static var referendumInfo: StorageCodingPath { + StorageCodingPath(moduleName: "Referenda", itemName: "ReferendumInfoFor") + } + + static var trackQueue: StorageCodingPath { + StorageCodingPath(moduleName: "Referenda", itemName: "TrackQueue") + } + + static var tracks: ConstantCodingPath { + ConstantCodingPath(moduleName: "Referenda", constantName: "Tracks") + } + + static var undecidingTimeout: ConstantCodingPath { + ConstantCodingPath(moduleName: "Referenda", constantName: "UndecidingTimeout") + } +} diff --git a/novawallet/Common/Substrate/Types/Referenda/Referenda.swift b/novawallet/Common/Substrate/Types/Referenda/Referenda.swift new file mode 100644 index 0000000000..fabeba5f91 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Referenda/Referenda.swift @@ -0,0 +1,6 @@ +import Foundation + +enum Referenda { + typealias TrackId = UInt16 + typealias ReferendumIndex = UInt32 +} diff --git a/novawallet/Common/Substrate/Types/Referenda/ReferendaCurve.swift b/novawallet/Common/Substrate/Types/Referenda/ReferendaCurve.swift new file mode 100644 index 0000000000..3ed197dc06 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Referenda/ReferendaCurve.swift @@ -0,0 +1,61 @@ +import Foundation +import SubstrateSdk +import BigInt + +extension Referenda { + /** + * Linear curve starting at `(0, ceil)`, proceeding linearly to `(length, floor)`, then + * remaining at `floor` until the end of the period. + */ + struct LinearDecreasingCurve: Decodable { + @StringCodable var length: BigUInt + @StringCodable var floor: BigUInt + @StringCodable var ceil: BigUInt + } + + /** + * Stepped curve, beginning at `(0, begin)`, then remaining constant for `period`, at which + * point it steps down to `(period, begin - step)`. It then remains constant for another + * `period` before stepping down to `(period * 2, begin - step * 2)`. This pattern continues + * but the `y` component has a lower limit of `end`. + */ + struct SteppedDecreasingCurve: Decodable { + @StringCodable var begin: BigUInt + @StringCodable var end: BigUInt + @StringCodable var step: BigUInt + @StringCodable var period: BigUInt + } + + /// A recipocal (`K/(x+S)+T`) curve: `factor` is `K` and `x_offset` is `S`, `y_offset` is `T`. + struct ReciprocalCurve: Decodable { + @StringCodable var factor: Int64 + @StringCodable var xOffset: Int64 + @StringCodable var yOffset: Int64 + } + + enum Curve: Decodable { + case linearDecreasing(_ params: LinearDecreasingCurve) + case steppedDecreasing(_ params: SteppedDecreasingCurve) + case reciprocal(_ params: ReciprocalCurve) + case unknown + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "LinearDecreasing": + let curve = try container.decode(LinearDecreasingCurve.self) + self = .linearDecreasing(curve) + case "SteppedDecreasing": + let curve = try container.decode(SteppedDecreasingCurve.self) + self = .steppedDecreasing(curve) + case "Reciprocal": + let curve = try container.decode(ReciprocalCurve.self) + self = .reciprocal(curve) + default: + self = .unknown + } + } + } +} diff --git a/novawallet/Common/Substrate/Types/Referenda/ReferendaDeposit.swift b/novawallet/Common/Substrate/Types/Referenda/ReferendaDeposit.swift new file mode 100644 index 0000000000..4bc80c7536 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Referenda/ReferendaDeposit.swift @@ -0,0 +1,10 @@ +import Foundation +import SubstrateSdk +import BigInt + +extension Referenda { + struct Deposit: Decodable { + let who: AccountId + @StringCodable var amount: BigUInt + } +} diff --git a/novawallet/Common/Substrate/Types/Referenda/ReferendaTrackInfo.swift b/novawallet/Common/Substrate/Types/Referenda/ReferendaTrackInfo.swift new file mode 100644 index 0000000000..74f34da5f4 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Referenda/ReferendaTrackInfo.swift @@ -0,0 +1,41 @@ +import Foundation +import SubstrateSdk +import BigInt + +extension Referenda { + struct TrackInfo: Decodable { + let name: String + @StringCodable var maxDeciding: UInt32 + @StringCodable var decisionDeposit: BigUInt + @StringCodable var preparePeriod: Moment + @StringCodable var decisionPeriod: Moment + @StringCodable var confirmPeriod: Moment + @StringCodable var minEnactmentPeriod: Moment + let minApproval: Referenda.Curve + let minSupport: Referenda.Curve + } + + struct Track: Decodable { + let trackId: Referenda.TrackId + let info: TrackInfo + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + + trackId = try container.decode(StringScaleMapper.self).value + info = try container.decode(TrackInfo.self) + } + } + + struct TrackQueueItem: Decodable { + let referendum: Referenda.ReferendumIndex + let votes: BigUInt + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + + referendum = try container.decode(StringScaleMapper.self).value + votes = try container.decode(StringScaleMapper.self).value + } + } +} diff --git a/novawallet/Common/Substrate/Types/Referenda/ReferendumInfo.swift b/novawallet/Common/Substrate/Types/Referenda/ReferendumInfo.swift new file mode 100644 index 0000000000..04fe05ae42 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Referenda/ReferendumInfo.swift @@ -0,0 +1,93 @@ +import Foundation +import SubstrateSdk + +enum ReferendumInfo: Decodable { + struct DecidingStatus: Decodable { + @StringCodable var since: BlockNumber + @OptionStringCodable var confirming: BlockNumber? + } + + struct OngoingStatus: Decodable { + @StringCodable var track: Referenda.TrackId + let proposal: SupportPallet.Bounded> + let enactment: OnChainScheduler.DispatchTime + @StringCodable var submitted: Moment + let submissionDeposit: Referenda.Deposit + let decisionDeposit: Referenda.Deposit? + let deciding: DecidingStatus? + let tally: ConvictionVoting.Tally + let inQueue: Bool + } + + struct CompletedStatus: Decodable { + enum CodingKeys: String, CodingKey { + case since = "0" + case submissionDeposit = "1" + case decisionDeposit = "2" + } + + @StringCodable var since: Moment + let submissionDeposit: Referenda.Deposit + let decisionDeposit: Referenda.Deposit? + } + + case ongoing(OngoingStatus) + case approved(CompletedStatus) + case rejected(CompletedStatus) + case cancelled(CompletedStatus) + case timedOut(CompletedStatus) + case killed(atBlock: Moment) + case unknown + + public init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "Ongoing": + let status = try container.decode(OngoingStatus.self) + self = .ongoing(status) + case "Approved": + let status = try container.decode(CompletedStatus.self) + self = .approved(status) + case "Rejected": + let status = try container.decode(CompletedStatus.self) + self = .rejected(status) + case "Cancelled": + let status = try container.decode(CompletedStatus.self) + self = .cancelled(status) + case "TimedOut": + let status = try container.decode(CompletedStatus.self) + self = .timedOut(status) + case "Killed": + let since = try container.decode(StringScaleMapper.self).value + self = .killed(atBlock: since) + default: + self = .unknown + } + } +} + +struct ReferendumIndexKey: JSONListConvertible, Hashable { + let referendumIndex: Referenda.ReferendumIndex + + init(referendumIndex: Referenda.ReferendumIndex) { + self.referendumIndex = referendumIndex + } + + init(jsonList: [JSON], context: [CodingUserInfoKey: Any]?) throws { + let expectedFieldsCount = 1 + let actualFieldsCount = jsonList.count + guard expectedFieldsCount == actualFieldsCount else { + throw JSONListConvertibleError.unexpectedNumberOfItems( + expected: expectedFieldsCount, + actual: actualFieldsCount + ) + } + + referendumIndex = try jsonList[0].map( + to: StringScaleMapper.self, + with: context + ).value + } +} diff --git a/novawallet/Common/Substrate/Types/Scheduler/OnChainDispatchTime.swift b/novawallet/Common/Substrate/Types/Scheduler/OnChainDispatchTime.swift new file mode 100644 index 0000000000..543f46aead --- /dev/null +++ b/novawallet/Common/Substrate/Types/Scheduler/OnChainDispatchTime.swift @@ -0,0 +1,27 @@ +import Foundation +import SubstrateSdk + +extension OnChainScheduler { + enum DispatchTime: Decodable { + case atBlock(_ blockNumber: Moment) + case afterBlock(_ blockNumber: Moment) + case unknown + + init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + + let type = try container.decode(String.self) + + switch type { + case "At": + let blockNumber = try container.decode(StringScaleMapper.self).value + self = .atBlock(blockNumber) + case "After": + let blockNumber = try container.decode(StringScaleMapper.self).value + self = .afterBlock(blockNumber) + default: + self = .unknown + } + } + } +} diff --git a/novawallet/Common/Substrate/Types/Scheduler/OnChainScheduler.swift b/novawallet/Common/Substrate/Types/Scheduler/OnChainScheduler.swift new file mode 100644 index 0000000000..41296ffaa7 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Scheduler/OnChainScheduler.swift @@ -0,0 +1,17 @@ +import Foundation +import SubstrateSdk + +enum OnChainScheduler { + static var lookupTaskPath: StorageCodingPath { + StorageCodingPath(moduleName: "Scheduler", itemName: "Lookup") + } + + struct TaskAddress: Decodable { + let when: BlockNumber + + init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + when = try container.decode(StringScaleMapper.self).value + } + } +} diff --git a/novawallet/Common/Substrate/Types/Support/SupportPallet.swift b/novawallet/Common/Substrate/Types/Support/SupportPallet.swift new file mode 100644 index 0000000000..cf0c5ea8c0 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Support/SupportPallet.swift @@ -0,0 +1,58 @@ +import Foundation +import SubstrateSdk + +enum SupportPallet { + struct BoundedLookup: Decodable { + @BytesCodable var hash: Data + @StringCodable var len: UInt32 + } + + struct BoundedLegacy: Decodable { + @BytesCodable var hash: Data + } + + enum Bounded: Decodable where T: Decodable { + case legacy(hash: Data) + case inline(value: T) + case lookup(BoundedLookup) + case unknown + + init(from decoder: Decoder) throws { + var container = try decoder.unkeyedContainer() + let type = try container.decode(String.self) + + switch type { + case "Legacy": + let hash = try container.decode(BoundedLegacy.self).hash + self = .legacy(hash: hash) + case "Inline": + let value = try container.decode(T.self) + self = .inline(value: value) + case "Lookup": + let lookup = try container.decode(BoundedLookup.self) + self = .lookup(lookup) + default: + self = .unknown + } + } + } + + @propertyWrapper + struct HashOrBoundedCallWrapper: Decodable where T: Decodable { + let wrappedValue: Bounded + + init(wrappedValue: Bounded) { + self.wrappedValue = wrappedValue + } + + init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + + if let hash = try? container.decode(BytesCodable.self).wrappedValue, hash.count == 32 { + wrappedValue = .legacy(hash: hash) + } else { + wrappedValue = try container.decode(Bounded.self) + } + } + } +} diff --git a/novawallet/Common/Substrate/Types/Treasury/Treasury+Calls.swift b/novawallet/Common/Substrate/Types/Treasury/Treasury+Calls.swift new file mode 100644 index 0000000000..878d8bd345 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Treasury/Treasury+Calls.swift @@ -0,0 +1,26 @@ +import Foundation +import SubstrateSdk +import BigInt + +extension Treasury { + static var approveProposalCallPath: CallCodingPath { + CallCodingPath(moduleName: "Treasury", callName: "approve_proposal") + } + + struct ApproveProposal: Decodable { + enum CodingKeys: String, CodingKey { + case proposalId = "proposal_id" + } + + @StringCodable var proposalId: ProposalIndex + } + + static var spendCallPath: CallCodingPath { + CallCodingPath(moduleName: "Treasury", callName: "spend") + } + + struct SpendCall: Decodable { + @StringCodable var amount: BigUInt + let beneficiary: MultiAddress + } +} diff --git a/novawallet/Common/Substrate/Types/Treasury/Treasury+CodingPath.swift b/novawallet/Common/Substrate/Types/Treasury/Treasury+CodingPath.swift new file mode 100644 index 0000000000..74a4391b7e --- /dev/null +++ b/novawallet/Common/Substrate/Types/Treasury/Treasury+CodingPath.swift @@ -0,0 +1,7 @@ +import Foundation + +extension Treasury { + static var proposalsStoragePath: StorageCodingPath { + StorageCodingPath(moduleName: "Treasury", itemName: "Proposals") + } +} diff --git a/novawallet/Common/Substrate/Types/Treasury/Treasury.swift b/novawallet/Common/Substrate/Types/Treasury/Treasury.swift new file mode 100644 index 0000000000..ec874ed279 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Treasury/Treasury.swift @@ -0,0 +1,5 @@ +import Foundation + +enum Treasury { + typealias ProposalIndex = UInt32 +} diff --git a/novawallet/Common/Substrate/Types/Treasury/TreasuryProposal.swift b/novawallet/Common/Substrate/Types/Treasury/TreasuryProposal.swift new file mode 100644 index 0000000000..bb22e6baa4 --- /dev/null +++ b/novawallet/Common/Substrate/Types/Treasury/TreasuryProposal.swift @@ -0,0 +1,11 @@ +import Foundation +import SubstrateSdk +import BigInt + +extension Treasury { + struct Proposal: Decodable { + let proposer: AccountId + @StringCodable var value: BigUInt + @BytesCodable var beneficiary: AccountId + } +} diff --git a/novawallet/Common/View/Chart/FWBarChartView.swift b/novawallet/Common/View/Chart/FWBarChartView.swift index 6689586fdb..f23e694973 100644 --- a/novawallet/Common/View/Chart/FWBarChartView.swift +++ b/novawallet/Common/View/Chart/FWBarChartView.swift @@ -33,7 +33,7 @@ final class FWBarChartView: BarChartView { delegate = self backgroundColor = .clear - chartDescription?.enabled = false + chartDescription.enabled = false autoScaleMinMaxEnabled = true doubleTapToZoomEnabled = false diff --git a/novawallet/Common/View/Chart/FWLineChartView.swift b/novawallet/Common/View/Chart/FWLineChartView.swift index 913db917c8..a4e1636ecd 100644 --- a/novawallet/Common/View/Chart/FWLineChartView.swift +++ b/novawallet/Common/View/Chart/FWLineChartView.swift @@ -13,7 +13,7 @@ final class FWLineChartView: LineChartView { delegate = self backgroundColor = .clear - chartDescription?.enabled = false + chartDescription.enabled = false autoScaleMinMaxEnabled = true doubleTapToZoomEnabled = false @@ -97,7 +97,7 @@ extension FWLineChartView: FWChartViewProtocol { } } - func createDataSet(dataEntries: [ChartDataEntry]) -> IChartDataSet { + func createDataSet(dataEntries: [ChartDataEntry]) -> ChartDataSet { let dataSet = LineChartDataSet(entries: dataEntries) dataSet.mode = .horizontalBezier dataSet.drawIconsEnabled = false @@ -114,7 +114,7 @@ extension FWLineChartView: FWChartViewProtocol { colors: gradientColors, locations: colorLocations )! - dataSet.fill = Fill(linearGradient: linearGradient, angle: 90) + dataSet.fill = LinearGradientFill(gradient: linearGradient, angle: 90) dataSet.fillAlpha = 1.0 dataSet.drawFilledEnabled = true dataSet.highlightColor = R.color.colorGreen()! diff --git a/novawallet/Common/View/Chart/FWXAxisEmptyValueFormatter.swift b/novawallet/Common/View/Chart/FWXAxisEmptyValueFormatter.swift index 2cd89f965c..2576035eba 100644 --- a/novawallet/Common/View/Chart/FWXAxisEmptyValueFormatter.swift +++ b/novawallet/Common/View/Chart/FWXAxisEmptyValueFormatter.swift @@ -2,7 +2,7 @@ import Charts /// `FWXAxisEmptyValueFormatter` returns empty string and thus own place /// under chart thas is used by `FWXAxisChartLegendView` -final class FWXAxisEmptyValueFormatter: IAxisValueFormatter { +final class FWXAxisEmptyValueFormatter: AxisValueFormatter { func stringForValue(_: Double, axis _: AxisBase?) -> String { "" } diff --git a/novawallet/Common/View/DiscreteGradientSlider+Style.swift b/novawallet/Common/View/DiscreteGradientSlider+Style.swift new file mode 100644 index 0000000000..4a682d8a2a --- /dev/null +++ b/novawallet/Common/View/DiscreteGradientSlider+Style.swift @@ -0,0 +1,33 @@ +import UIKit + +extension DiscreteGradientSlider { + func applyConvictionDefaultStyle() { + thumbImageView.image = R.image.iconSliderThumb() + trackOverlayView.fillColor = R.color.colorSliderOverlay()! + verticalSpacing = 5.0 + dotColor = R.color.colorBlack48()! + numberOfValues = 7 + titles = ["0.1x", "1x", "2x", "3x", "4x", "5x", "6x"] + titleFont = .caption1 + + applyConvictionActiveStyle() + } + + func applyConvictionActiveStyle() { + colors = [ + UIColor(hex: "#1DE4FF")!, + UIColor(hex: "#1AD1FF")!, + UIColor(hex: "#1EB3FF")!, + UIColor(hex: "#2194FF")!, + UIColor(hex: "#7471FF")!, + UIColor(hex: "#DF00FF")!, + UIColor(hex: "#FF0087")! + ] + } + + func applyConvictionInactiveStyle() { + colors = [ + R.color.colorWhite32()! + ] + } +} diff --git a/novawallet/Common/View/DiscreteGradientSlider.swift b/novawallet/Common/View/DiscreteGradientSlider.swift new file mode 100644 index 0000000000..aba1c8b1bb --- /dev/null +++ b/novawallet/Common/View/DiscreteGradientSlider.swift @@ -0,0 +1,329 @@ +import UIKit +import SoraUI + +class DiscreteGradientSlider: UIControl { + let thumbImageView = UIImageView() + let trackBackgroundView: MultigradientView = .create { view in + view.startPoint = CGPoint(x: 0.0, y: 0.5) + view.endPoint = CGPoint(x: 1.0, y: 0.5) + } + + let trackOverlayView: RoundedView = .create { view in + view.applyCellBackgroundStyle() + } + + var value: UInt = 0 { + didSet { + setNeedsLayout() + } + } + + var numberOfValues: UInt = 3 { + didSet { + reconfigureSteps() + setNeedsLayout() + } + } + + var trackHeight: CGFloat = 10.0 { + didSet { + trackBackgroundView.cornerRadius = trackHeight / 2.0 + trackOverlayView.cornerRadius = trackHeight / 2.0 + + invalidateIntrinsicContentSize() + setNeedsLayout() + } + } + + var dotRadius: CGFloat = 3.0 { + didSet { + setNeedsLayout() + } + } + + var dotColor: UIColor = R.color.colorDarkGray()! { + didSet { + updateDotsStyle(dots) + } + } + + var verticalSpacing: CGFloat = 5.0 { + didSet { + invalidateIntrinsicContentSize() + setNeedsLayout() + } + } + + var sliderInset: CGFloat = 16 { + didSet { + setNeedsLayout() + } + } + + var dragTriggerOffset: CGFloat = 5.0 + + var titleFont: UIFont? { + didSet { + updateTitlesStyle() + + invalidateIntrinsicContentSize() + setNeedsLayout() + } + } + + var contentInsets: UIEdgeInsets = .zero { + didSet { + invalidateIntrinsicContentSize() + setNeedsLayout() + } + } + + override var intrinsicContentSize: CGSize { + let sliderHeight = max(thumbImageView.intrinsicContentSize.height, trackHeight) + + let labelsHeight = titleLabels.map(\.intrinsicContentSize.height).max() ?? 0 + + let height = labelsHeight + verticalSpacing + sliderHeight + contentInsets.top + contentInsets.bottom + return CGSize(width: UIView.noIntrinsicMetric, height: height) + } + + var colors: [UIColor] { + get { + trackBackgroundView.colors + } + + set { + trackBackgroundView.colors = newValue + + updateTitlesStyle() + } + } + + var titles: [String] { + get { + titleLabels.map { $0.text ?? "" } + } + + set { + guard newValue.count == titleLabels.count else { + return + } + + zip(newValue, titleLabels).forEach { $0.1.text = $0.0 } + + invalidateIntrinsicContentSize() + setNeedsLayout() + } + } + + private var dots: [RoundedView] = [] + private var titleLabels: [UILabel] = [] + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = .clear + + configure() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func configure() { + trackOverlayView.isUserInteractionEnabled = false + trackBackgroundView.isUserInteractionEnabled = false + + trackBackgroundView.cornerRadius = trackHeight / 2.0 + trackOverlayView.cornerRadius = trackHeight / 2.0 + + addSubview(trackBackgroundView) + addSubview(trackOverlayView) + addSubview(thumbImageView) + + reconfigureSteps() + } + + private func reconfigureSteps() { + if dots.count > numberOfValues { + let dropCount = dots.count - Int(numberOfValues) + + let removingDots = Array(dots.suffix(dropCount)) + removingDots.forEach { $0.removeFromSuperview() } + + dots = dots.dropLast(dropCount) + + let removingTitles = Array(titleLabels.suffix(dropCount)) + removingTitles.forEach { $0.removeFromSuperview() } + + titleLabels = titleLabels.dropLast(dropCount) + + } else if dots.count < numberOfValues { + let addCount = Int(numberOfValues) - dots.count + + let newDots: [RoundedView] = (0 ..< addCount).map { _ in + let dotView = RoundedView() + dotView.shadowOpacity = 0.0 + dotView.isUserInteractionEnabled = false + return dotView + } + + newDots.forEach { insertSubview($0, aboveSubview: trackOverlayView) } + + updateDotsStyle(newDots) + + dots.append(contentsOf: newDots) + + let newTitleLabels = (0 ..< addCount).map { _ in UILabel() } + + newTitleLabels.forEach { insertSubview($0, aboveSubview: trackOverlayView) } + + titleLabels.append(contentsOf: newTitleLabels) + + updateTitlesStyle() + } + } + + private func updateDotsStyle(_ dots: [RoundedView]) { + dots.forEach { dot in + dot.fillColor = dotColor + } + } + + private func updateTitlesStyle() { + titleLabels.enumerated().forEach { index, label in + if index < colors.count { + label.textColor = colors[index] + } else { + label.textColor = colors.last + } + + label.font = titleFont + } + } + + private func calculateStep() -> CGFloat { + let availableWidth = bounds.width - contentInsets.left - contentInsets.right - + 2 * (sliderInset + dotRadius) + + if availableWidth > 0, numberOfValues > 1 { + return availableWidth / CGFloat(numberOfValues - 1) + } else { + return 0 + } + } + + private func stepPositionX(for value: UInt) -> CGFloat { + let step = calculateStep() + return contentInsets.left + sliderInset + dotRadius + CGFloat(value) * step + } + + private func layoutDynamicViews() { + let positionX = stepPositionX(for: value) + + let size = thumbImageView.intrinsicContentSize + + thumbImageView.frame = CGRect( + x: positionX - size.width / 2.0, + y: trackBackgroundView.frame.midY - size.height / 2.0, + width: size.width, + height: size.height + ) + + let overlaySize = CGSize(width: bounds.width - positionX, height: trackHeight) + trackOverlayView.frame = CGRect( + x: positionX, + y: trackBackgroundView.frame.midY - overlaySize.height / 2.0, + width: overlaySize.width, + height: overlaySize.height + ) + } + + private func layoutDots() { + (0 ..< numberOfValues).forEach { value in + let positionX = stepPositionX(for: value) + + let dotView = dots[Int(value)] + dotView.frame = CGRect( + x: positionX - dotRadius, + y: trackBackgroundView.frame.midY - dotRadius, + width: 2 * dotRadius, + height: 2 * dotRadius + ) + + dotView.cornerRadius = dotRadius + } + } + + private func layoutTitleLabels() { + (0 ..< numberOfValues).forEach { value in + let positionX = stepPositionX(for: value) + + let titleLabel = titleLabels[Int(value)] + let size = titleLabel.intrinsicContentSize + + titleLabel.frame = CGRect( + x: positionX - size.width / 2.0, + y: contentInsets.top, + width: size.width, + height: size.height + ) + } + } + + override func layoutSubviews() { + super.layoutSubviews() + + let sliderHeight = max(trackHeight, thumbImageView.intrinsicContentSize.height) + + trackBackgroundView.frame = CGRect( + x: bounds.minX + contentInsets.left, + y: bounds.maxY - contentInsets.bottom - sliderHeight / 2.0 - trackHeight / 2.0, + width: bounds.width - contentInsets.left - contentInsets.right, + height: trackHeight + ) + + layoutDynamicViews() + layoutDots() + layoutTitleLabels() + } + + private func updateValue(for location: CGFloat) { + let step = calculateStep() + + guard step > 0 else { + return + } + + let diff = round((location - stepPositionX(for: 0)) / step) + + let oldValue = value + value = min(numberOfValues - 1, UInt(max(0, Int(diff)))) + + if oldValue != value { + sendActions(for: .valueChanged) + } + } + + override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + super.beginTracking(touch, with: event) + + let locationX = touch.location(in: self).x + + updateValue(for: locationX) + + return true + } + + override func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + super.beginTracking(touch, with: event) + + let locationX = touch.location(in: self).x + + updateValue(for: locationX) + + return true + } +} diff --git a/novawallet/Common/View/GenericMultiValueView.swift b/novawallet/Common/View/GenericMultiValueView.swift index 31cab5df85..8d053f8349 100644 --- a/novawallet/Common/View/GenericMultiValueView.swift +++ b/novawallet/Common/View/GenericMultiValueView.swift @@ -1,6 +1,58 @@ import UIKit import SoraUI +class GenericPairValueView: UIView { + let fView = FView() + let sView = SView() + + var spacing: CGFloat { + get { + stackView.spacing + } + + set { + stackView.spacing = newValue + } + } + + let stackView: UIStackView = { + let view = UIStackView() + view.axis = .vertical + return view + }() + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func setVerticalAndSpacing(_ spacing: CGFloat) { + stackView.axis = .vertical + stackView.spacing = spacing + } + + func setHorizontalAndSpacing(_ spacing: CGFloat) { + stackView.axis = .horizontal + stackView.spacing = spacing + } + + private func setupLayout() { + addSubview(stackView) + stackView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + stackView.addArrangedSubview(fView) + stackView.addArrangedSubview(sView) + } +} + class GenericMultiValueView: UIView { let valueTop: UILabel = { let label = UILabel() @@ -10,7 +62,7 @@ class GenericMultiValueView: UIView { return label }() - let valueBottom = BottomView() + let valueBottom: BottomView var spacing: CGFloat { get { @@ -28,7 +80,15 @@ class GenericMultiValueView: UIView { return view }() + init(valueBottom: BottomView = BottomView()) { + self.valueBottom = valueBottom + super.init(frame: .zero) + + setupLayout() + } + override init(frame: CGRect) { + valueBottom = .init() super.init(frame: frame) setupLayout() diff --git a/novawallet/Common/View/HintListView.swift b/novawallet/Common/View/HintListView.swift index 21b567ddf4..1e47c31a95 100644 --- a/novawallet/Common/View/HintListView.swift +++ b/novawallet/Common/View/HintListView.swift @@ -25,20 +25,24 @@ class HintListView: UIView { fatalError("init(coder:) has not been implemented") } - func bind(texts: [String]) { - if texts.count < hints.count { - let hintsToRemove = hints.suffix(hints.count - texts.count) - hints = Array(hints.prefix(texts.count)) + private func updateHints(for newCount: Int) { + if newCount < hints.count { + let hintsToRemove = hints.suffix(hints.count - newCount) + hints = Array(hints.prefix(newCount)) hintsToRemove.forEach { $0.removeFromSuperview() } - } else if texts.count > hints.count { - let addHintsCount = texts.count - hints.count + } else if newCount > hints.count { + let addHintsCount = newCount - hints.count let newHints = (0 ..< addHintsCount).map { _ in IconDetailsView.hint() } newHints.forEach { stackView.addArrangedSubview($0) } hints += newHints } + } + + func bind(texts: [String]) { + updateHints(for: texts.count) for (text, hint) in zip(texts, hints) { hint.detailsLabel.text = text @@ -47,6 +51,16 @@ class HintListView: UIView { setNeedsLayout() } + func bind(attributedTexts: [NSAttributedString]) { + updateHints(for: attributedTexts.count) + + for (text, hint) in zip(attributedTexts, hints) { + hint.detailsLabel.attributedText = text + } + + setNeedsLayout() + } + private func setupLayout() { addSubview(stackView) stackView.snp.makeConstraints { make in diff --git a/novawallet/Common/View/InlineAlertView.swift b/novawallet/Common/View/InlineAlertView.swift index d12a3de360..7831353f3a 100644 --- a/novawallet/Common/View/InlineAlertView.swift +++ b/novawallet/Common/View/InlineAlertView.swift @@ -50,7 +50,7 @@ final class InlineAlertView: UIView { extension InlineAlertView { static func warning() -> InlineAlertView { let view = InlineAlertView() - view.backgroundView.fillColor = R.color.colorYellow12()! + view.backgroundView.fillColor = R.color.colorYellow16()! view.contentView.imageView.image = R.image.iconWarning() view.contentView.stackView.alignment = .top return view diff --git a/novawallet/Common/View/MultiValueView.swift b/novawallet/Common/View/MultiValueView.swift index c1043e7fe8..2fb0c50521 100644 --- a/novawallet/Common/View/MultiValueView.swift +++ b/novawallet/Common/View/MultiValueView.swift @@ -10,11 +10,21 @@ class MultiValueView: GenericMultiValueView { valueBottom.textAlignment = .right } + convenience init() { + self.init(frame: .zero) + } + @available(*, unavailable) required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") } + override var intrinsicContentSize: CGSize { + var size = super.intrinsicContentSize + size.width = max(valueTop.intrinsicContentSize.width, valueBottom.intrinsicContentSize.width) + return size + } + func bind(topValue: String, bottomValue: String?) { valueTop.text = topValue diff --git a/novawallet/Common/View/RoundedSegmentedControl.swift b/novawallet/Common/View/RoundedSegmentedControl.swift new file mode 100644 index 0000000000..1e244048f4 --- /dev/null +++ b/novawallet/Common/View/RoundedSegmentedControl.swift @@ -0,0 +1,282 @@ +import UIKit +import SoraUI + +class RoundedSegmentedControl: UIControl { + private enum Constants { + static let selectionAnimationKey = "selectionAnimationKey" + } + + var titles: [String] = ["Segment1", "Segment2"] { + didSet { + if oldValue.count != titles.count { + _selectedSegmentIndex = titles.count > 0 ? 0 : -1 + } + + clearSegments() + buildSegments() + + setNeedsLayout() + } + } + + var selectedSegmentIndex: Int { + get { + _selectedSegmentIndex + } + + set { + _selectedSegmentIndex = newValue + updateSelectionLayerFrame() + updateSegmentsSelection() + } + } + + var numberOfSegments: Int { + titles.count + } + + var titleColor: UIColor = .black { + didSet { + updateSegmentsSelection() + } + } + + var selectedTitleColor: UIColor = .white { + didSet { + if _selectedSegmentIndex >= 0 { + segments[_selectedSegmentIndex].textColor = selectedTitleColor + } + } + } + + var titleFont: UIFont? { + didSet { + segments.forEach { $0.font = titleFont } + } + } + + var selectionColor: UIColor = .white { + didSet { + applySelectionColor() + } + } + + var selectionCornerRadius: CGFloat = 10.0 { + didSet { + applySelectionPath() + } + } + + var contentInsets: UIEdgeInsets = .init(top: 4.0, left: 4.0, bottom: 4.0, right: 4.0) + + var selectionAnimationDuration: TimeInterval = 0.2 + + var selectionTimingOption: CAMediaTimingFunctionName = .linear + + var layoutStrategy: ListViewLayoutStrategyProtocol = HorizontalEqualWidthLayoutStrategy() { + didSet { + setNeedsLayout() + } + } + + let backgroundView: RoundedView = { + let view = RoundedView() + view.shadowOpacity = 0 + view.fillColor = .gray + view.cornerRadius = 12.0 + view.isUserInteractionEnabled = false + return view + }() + + private var _selectedSegmentIndex: Int = 0 + private var segments: [UILabel] = [] + private var selectionLayer = CAShapeLayer() + + private var selectionContentSize: CGSize { + CGSize( + width: max(bounds.width - contentInsets.left - contentInsets.right, 0), + height: max(bounds.height - contentInsets.top - contentInsets.bottom, 0) + ) + } + + private var selectedTitleLabel: UILabel? { + selectedSegmentIndex >= 0 ? segments[selectedSegmentIndex] : nil + } + + // MARK: Overriden initializers + + override public init(frame: CGRect) { + super.init(frame: frame) + configure() + } + + public required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + configure() + } + + private func configure() { + backgroundColor = UIColor.clear + + addSubview(backgroundView) + + buildSegments() + configureSelectionLayer() + } + + private func configureSelectionLayer() { + layer.addSublayer(selectionLayer) + + applySelectionColor() + applySelectionPath() + updateSelectionLayerFrame() + } + + // MARK: Layout + + override func layoutSubviews() { + super.layoutSubviews() + + backgroundView.frame = CGRect(x: bounds.minX, y: bounds.minY, width: bounds.width, height: bounds.height) + + let contentFrame = CGRect( + x: contentInsets.left, + y: contentInsets.top, + width: bounds.width - contentInsets.left - contentInsets.right, + height: bounds.height - contentInsets.top - contentInsets.bottom + ) + + layoutStrategy.layout(views: segments, in: contentFrame) + + applySelectionPath() + updateSelectionLayerFrame() + } + + // MARK: Segments Management + + private func buildSegments() { + guard !titles.isEmpty else { + return + } + + for (index, title) in titles.enumerated() { + let segmentLabel = UILabel() + segmentLabel.backgroundColor = .clear + segmentLabel.textAlignment = .center + segmentLabel.text = title + addSubview(segmentLabel) + + applyStyle(for: segmentLabel, at: index) + + segments.append(segmentLabel) + } + } + + private func clearSegments() { + segments.forEach { $0.removeFromSuperview() } + segments.removeAll() + } + + private func applyStyle(for segmentLabel: UILabel, at index: Int) { + segmentLabel.textColor = index == _selectedSegmentIndex ? selectedTitleColor : titleColor + segmentLabel.font = titleFont + } + + // MARK: Selection Management + + private func applySelectionColor() { + selectionLayer.fillColor = selectionColor.cgColor + } + + private func applySelectionPath() { + guard let width = selectedTitleLabel?.frame.size.width else { + return + } + + let rect = CGRect(x: 0, y: 0, width: width, height: selectionContentSize.height) + let selectionPath = UIBezierPath(roundedRect: rect, cornerRadius: selectionCornerRadius) + + selectionLayer.path = selectionPath.cgPath + } + + private func updateSelectionLayerFrame() { + guard let titleLabel = selectedTitleLabel else { + return + } + + selectionLayer.frame = CGRect( + x: titleLabel.frame.origin.x, + y: contentInsets.top, + width: titleLabel.frame.size.width, + height: selectionContentSize.height + ) + } + + private func updateSegmentsSelection() { + for (index, label) in segments.enumerated() { + label.textColor = index == _selectedSegmentIndex ? selectedTitleColor : titleColor + } + } + + private func animateSelectionIndexChange(_ fromIndex: Int) { + selectionLayer.removeAnimation(forKey: Constants.selectionAnimationKey) + + let previousLabel = segments[fromIndex] + + guard let titleLabel = selectedTitleLabel else { + return + } + + let oldFrame = CGRect( + x: previousLabel.frame.origin.x, + y: contentInsets.top, + width: previousLabel.frame.size.width, + height: selectionContentSize.height + ) + + let newFrame = CGRect( + x: titleLabel.frame.origin.x, + y: contentInsets.top, + width: titleLabel.frame.size.width, + height: selectionContentSize.height + ) + + let animation = CABasicAnimation(keyPath: "frame") + animation.fromValue = oldFrame + animation.toValue = newFrame + animation.duration = selectionAnimationDuration + animation.timingFunction = CAMediaTimingFunction(name: selectionTimingOption) + + selectionLayer.frame = newFrame + + selectionLayer.add(animation, forKey: Constants.selectionAnimationKey) + } + + // MARK: Action Handlers + + override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + let shouldBeginTracking = super.beginTracking(touch, with: event) + + guard case .began = touch.phase else { + return shouldBeginTracking + } + + let location = touch.location(in: self) + + guard + let newIndex = segments.firstIndex(where: { $0.frame.contains(location) }), + selectedSegmentIndex != newIndex else { + return shouldBeginTracking + } + + let oldIndex = _selectedSegmentIndex + _selectedSegmentIndex = newIndex + + animateSelectionIndexChange(oldIndex) + updateSegmentsSelection() + + sendActions(for: .valueChanged) + + return shouldBeginTracking + } +} diff --git a/novawallet/Common/View/StackTitleValueDiffCell.swift b/novawallet/Common/View/StackTitleValueDiffCell.swift new file mode 100644 index 0000000000..0a81c2df1c --- /dev/null +++ b/novawallet/Common/View/StackTitleValueDiffCell.swift @@ -0,0 +1,22 @@ +import UIKit + +final class StackTitleValueDiffCell: RowView, StackTableViewCellProtocol { + convenience init() { + self.init(frame: .zero) + } + + override init(frame: CGRect) { + super.init(frame: frame) + + configureStyle() + } + + private func configureStyle() { + rowContentView.applyDefaultStyle() + + preferredHeight = 44.0 + borderView.strokeColor = R.color.colorWhite8()! + + isUserInteractionEnabled = false + } +} diff --git a/novawallet/Common/View/TitleValueDiffView.swift b/novawallet/Common/View/TitleValueDiffView.swift new file mode 100644 index 0000000000..6c745021d3 --- /dev/null +++ b/novawallet/Common/View/TitleValueDiffView.swift @@ -0,0 +1,62 @@ +import UIKit + +typealias TitleValueDiffView = GenericTitleValueView< + IconDetailsView, + GenericPairValueView, IconDetailsView> +> + +extension TitleValueDiffView: BindableView { + typealias TModel = ReferendumLockTransitionViewModel + + func bind(viewModel: ReferendumLockTransitionViewModel) { + let viewTop = valueView.fView + viewTop.fView.detailsLabel.text = viewModel.fromValue + viewTop.sView.text = viewModel.toValue + + let viewBottom = valueView.sView + + if let change = viewModel.change { + viewBottom.isHidden = false + + viewBottom.detailsLabel.text = change.value + + let icon = change.isIncrease ? R.image.iconAmountInc() : R.image.iconAmountDec() + viewBottom.imageView.image = icon + } else { + viewBottom.isHidden = true + } + + setNeedsLayout() + } + + func applyDefaultStyle() { + titleView.spacing = 8.0 + titleView.mode = .iconDetails + titleView.iconWidth = 16.0 + titleView.detailsLabel.textColor = R.color.colorTransparentText() + titleView.detailsLabel.font = .regularFootnote + titleView.detailsLabel.numberOfLines = 1 + + valueView.setVerticalAndSpacing(0.0) + valueView.stackView.alignment = .trailing + + let mappingView = valueView.fView + mappingView.setHorizontalAndSpacing(4.0) + mappingView.fView.iconWidth = 12.0 + mappingView.fView.spacing = 4.0 + mappingView.fView.mode = .detailsIcon + mappingView.fView.detailsLabel.textColor = R.color.colorTransparentText() + mappingView.fView.detailsLabel.font = .regularFootnote + mappingView.fView.detailsLabel.numberOfLines = 1 + mappingView.fView.imageView.image = R.image.iconGovLockTransition() + mappingView.sView.textColor = R.color.colorWhite() + mappingView.sView.font = .regularFootnote + + let changesView = valueView.sView + changesView.mode = .iconDetails + changesView.spacing = 0.0 + changesView.detailsLabel.textColor = R.color.colorNovaBlue() + changesView.detailsLabel.font = .caption1 + changesView.detailsLabel.numberOfLines = 1 + } +} diff --git a/novawallet/Common/ViewModel/ChainBalanceViewModel.swift b/novawallet/Common/ViewModel/ChainBalanceViewModel.swift new file mode 100644 index 0000000000..321421d9b5 --- /dev/null +++ b/novawallet/Common/ViewModel/ChainBalanceViewModel.swift @@ -0,0 +1,7 @@ +import Foundation + +struct ChainBalanceViewModel { + let name: String + let icon: ImageViewModelProtocol + let balance: String? +} diff --git a/novawallet/Common/ViewModel/ChainBalanceViewModelFactory.swift b/novawallet/Common/ViewModel/ChainBalanceViewModelFactory.swift new file mode 100644 index 0000000000..e05cb099f1 --- /dev/null +++ b/novawallet/Common/ViewModel/ChainBalanceViewModelFactory.swift @@ -0,0 +1,47 @@ +import Foundation +import BigInt + +final class ChainBalanceViewModelFactory { + let formatterFactory: AssetBalanceFormatterFactoryProtocol + + init(formatterFactory: AssetBalanceFormatterFactoryProtocol = AssetBalanceFormatterFactory()) { + self.formatterFactory = formatterFactory + } + + func createViewModel( + from title: String, + chainAsset: ChainAsset, + balanceInPlank: BigUInt?, + locale: Locale + ) -> ChainBalanceViewModel { + let displayInfo = chainAsset.assetDisplayInfo + let tokenFormatter = formatterFactory.createTokenFormatter(for: displayInfo) + + let icon = RemoteImageViewModel(url: chainAsset.asset.icon ?? chainAsset.chain.icon) + + if + let balanceInPlank = balanceInPlank, + let decimalBalance = Decimal.fromSubstrateAmount(balanceInPlank, precision: displayInfo.assetPrecision) { + let balanceString = tokenFormatter.value(for: locale).stringFromDecimal(decimalBalance) + + return ChainBalanceViewModel(name: title, icon: icon, balance: balanceString) + } else { + return ChainBalanceViewModel(name: title, icon: icon, balance: nil) + } + } + + func createViewModel( + from chainAsset: ChainAsset, + balanceInPlank: BigUInt?, + locale: Locale + ) -> ChainBalanceViewModel { + let name = chainAsset.chain.name + + return createViewModel( + from: name, + chainAsset: chainAsset, + balanceInPlank: balanceInPlank, + locale: locale + ) + } +} diff --git a/novawallet/Common/ViewModel/TitleIconViewModel.swift b/novawallet/Common/ViewModel/TitleIconViewModel.swift index b6cdc4bb61..d1a59836c1 100644 --- a/novawallet/Common/ViewModel/TitleIconViewModel.swift +++ b/novawallet/Common/ViewModel/TitleIconViewModel.swift @@ -1,6 +1,6 @@ import UIKit -struct TitleIconViewModel { +struct TitleIconViewModel: Equatable { let title: String let icon: UIImage? } diff --git a/novawallet/Modules/AssetSelection/AssetSelectionBasePresenter.swift b/novawallet/Modules/AssetSelection/AssetSelectionBasePresenter.swift new file mode 100644 index 0000000000..a8cf0c293f --- /dev/null +++ b/novawallet/Modules/AssetSelection/AssetSelectionBasePresenter.swift @@ -0,0 +1,187 @@ +import Foundation +import SoraFoundation +import BigInt + +class AssetSelectionBasePresenter { + weak var view: AssetSelectionViewProtocol? + let baseWireframe: AssetSelectionBaseWireframeProtocol + let interactor: AssetSelectionInteractorInputProtocol + + let assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol + + private(set) var assets: [ChainAsset] = [] + + private var accountBalances: [ChainAssetId: Result] = [:] + private var assetPrices: [ChainAssetId: PriceData] = [:] + + private var viewModels: [SelectableIconDetailsListViewModel] = [] + + init( + interactor: AssetSelectionInteractorInputProtocol, + baseWireframe: AssetSelectionBaseWireframeProtocol, + assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol, + localizationManager: LocalizationManagerProtocol + ) { + self.interactor = interactor + self.baseWireframe = baseWireframe + self.assetBalanceFormatterFactory = assetBalanceFormatterFactory + self.localizationManager = localizationManager + } + + private func extractAvailableBalanceInPlank(for chainAsset: ChainAsset) -> BigUInt? { + guard + let balanceResult = accountBalances[chainAsset.chainAssetId], + case let .success(balance) = balanceResult else { + return nil + } + + return balance ?? 0 + } + + private func extractFiatBalance(for chainAsset: ChainAsset) -> Decimal? { + guard + let balanceResult = accountBalances[chainAsset.chainAssetId], + case let .success(balance) = balanceResult, + let priceString = assetPrices[chainAsset.chainAssetId]?.price, + let price = Decimal(string: priceString), + let balanceDecimal = Decimal.fromSubstrateAmount( + balance ?? 0, + precision: chainAsset.assetDisplayInfo.assetPrecision + ) else { + return nil + } + + return balanceDecimal * price + } + + func extractFormattedBalance(for chainAsset: ChainAsset) -> String? { + let assetInfo = chainAsset.assetDisplayInfo + + let maybeBalance: Decimal? + + if let balanceInPlank = extractAvailableBalanceInPlank(for: chainAsset) { + maybeBalance = Decimal.fromSubstrateAmount( + balanceInPlank, + precision: assetInfo.assetPrecision + ) + } else { + maybeBalance = 0.0 + } + + guard let balance = maybeBalance else { + return nil + } + + let tokenFormatter = assetBalanceFormatterFactory.createTokenFormatter(for: assetInfo) + .value(for: selectedLocale) + + return tokenFormatter.stringFromDecimal(balance) + } + + private func updateSorting() { + assets.sort { chainAsset1, chainAsset2 in + let balance1 = extractAvailableBalanceInPlank(for: chainAsset1) ?? 0 + let balance2 = extractAvailableBalanceInPlank(for: chainAsset2) ?? 0 + + let assetValue1 = extractFiatBalance(for: chainAsset1) ?? 0 + let assetValue2 = extractFiatBalance(for: chainAsset2) ?? 0 + + let priorityAndTestnetResult = ChainModelCompator.priorityAndTestnetComparator( + chain1: chainAsset1.chain, + chain2: chainAsset2.chain + ) + + if priorityAndTestnetResult != .orderedSame { + return priorityAndTestnetResult == .orderedAscending + } else if assetValue1 > 0, assetValue2 > 0 { + return assetValue1 > assetValue2 + } else if assetValue1 > 0 { + return true + } else if assetValue2 > 0 { + return false + } else if balance1 > 0, balance2 > 0 { + return balance1 > balance2 + } else if balance1 > 0 { + return true + } else if balance2 > 0 { + return false + } else { + return chainAsset1.chain.name.lexicographicallyPrecedes(chainAsset2.chain.name) + } + } + } + + func updateViewModels(_ viewModels: [SelectableIconDetailsListViewModel]) { + self.viewModels = viewModels + } + + func updateView() { + fatalError("Child presenter must override this method") + } + + func handleAssetSelection(at _: Int) { + fatalError("Child presenter must override this method") + } +} + +extension AssetSelectionBasePresenter: AssetSelectionPresenterProtocol { + var numberOfItems: Int { + viewModels.count + } + + func item(at index: Int) -> SelectableViewModelProtocol { + viewModels[index] + } + + func selectItem(at index: Int) { + handleAssetSelection(at: index) + } + + func setup() { + interactor.setup() + } +} + +extension AssetSelectionBasePresenter: AssetSelectionInteractorOutputProtocol { + func didReceiveChainAssets(result: Result<[ChainAsset], Error>) { + switch result { + case let .success(chainAssets): + assets = chainAssets + + updateSorting() + updateView() + case let .failure(error): + _ = baseWireframe.present(error: error, from: view, locale: selectedLocale) + } + } + + func didReceiveBalance(results: [ChainAssetId: Result]) { + results.forEach { key, value in + accountBalances[key] = value + } + + updateSorting() + updateView() + } + + func didReceivePrices(result: Result<[ChainAssetId: PriceData], Error>?) { + switch result { + case let .success(prices): + assetPrices = prices + + updateSorting() + updateView() + case .failure, .none: + // ignore any price errors as it is needed only for sorting + break + } + } +} + +extension AssetSelectionBasePresenter: Localizable { + func applyLocalization() { + if let view = view, view.isSetup { + updateView() + } + } +} diff --git a/novawallet/Modules/AssetSelection/AssetSelectionBaseProtocols.swift b/novawallet/Modules/AssetSelection/AssetSelectionBaseProtocols.swift new file mode 100644 index 0000000000..bf8525d897 --- /dev/null +++ b/novawallet/Modules/AssetSelection/AssetSelectionBaseProtocols.swift @@ -0,0 +1,3 @@ +import Foundation + +protocol AssetSelectionBaseWireframeProtocol: AlertPresentable, ErrorPresentable {} diff --git a/novawallet/Modules/AssetSelection/AssetSelectionInteractor.swift b/novawallet/Modules/AssetSelection/AssetSelectionInteractor.swift index 65d2719fed..8bfe4326a8 100644 --- a/novawallet/Modules/AssetSelection/AssetSelectionInteractor.swift +++ b/novawallet/Modules/AssetSelection/AssetSelectionInteractor.swift @@ -11,6 +11,7 @@ final class AssetSelectionInteractor { let priceLocalSubscriptionFactory: PriceProviderFactoryProtocol let assetFilter: AssetSelectionFilter let operationQueue: OperationQueue + let balanceSlice: KeyPath private var assetBalanceSubscriptions: [AccountId: StreamableProvider] = [:] private var assetBalanceIdMapping: [String: AssetBalanceId] = [:] @@ -19,6 +20,7 @@ final class AssetSelectionInteractor { init( selectedMetaAccount: MetaAccountModel, + balanceSlice: KeyPath, repository: AnyDataProviderRepository, walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol, priceLocalSubscriptionFactory: PriceProviderFactoryProtocol, @@ -27,6 +29,7 @@ final class AssetSelectionInteractor { operationQueue: OperationQueue ) { self.selectedMetaAccount = selectedMetaAccount + self.balanceSlice = balanceSlice self.repository = repository self.walletLocalSubscriptionFactory = walletLocalSubscriptionFactory self.priceLocalSubscriptionFactory = priceLocalSubscriptionFactory @@ -245,7 +248,7 @@ extension AssetSelectionInteractor: WalletLocalStorageSubscriber, WalletLocalSub assetId: assetBalanceId.assetId ) - accum[chainAssetId] = .success(balance.transferable) + accum[chainAssetId] = .success(balance[keyPath: balanceSlice]) case let .delete(deletedIdentifier): guard let assetBalanceId = assetBalanceIdMapping[deletedIdentifier] else { return diff --git a/novawallet/Modules/AssetSelection/AssetSelectionPresenter.swift b/novawallet/Modules/AssetSelection/AssetSelectionPresenter.swift index c56a21bb92..0d060ab4a8 100644 --- a/novawallet/Modules/AssetSelection/AssetSelectionPresenter.swift +++ b/novawallet/Modules/AssetSelection/AssetSelectionPresenter.swift @@ -2,20 +2,12 @@ import Foundation import SoraFoundation import BigInt -final class AssetSelectionPresenter { - weak var view: AssetSelectionViewProtocol? - let wireframe: AssetSelectionWireframeProtocol - let interactor: AssetSelectionInteractorInputProtocol - let selectedChainAssetId: ChainAssetId? - - let assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol - - private var assets: [ChainAsset] = [] - - private var accountBalances: [ChainAssetId: Result] = [:] - private var assetPrices: [ChainAssetId: PriceData] = [:] +final class AssetSelectionPresenter: AssetSelectionBasePresenter { + var wireframe: AssetSelectionWireframeProtocol? { + baseWireframe as? AssetSelectionWireframeProtocol + } - private var viewModels: [SelectableIconDetailsListViewModel] = [] + let selectedChainAssetId: ChainAssetId? init( interactor: AssetSelectionInteractorInputProtocol, @@ -24,98 +16,18 @@ final class AssetSelectionPresenter { assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol, localizationManager: LocalizationManagerProtocol ) { - self.interactor = interactor - self.wireframe = wireframe self.selectedChainAssetId = selectedChainAssetId - self.assetBalanceFormatterFactory = assetBalanceFormatterFactory - self.localizationManager = localizationManager - } - - private func extractAvailableBalanceInPlank(for chainAsset: ChainAsset) -> BigUInt? { - guard - let balanceResult = accountBalances[chainAsset.chainAssetId], - case let .success(balance) = balanceResult else { - return nil - } - - return balance ?? 0 - } - - private func extractFiatBalance(for chainAsset: ChainAsset) -> Decimal? { - guard - let balanceResult = accountBalances[chainAsset.chainAssetId], - case let .success(balance) = balanceResult, - let priceString = assetPrices[chainAsset.chainAssetId]?.price, - let price = Decimal(string: priceString), - let balanceDecimal = Decimal.fromSubstrateAmount( - balance ?? 0, - precision: chainAsset.assetDisplayInfo.assetPrecision - ) else { - return nil - } - - return balanceDecimal * price - } - - private func extractFormattedBalance(for chainAsset: ChainAsset) -> String? { - let assetInfo = chainAsset.assetDisplayInfo - - let maybeBalance: Decimal? - - if let balanceInPlank = extractAvailableBalanceInPlank(for: chainAsset) { - maybeBalance = Decimal.fromSubstrateAmount( - balanceInPlank, - precision: assetInfo.assetPrecision - ) - } else { - maybeBalance = 0.0 - } - - guard let balance = maybeBalance else { - return nil - } - - let tokenFormatter = assetBalanceFormatterFactory.createTokenFormatter(for: assetInfo) - .value(for: selectedLocale) - return tokenFormatter.stringFromDecimal(balance) + super.init( + interactor: interactor, + baseWireframe: wireframe, + assetBalanceFormatterFactory: assetBalanceFormatterFactory, + localizationManager: localizationManager + ) } - private func updateSorting() { - assets.sort { chainAsset1, chainAsset2 in - let balance1 = extractAvailableBalanceInPlank(for: chainAsset1) ?? 0 - let balance2 = extractAvailableBalanceInPlank(for: chainAsset2) ?? 0 - - let assetValue1 = extractFiatBalance(for: chainAsset1) ?? 0 - let assetValue2 = extractFiatBalance(for: chainAsset2) ?? 0 - - let priorityAndTestnetResult = ChainModelCompator.priorityAndTestnetComparator( - chain1: chainAsset1.chain, - chain2: chainAsset2.chain - ) - - if priorityAndTestnetResult != .orderedSame { - return priorityAndTestnetResult == .orderedAscending - } else if assetValue1 > 0, assetValue2 > 0 { - return assetValue1 > assetValue2 - } else if assetValue1 > 0 { - return true - } else if assetValue2 > 0 { - return false - } else if balance1 > 0, balance2 > 0 { - return balance1 > balance2 - } else if balance1 > 0 { - return true - } else if balance2 > 0 { - return false - } else { - return chainAsset1.chain.name.lexicographicallyPrecedes(chainAsset2.chain.name) - } - } - } - - private func updateView() { - viewModels = assets.compactMap { chainAsset in + override func updateView() { + let viewModels: [SelectableIconDetailsListViewModel] = assets.compactMap { chainAsset in let chain = chainAsset.chain let asset = chainAsset.asset @@ -133,72 +45,16 @@ final class AssetSelectionPresenter { ) } - view?.didReload() - } -} - -extension AssetSelectionPresenter: AssetSelectionPresenterProtocol { - var numberOfItems: Int { - viewModels.count - } + updateViewModels(viewModels) - func item(at index: Int) -> SelectableViewModelProtocol { - viewModels[index] + view?.didReload() } - func selectItem(at index: Int) { + override func handleAssetSelection(at index: Int) { guard let view = view else { return } - wireframe.complete(on: view, selecting: assets[index]) - } - - func setup() { - interactor.setup() - } -} - -extension AssetSelectionPresenter: AssetSelectionInteractorOutputProtocol { - func didReceiveChainAssets(result: Result<[ChainAsset], Error>) { - switch result { - case let .success(chainAssets): - assets = chainAssets - - updateSorting() - updateView() - case let .failure(error): - _ = wireframe.present(error: error, from: view, locale: selectedLocale) - } - } - - func didReceiveBalance(results: [ChainAssetId: Result]) { - results.forEach { key, value in - accountBalances[key] = value - } - - updateSorting() - updateView() - } - - func didReceivePrices(result: Result<[ChainAssetId: PriceData], Error>?) { - switch result { - case let .success(prices): - assetPrices = prices - - updateSorting() - updateView() - case .failure, .none: - // ignore any price errors as it is needed only for sorting - break - } - } -} - -extension AssetSelectionPresenter: Localizable { - func applyLocalization() { - if let view = view, view.isSetup { - updateView() - } + wireframe?.complete(on: view, selecting: assets[index]) } } diff --git a/novawallet/Modules/AssetSelection/AssetSelectionProtocols.swift b/novawallet/Modules/AssetSelection/AssetSelectionProtocols.swift index 4d5e00630a..d790d6a691 100644 --- a/novawallet/Modules/AssetSelection/AssetSelectionProtocols.swift +++ b/novawallet/Modules/AssetSelection/AssetSelectionProtocols.swift @@ -6,7 +6,7 @@ protocol AssetSelectionPresenterProtocol: SelectionListPresenterProtocol { func setup() } -protocol AssetSelectionWireframeProtocol: AlertPresentable, ErrorPresentable { +protocol AssetSelectionWireframeProtocol: AssetSelectionBaseWireframeProtocol { func complete(on view: AssetSelectionViewProtocol, selecting chainAsset: ChainAsset) } diff --git a/novawallet/Modules/AssetSelection/AssetSelectionViewFactory.swift b/novawallet/Modules/AssetSelection/AssetSelectionViewFactory.swift index c66c4f20a4..61d2bac15d 100644 --- a/novawallet/Modules/AssetSelection/AssetSelectionViewFactory.swift +++ b/novawallet/Modules/AssetSelection/AssetSelectionViewFactory.swift @@ -1,11 +1,13 @@ import Foundation import RobinHood import SoraFoundation +import BigInt struct AssetSelectionViewFactory { static func createView( delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?, + balanceSlice: KeyPath? = nil, assetFilter: @escaping AssetSelectionFilter ) -> AssetSelectionViewProtocol? { guard let currencyManager = CurrencyManager.shared else { @@ -18,6 +20,7 @@ struct AssetSelectionViewFactory { let interactor = AssetSelectionInteractor( selectedMetaAccount: SelectedWalletSettings.shared.value, + balanceSlice: balanceSlice ?? \.transferable, repository: AnyDataProviderRepository(repository), walletLocalSubscriptionFactory: WalletLocalSubscriptionFactory.shared, priceLocalSubscriptionFactory: PriceProviderFactory.shared, diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListViewFactory.swift b/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListViewFactory.swift deleted file mode 100644 index 489abc6941..0000000000 --- a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListViewFactory.swift +++ /dev/null @@ -1,94 +0,0 @@ -import Foundation -import SoraFoundation -import SubstrateSdk -import SoraKeystore -import IrohaCrypto -import RobinHood - -struct CrowdloanListViewFactory { - static func createView(with sharedState: CrowdloanSharedState) -> CrowdloanListViewProtocol? { - guard let interactor = createInteractor(from: sharedState), - let currencyManager = CurrencyManager.shared else { - return nil - } - - let wireframe = CrowdloanListWireframe(state: sharedState) - - let localizationManager = LocalizationManager.shared - - let viewModelFactory = CrowdloansViewModelFactory( - amountFormatterFactory: AssetBalanceFormatterFactory(), - balanceViewModelFactoryFacade: BalanceViewModelFactoryFacade( - priceAssetInfoFactory: PriceAssetInfoFactory(currencyManager: currencyManager) - ) - ) - - let presenter = CrowdloanListPresenter( - interactor: interactor, - wireframe: wireframe, - viewModelFactory: viewModelFactory, - localizationManager: localizationManager, - crowdloansCalculator: CrowdloansCalculator(), - accountManagementFilter: AccountManagementFilter(), - logger: Logger.shared - ) - - let view = CrowdloanListViewController( - presenter: presenter, - localizationManager: localizationManager - ) - - presenter.view = view - interactor.presenter = presenter - - return view - } - - private static func createInteractor( - from state: CrowdloanSharedState - ) -> CrowdloanListInteractor? { - guard - let currencyManager = CurrencyManager.shared, - let selectedMetaAccount = SelectedWalletSettings.shared.value else { - return nil - } - - let chainRegistry = ChainRegistryFacade.sharedRegistry - let repository = SubstrateRepositoryFactory().createChainStorageItemRepository() - - let operationManager = OperationManagerFacade.sharedManager - let logger = Logger.shared - - let crowdloanRemoteSubscriptionService = CrowdloanRemoteSubscriptionService( - chainRegistry: chainRegistry, - repository: AnyDataProviderRepository(repository), - operationManager: operationManager, - logger: logger - ) - - let storageRequestFactory = StorageRequestFactory( - remoteFactory: StorageKeyFactory(), - operationManager: operationManager - ) - - let crowdloanOperationFactory = CrowdloanOperationFactory( - requestOperationFactory: storageRequestFactory, - operationManager: operationManager - ) - - return CrowdloanListInteractor( - selectedMetaAccount: selectedMetaAccount, - crowdloanState: state, - chainRegistry: chainRegistry, - crowdloanOperationFactory: crowdloanOperationFactory, - crowdloanRemoteSubscriptionService: crowdloanRemoteSubscriptionService, - walletLocalSubscriptionFactory: WalletLocalSubscriptionFactory.shared, - jsonDataProviderFactory: JsonDataProviderFactory.shared, - operationManager: operationManager, - applicationHandler: ApplicationHandler(), - currencyManager: currencyManager, - priceLocalSubscriptionFactory: PriceProviderFactory.shared, - logger: logger - ) - } -} diff --git a/novawallet/Modules/DApp/DAppList/View/DAppItemView.swift b/novawallet/Modules/DApp/DAppList/View/DAppItemViewCell.swift similarity index 100% rename from novawallet/Modules/DApp/DAppList/View/DAppItemView.swift rename to novawallet/Modules/DApp/DAppList/View/DAppItemViewCell.swift diff --git a/novawallet/Modules/DApp/DAppTxDetails/DAppTxDetailsInteractor.swift b/novawallet/Modules/DApp/DAppTxDetails/DAppTxDetailsInteractor.swift index 7a714f43e4..f910283d1a 100644 --- a/novawallet/Modules/DApp/DAppTxDetails/DAppTxDetailsInteractor.swift +++ b/novawallet/Modules/DApp/DAppTxDetails/DAppTxDetailsInteractor.swift @@ -6,43 +6,23 @@ final class DAppTxDetailsInteractor { weak var presenter: DAppTxDetailsInteractorOutputProtocol? let txDetails: JSON - let preprocessor: JSONPrettyPrinting + let prettyPrintedJSONOperationFactory: PrettyPrintedJSONOperationFactoryProtocol let operationQueue: OperationQueue - init(txDetails: JSON, preprocessor: JSONPrettyPrinting, operationQueue: OperationQueue) { + init( + txDetails: JSON, + prettyPrintedJSONOperationFactory: PrettyPrintedJSONOperationFactoryProtocol, + operationQueue: OperationQueue + ) { self.txDetails = txDetails - self.preprocessor = preprocessor + self.prettyPrintedJSONOperationFactory = prettyPrintedJSONOperationFactory self.operationQueue = operationQueue } - - private func createProcessingOperation( - for details: JSON, - preprocessor: JSONPrettyPrinting - ) -> BaseOperation { - ClosureOperation { - let prettyPrintedJson = preprocessor.prettyPrinted(from: details) - - if case let .stringValue(value) = prettyPrintedJson { - return value - } else { - let encoder = JSONEncoder() - encoder.outputFormatting = .prettyPrinted - - let data = try encoder.encode(prettyPrintedJson) - - if let displayString = String(data: data, encoding: .utf8) { - return displayString - } else { - throw CommonError.undefined - } - } - } - } } extension DAppTxDetailsInteractor: DAppTxDetailsInteractorInputProtocol { func setup() { - let operation = createProcessingOperation(for: txDetails, preprocessor: preprocessor) + let operation = prettyPrintedJSONOperationFactory.createProcessingOperation(for: txDetails) operation.completionBlock = { [weak self] in DispatchQueue.main.async { diff --git a/novawallet/Modules/DApp/DAppTxDetails/DAppTxDetailsViewFactory.swift b/novawallet/Modules/DApp/DAppTxDetails/DAppTxDetailsViewFactory.swift index 504d692b5b..6f311f987a 100644 --- a/novawallet/Modules/DApp/DAppTxDetails/DAppTxDetailsViewFactory.swift +++ b/novawallet/Modules/DApp/DAppTxDetails/DAppTxDetailsViewFactory.swift @@ -4,9 +4,10 @@ import SoraFoundation struct DAppTxDetailsViewFactory { static func createView(from txDetails: JSON) -> DAppTxDetailsViewProtocol? { + let processingOperationFactory = PrettyPrintedJSONOperationFactory(preprocessor: ExtrinsicJSONProcessor()) let interactor = DAppTxDetailsInteractor( txDetails: txDetails, - preprocessor: ExtrinsicJSONProcessor(), + prettyPrintedJSONOperationFactory: processingOperationFactory, operationQueue: OperationManagerFacade.sharedDefaultQueue ) diff --git a/novawallet/Modules/MainTabBar/MainTabBarInteractor.swift b/novawallet/Modules/MainTabBar/MainTabBarInteractor.swift index e769bda296..c1c9a1bc79 100644 --- a/novawallet/Modules/MainTabBar/MainTabBarInteractor.swift +++ b/novawallet/Modules/MainTabBar/MainTabBarInteractor.swift @@ -49,7 +49,6 @@ extension MainTabBarInteractor: MainTabBarInteractorInputProtocol { extension MainTabBarInteractor: EventVisitorProtocol { func processSelectedAccountChanged(event _: SelectedAccountChanged) { serviceCoordinator.updateOnAccountChange() - presenter?.didReloadSelectedAccount() } } diff --git a/novawallet/Modules/MainTabBar/MainTabBarPresenter.swift b/novawallet/Modules/MainTabBar/MainTabBarPresenter.swift index 2c4d090f9b..4fcfc9a910 100644 --- a/novawallet/Modules/MainTabBar/MainTabBarPresenter.swift +++ b/novawallet/Modules/MainTabBar/MainTabBarPresenter.swift @@ -15,10 +15,6 @@ extension MainTabBarPresenter: MainTabBarPresenterProtocol { } extension MainTabBarPresenter: MainTabBarInteractorOutputProtocol { - func didReloadSelectedAccount() { - wireframe.showNewCrowdloan(on: view) - } - func didRequestImportAccount() { wireframe.presentAccountImport(on: view) } diff --git a/novawallet/Modules/MainTabBar/MainTabBarProtocol.swift b/novawallet/Modules/MainTabBar/MainTabBarProtocol.swift index fa2a6f7f16..52347371c3 100644 --- a/novawallet/Modules/MainTabBar/MainTabBarProtocol.swift +++ b/novawallet/Modules/MainTabBar/MainTabBarProtocol.swift @@ -15,17 +15,13 @@ protocol MainTabBarInteractorInputProtocol: AnyObject { } protocol MainTabBarInteractorOutputProtocol: AnyObject { - func didReloadSelectedAccount() func didRequestImportAccount() } protocol MainTabBarWireframeProtocol: AlertPresentable, AuthorizationAccessible { - func showNewCrowdloan(on view: MainTabBarViewProtocol?) - func presentAccountImport(on view: MainTabBarViewProtocol?) } protocol MainTabBarViewFactoryProtocol: AnyObject { static func createView() -> MainTabBarViewProtocol? - static func reloadCrowdloanView(on view: MainTabBarViewProtocol) } diff --git a/novawallet/Modules/MainTabBar/MainTabBarViewFactory.swift b/novawallet/Modules/MainTabBar/MainTabBarViewFactory.swift index 0568270ff2..846badfa42 100644 --- a/novawallet/Modules/MainTabBar/MainTabBarViewFactory.swift +++ b/novawallet/Modules/MainTabBar/MainTabBarViewFactory.swift @@ -33,10 +33,7 @@ final class MainTabBarViewFactory: MainTabBarViewFactoryProtocol { return nil } - guard let crowdloanController = createCrowdloanController( - for: localizationManager, - state: CrowdloanSharedState() - ) else { + guard let voteController = createVoteController(for: localizationManager) else { return nil } @@ -51,7 +48,7 @@ final class MainTabBarViewFactory: MainTabBarViewFactoryProtocol { let view = MainTabBarViewController() view.viewControllers = [ walletController, - crowdloanController, + voteController, dappsController, stakingController, settingsController @@ -70,19 +67,6 @@ final class MainTabBarViewFactory: MainTabBarViewFactoryProtocol { return view } - static func reloadCrowdloanView(on view: MainTabBarViewProtocol) { - let localizationManager = LocalizationManager.shared - - guard let crowdloanController = createCrowdloanController( - for: localizationManager, - state: CrowdloanSharedState() - ) else { - return - } - - view.didReplaceView(for: crowdloanController, for: Self.crowdloanIndex) - } - static func createWalletController( for localizationManager: LocalizationManagerProtocol ) -> UIViewController? { @@ -189,23 +173,20 @@ final class MainTabBarViewFactory: MainTabBarViewFactoryProtocol { return navigationController } - static func createCrowdloanController( - for localizationManager: LocalizationManagerProtocol, - state: CrowdloanSharedState - ) -> UIViewController? { - guard let crowloanView = CrowdloanListViewFactory.createView(with: state) else { + static func createVoteController(for localizationManager: LocalizationManagerProtocol) -> UIViewController? { + guard let view = VoteViewFactory.createView() else { return nil } - let navigationController = FearlessNavigationController(rootViewController: crowloanView.controller) + let navigationController = FearlessNavigationController(rootViewController: view.controller) let localizableTitle = LocalizableResource { locale in - R.string.localizable.tabbarCrowdloanTitle_v190(preferredLanguages: locale.rLanguages) + R.string.localizable.tabbarVoteTitle(preferredLanguages: locale.rLanguages) } let currentTitle = localizableTitle.value(for: localizationManager.selectedLocale) - let commonIconImage = R.image.iconTabCrowloan() - let selectedIconImage = R.image.iconTabCrowloanFilled() + let commonIconImage = R.image.iconTabVote() + let selectedIconImage = R.image.iconTabVoteFilled() let commonIcon = commonIconImage?.tinted(with: R.color.colorWhite()!)? .withRenderingMode(.alwaysOriginal) diff --git a/novawallet/Modules/MainTabBar/MainTabBarWireframe.swift b/novawallet/Modules/MainTabBar/MainTabBarWireframe.swift index 629a33a37a..aaeda2aaf0 100644 --- a/novawallet/Modules/MainTabBar/MainTabBarWireframe.swift +++ b/novawallet/Modules/MainTabBar/MainTabBarWireframe.swift @@ -2,12 +2,6 @@ import Foundation import CommonWallet final class MainTabBarWireframe: MainTabBarWireframeProtocol { - func showNewCrowdloan(on view: MainTabBarViewProtocol?) { - if let view = view { - MainTabBarViewFactory.reloadCrowdloanView(on: view) - } - } - func presentAccountImport(on view: MainTabBarViewProtocol?) { guard let tabBarController = view?.controller else { return diff --git a/novawallet/Modules/Staking/Parachain/ParaStkRedeem/ParaStkRedeemViewFactory.swift b/novawallet/Modules/Staking/Parachain/ParaStkRedeem/ParaStkRedeemViewFactory.swift index c4cb09e7ea..0881029542 100644 --- a/novawallet/Modules/Staking/Parachain/ParaStkRedeem/ParaStkRedeemViewFactory.swift +++ b/novawallet/Modules/Staking/Parachain/ParaStkRedeem/ParaStkRedeemViewFactory.swift @@ -47,6 +47,7 @@ struct ParaStkRedeemViewFactory { presenter.view = view interactor.presenter = presenter + dataValidationFactory.view = view return view } diff --git a/novawallet/Modules/Crowdloan/CrowdloanContribution/CrowdloanContributionInteractor.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContribution/CrowdloanContributionInteractor.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContribution/CrowdloanContributionInteractor.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContribution/CrowdloanContributionInteractor.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContribution/CrowdloanContributionProtocols.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContribution/CrowdloanContributionProtocols.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContribution/CrowdloanContributionProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContribution/CrowdloanContributionProtocols.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContribution/CrowdloanContributionViewModelFactory.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContribution/CrowdloanContributionViewModelFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContribution/CrowdloanContributionViewModelFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContribution/CrowdloanContributionViewModelFactory.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContribution/Model/CrowdloanContributionConfirmData.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContribution/Model/CrowdloanContributionConfirmData.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContribution/Model/CrowdloanContributionConfirmData.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContribution/Model/CrowdloanContributionConfirmData.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmInteractor.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmInteractor.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmInteractor.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmInteractor.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmPresenter.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmPresenter.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmPresenter.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmPresenter.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmProtocols.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmProtocols.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmProtocols.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewController.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewController.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewController.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewController.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewFactory.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewFactory.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewLayout.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewLayout.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewLayout.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmViewLayout.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmWireframe.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmWireframe.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmWireframe.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/CrowdloanContributionConfirmWireframe.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/ViewModel/CrowdloanContributeConfirmViewModel.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/ViewModel/CrowdloanContributeConfirmViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionConfirm/ViewModel/CrowdloanContributeConfirmViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionConfirm/ViewModel/CrowdloanContributeConfirmViewModel.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupInteractor.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupInteractor.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupInteractor.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupInteractor.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupPresenter.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupPresenter.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupPresenter.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupPresenter.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupProtocols.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupProtocols.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupProtocols.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewController.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewController.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewController.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewController.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewFactory.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewFactory.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewLayout.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewLayout.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewLayout.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupViewLayout.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupWireframe.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupWireframe.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupWireframe.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/CrowdloanContributionSetupWireframe.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanContributionSetup/ViewModel/CrowdloanContributionSetupViewModel.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/ViewModel/CrowdloanContributionSetupViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanContributionSetup/ViewModel/CrowdloanContributionSetupViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanContributionSetup/ViewModel/CrowdloanContributionSetupViewModel.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/BalanceViewModelFactoryFacade.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/BalanceViewModelFactoryFacade.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanList/BalanceViewModelFactoryFacade.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/BalanceViewModelFactoryFacade.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListInteractor.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListInteractor.swift similarity index 86% rename from novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListInteractor.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListInteractor.swift index d64eeff365..d03e2be2a7 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListInteractor.swift +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListInteractor.swift @@ -3,7 +3,7 @@ import RobinHood import SoraFoundation final class CrowdloanListInteractor: RuntimeConstantFetching { - weak var presenter: CrowdloanListInteractorOutputProtocol! + weak var presenter: CrowdloanListInteractorOutputProtocol? let selectedMetaAccount: MetaAccountModel let crowdloanState: CrowdloanSharedState @@ -108,12 +108,12 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { clearOnchainContributionRequest(true) guard !crowdloans.isEmpty else { - presenter.didReceiveContributions(result: .success([:])) + presenter?.didReceiveContributions(result: .success([:])) return } guard let accountResponse = selectedMetaAccount.fetch(for: chain.accountRequest()) else { - presenter.didReceiveContributions(result: .success([:])) + presenter?.didReceiveContributions(result: .success([:])) return } @@ -143,14 +143,14 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { do { let contributions = try contributionsOperation.extractNoCancellableResultData().toDict() - self?.presenter.didReceiveContributions(result: .success(contributions)) + self?.presenter?.didReceiveContributions(result: .success(contributions)) } catch { if let encodingError = error as? StorageKeyEncodingOperationError, encodingError == .invalidStoragePath { - self?.presenter.didReceiveContributions(result: .success([:])) + self?.presenter?.didReceiveContributions(result: .success([:])) } else { - self?.presenter.didReceiveContributions(result: .failure(error)) + self?.presenter?.didReceiveContributions(result: .failure(error)) } } } @@ -179,7 +179,7 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { clearLeaseInfoRequest(true) guard !crowdloans.isEmpty else { - presenter.didReceiveLeaseInfo(result: .success([:])) + presenter?.didReceiveLeaseInfo(result: .success([:])) return } @@ -199,14 +199,14 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { do { let leaseInfo = try queryWrapper.targetOperation.extractNoCancellableResultData().toMap() - self?.presenter.didReceiveLeaseInfo(result: .success(leaseInfo)) + self?.presenter?.didReceiveLeaseInfo(result: .success(leaseInfo)) } catch { if let encodingError = error as? StorageKeyEncodingOperationError, encodingError == .invalidStoragePath { - self?.presenter.didReceiveLeaseInfo(result: .success([:])) + self?.presenter?.didReceiveLeaseInfo(result: .success([:])) } else { - self?.presenter.didReceiveLeaseInfo(result: .failure(error)) + self?.presenter?.didReceiveLeaseInfo(result: .failure(error)) } } } @@ -219,16 +219,16 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { } private func notifyCrowdolansFetchWithError(error: Error) { - presenter.didReceiveCrowdloans(result: .failure(error)) - presenter.didReceiveContributions(result: .failure(error)) - presenter.didReceiveLeaseInfo(result: .failure(error)) + presenter?.didReceiveCrowdloans(result: .failure(error)) + presenter?.didReceiveContributions(result: .failure(error)) + presenter?.didReceiveLeaseInfo(result: .failure(error)) } private func subscribeToDisplayInfo(for chain: ChainModel) { displayInfoProvider = nil guard let crowdloanUrl = chain.externalApi?.crowdloans?.url else { - presenter.didReceiveDisplayInfo(result: .success([:])) + presenter?.didReceiveDisplayInfo(result: .success([:])) return } @@ -236,12 +236,12 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { let updateClosure: ([DataProviderChange]) -> Void = { [weak self] changes in if let result = changes.reduceToLastChange() { - self?.presenter.didReceiveDisplayInfo(result: .success(result.toMap())) + self?.presenter?.didReceiveDisplayInfo(result: .success(result.toMap())) } } let failureClosure: (Error) -> Void = { [weak self] error in - self?.presenter.didReceiveDisplayInfo(result: .failure(error)) + self?.presenter?.didReceiveDisplayInfo(result: .failure(error)) } let options = DataProviderObserverOptions(alwaysNotifyOnRefresh: true, waitsInProgressSyncOnAdd: false) @@ -266,9 +266,9 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { private func provideConstants(for chain: ChainModel) { guard let runtimeService = chainRegistry.getRuntimeProvider(for: chain.chainId) else { let error = ChainRegistryError.runtimeMetadaUnavailable - presenter.didReceiveBlockDuration(result: .failure(error)) - presenter.didReceiveLeasingPeriod(result: .failure(error)) - presenter.didReceiveLeasingOffset(result: .failure(error)) + presenter?.didReceiveBlockDuration(result: .failure(error)) + presenter?.didReceiveLeasingPeriod(result: .failure(error)) + presenter?.didReceiveLeasingOffset(result: .failure(error)) return } @@ -277,7 +277,7 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { runtimeCodingService: runtimeService, operationManager: operationManager ) { [weak self] (result: Result) in - self?.presenter.didReceiveBlockDuration(result: result) + self?.presenter?.didReceiveBlockDuration(result: result) } fetchConstant( @@ -285,7 +285,7 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { runtimeCodingService: runtimeService, operationManager: operationManager ) { [weak self] (result: Result) in - self?.presenter.didReceiveLeasingPeriod(result: result) + self?.presenter?.didReceiveLeasingPeriod(result: result) } fetchConstant( @@ -293,7 +293,7 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { runtimeCodingService: runtimeService, operationManager: operationManager ) { [weak self] (result: Result) in - self?.presenter.didReceiveLeasingOffset(result: result) + self?.presenter?.didReceiveLeasingOffset(result: result) } } @@ -305,22 +305,21 @@ final class CrowdloanListInteractor: RuntimeConstantFetching { if let priceId = chain.utilityAsset()?.priceId { priceProvider = subscribeToPrice(for: priceId, currency: selectedCurrency) } else { - presenter.didReceivePriceData(result: nil) + presenter?.didReceivePriceData(result: nil) } } } extension CrowdloanListInteractor { func setup(with accountId: AccountId?, chain: ChainModel) { - presenter.didReceive(wallet: selectedMetaAccount) - presenter.didReceiveSelectedChain(result: .success(chain)) + presenter?.didReceiveSelectedChain(result: .success(chain)) if let accountId = accountId { subscribeToAccountInfo(for: accountId, chain: chain) subscribeToExternalContributions(for: accountId, chain: chain) } else { - presenter.didReceiveAccountInfo(result: .success(nil)) - presenter.didReceiveExternalContributions(result: .success([])) + presenter?.didReceiveAccountInfo(result: .success(nil)) + presenter?.didReceiveExternalContributions(result: .success([])) } subscribePrice() @@ -430,14 +429,14 @@ extension CrowdloanListInteractor { connection: connection, runtimeService: runtimeService ) - self?.presenter.didReceiveCrowdloans(result: .success(crowdloans)) + self?.presenter?.didReceiveCrowdloans(result: .success(crowdloans)) } catch { if let encodingError = error as? StorageKeyEncodingOperationError, encodingError == .invalidStoragePath { - self?.presenter.didReceiveCrowdloans(result: .success([])) - self?.presenter.didReceiveContributions(result: .success([:])) - self?.presenter.didReceiveLeaseInfo(result: .success([:])) + self?.presenter?.didReceiveCrowdloans(result: .success([])) + self?.presenter?.didReceiveContributions(result: .success([:])) + self?.presenter?.didReceiveLeaseInfo(result: .success([:])) } else { self?.notifyCrowdolansFetchWithError(error: error) } @@ -451,7 +450,7 @@ extension CrowdloanListInteractor { extension CrowdloanListInteractor: PriceLocalStorageSubscriber, PriceLocalSubscriptionHandler { func handlePrice(result: Result, priceId _: AssetModel.PriceId) { - presenter.didReceivePriceData(result: result) + presenter?.didReceivePriceData(result: result) } } diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListPresenter.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListPresenter.swift similarity index 93% rename from novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListPresenter.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListPresenter.swift index c0a3ef459e..8a2daf6577 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListPresenter.swift +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListPresenter.swift @@ -4,12 +4,13 @@ import BigInt import SubstrateSdk final class CrowdloanListPresenter { - weak var view: CrowdloanListViewProtocol? + weak var view: CrowdloansViewProtocol? let wireframe: CrowdloanListWireframeProtocol let interactor: CrowdloanListInteractorInputProtocol let viewModelFactory: CrowdloansViewModelFactoryProtocol let logger: LoggerProtocol? let accountManagementFilter: AccountManagementFilterProtocol + let wallet: MetaAccountModel private var selectedChainResult: Result? private var accountInfoResult: Result? @@ -23,14 +24,15 @@ final class CrowdloanListPresenter { private var contributionsResult: Result? private var externalContributions: [ExternalContribution]? private var leaseInfoResult: Result? - private var wallet: MetaAccountModel? - private lazy var walletSwitchViewModelFactory = WalletSwitchViewModelFactory() private let crowdloansCalculator: CrowdloansCalculatorProtocol + private lazy var chainBalanceFactory = ChainBalanceViewModelFactory() + init( interactor: CrowdloanListInteractorInputProtocol, wireframe: CrowdloanListWireframeProtocol, + wallet: MetaAccountModel, viewModelFactory: CrowdloansViewModelFactoryProtocol, localizationManager: LocalizationManagerProtocol, crowdloansCalculator: CrowdloansCalculatorProtocol, @@ -39,6 +41,7 @@ final class CrowdloanListPresenter { ) { self.interactor = interactor self.wireframe = wireframe + self.wallet = wallet self.viewModelFactory = viewModelFactory self.logger = logger self.crowdloansCalculator = crowdloansCalculator @@ -46,19 +49,6 @@ final class CrowdloanListPresenter { self.localizationManager = localizationManager } - private func updateWalletSwitchView() { - guard let wallet = wallet else { - return - } - - let viewModel = walletSwitchViewModelFactory.createViewModel( - from: wallet.walletIdenticonData(), - walletType: wallet.type - ) - - view?.didReceive(walletSwitchViewModel: viewModel) - } - private func updateChainView() { guard let chainResult = selectedChainResult else { return @@ -79,10 +69,9 @@ final class CrowdloanListPresenter { balance = nil } - let viewModel = viewModelFactory.createChainViewModel( - from: chain, - asset: asset, - balance: balance, + let viewModel = chainBalanceFactory.createViewModel( + from: ChainAsset(chain: chain, asset: asset), + balanceInPlank: balance, locale: selectedLocale ) @@ -219,13 +208,39 @@ final class CrowdloanListPresenter { } } -extension CrowdloanListPresenter: CrowdloanListPresenterProtocol { +extension CrowdloanListPresenter: VoteChildPresenterProtocol { func setup() { view?.didReceive(listState: viewModelFactory.createLoadingViewModel()) interactor.setup() } + func becomeOnline() { + interactor.becomeOnline() + } + + func putOffline() { + interactor.putOffline() + } + + func selectChain() { + guard + let chain = try? selectedChainResult?.get(), + let asset = chain.utilityAsset() else { + return + } + + let chainAssetId = ChainAsset(chain: chain, asset: asset).chainAssetId + + wireframe.selectChain( + from: view, + delegate: self, + selectedChainAssetId: chainAssetId + ) + } +} + +extension CrowdloanListPresenter: CrowdloanListPresenterProtocol { func refresh(shouldReset: Bool) { crowdloansResult = nil @@ -241,7 +256,7 @@ extension CrowdloanListPresenter: CrowdloanListPresenterProtocol { } func selectCrowdloan(_ paraId: ParaId) { - guard let wallet = wallet, let chain = try? selectedChainResult?.get() else { + guard let chain = try? selectedChainResult?.get() else { return } @@ -263,6 +278,10 @@ extension CrowdloanListPresenter: CrowdloanListPresenterProtocol { message: message, locale: selectedLocale ) { [weak self] in + guard let wallet = self?.wallet else { + return + } + self?.wireframe.showWalletDetails(from: self?.view, wallet: wallet) } } else { @@ -279,34 +298,6 @@ extension CrowdloanListPresenter: CrowdloanListPresenterProtocol { } } - func becomeOnline() { - interactor.becomeOnline() - } - - func putOffline() { - interactor.putOffline() - } - - func selectChain() { - guard - let chain = try? selectedChainResult?.get(), - let asset = chain.utilityAsset() else { - return - } - - let chainAssetId = ChainAsset(chain: chain, asset: asset).chainAssetId - - wireframe.selectChain( - from: view, - delegate: self, - selectedChainAssetId: chainAssetId - ) - } - - func handleWalletSwitch() { - wireframe.showWalletSwitch(from: view) - } - func handleYourContributions() { guard let chainResult = selectedChainResult, @@ -416,12 +407,6 @@ extension CrowdloanListPresenter: CrowdloanListInteractorOutputProtocol { updateChainView() } - func didReceive(wallet: MetaAccountModel) { - self.wallet = wallet - - updateWalletSwitchView() - } - func didReceivePriceData(result: Result?) { priceDataResult = result updateListView() diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListProtocols.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListProtocols.swift similarity index 77% rename from novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListProtocols.swift index 9cdf9d576c..e481719542 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListProtocols.swift +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListProtocols.swift @@ -1,20 +1,16 @@ import SoraFoundation -protocol CrowdloanListViewProtocol: ControllerBackedProtocol, AlertPresentable, LoadableViewProtocol { - func didReceive(walletSwitchViewModel: WalletSwitchViewModel) - func didReceive(chainInfo: CrowdloansChainViewModel) +protocol CrowdloansViewProtocol: AlertPresentable, ControllerBackedProtocol, LoadableViewProtocol { + var presenter: CrowdloanListPresenterProtocol? { get set } + + func didReceive(chainInfo: ChainBalanceViewModel) func didReceive(listState: CrowdloansViewModel) } protocol CrowdloanListPresenterProtocol: AnyObject { - func setup() func refresh(shouldReset: Bool) func selectCrowdloan(_ paraId: ParaId) - func becomeOnline() - func putOffline() - func selectChain() func handleYourContributions() - func handleWalletSwitch() } protocol CrowdloanListInteractorInputProtocol: AnyObject { @@ -37,13 +33,12 @@ protocol CrowdloanListInteractorOutputProtocol: AnyObject { func didReceiveLeaseInfo(result: Result) func didReceiveSelectedChain(result: Result) func didReceiveAccountInfo(result: Result) - func didReceive(wallet: MetaAccountModel) func didReceivePriceData(result: Result?) } -protocol CrowdloanListWireframeProtocol: WalletSwitchPresentable, AlertPresentable, NoAccountSupportPresentable { +protocol CrowdloanListWireframeProtocol: AlertPresentable, NoAccountSupportPresentable { func presentContributionSetup( - from view: CrowdloanListViewProtocol?, + from view: (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo? ) diff --git a/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListViewManager.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListViewManager.swift new file mode 100644 index 0000000000..df718546e8 --- /dev/null +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListViewManager.swift @@ -0,0 +1,255 @@ +import Foundation +import UIKit +import SoraFoundation + +final class CrowdloanListViewManager: NSObject { + let tableView: UITableView + let chainSelectionView: VoteChainViewProtocol + + var locale = Locale.current { + didSet { + if locale != oldValue { + tableView.reloadData() + } + } + } + + weak var presenter: CrowdloanListPresenterProtocol? + private weak var parent: (ControllerBackedProtocol & LoadableViewProtocol)? + private var viewModel: CrowdloansViewModel = .init(sections: []) + + init( + tableView: UITableView, + chainSelectionView: VoteChainViewProtocol, + parent: ControllerBackedProtocol & LoadableViewProtocol + ) { + self.tableView = tableView + self.chainSelectionView = chainSelectionView + self.parent = parent + + super.init() + } +} + +extension CrowdloanListViewManager: UITableViewDataSource { + func numberOfSections(in _: UITableView) -> Int { + viewModel.sections.count + } + + func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int { + let sectionModel = viewModel.sections[section] + switch sectionModel { + case let .active(_, cellViewModels): + return cellViewModels.count + case let .completed(_, cellViewModels): + return cellViewModels.count + case .yourContributions, .about, .error, .empty: + return 1 + } + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let sectionModel = viewModel.sections[indexPath.section] + switch sectionModel { + case let .active(_, cellViewModels), let .completed(_, cellViewModels): + let cell = tableView.dequeueReusableCellWithType(CrowdloanTableViewCell.self)! + let cellViewModel = cellViewModels[indexPath.row] + cell.bind(viewModel: cellViewModel) + return cell + case let .yourContributions(model): + let cell = tableView.dequeueReusableCellWithType(YourContributionsTableViewCell.self)! + cell.view.bind(model: model) + return cell + case let .about(model): + let cell = tableView.dequeueReusableCellWithType(AboutCrowdloansTableViewCell.self)! + cell.view.bind(model: model) + return cell + case let .error(message): + let cell: BlurredTableViewCell = tableView.dequeueReusableCell(for: indexPath) + cell.view.errorDescriptionLabel.text = message + cell.view.delegate = self + cell.view.locale = locale + cell.applyStyle() + return cell + case .empty: + let cell: BlurredTableViewCell = tableView.dequeueReusableCell(for: indexPath) + let text = R.string.localizable + .crowdloanEmptyMessage_v3_9_1(preferredLanguages: locale.rLanguages) + cell.view.bind( + image: R.image.iconEmptyHistory(), + text: text + ) + cell.applyStyle() + return cell + } + } +} + +extension CrowdloanListViewManager: UITableViewDelegate { + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + + let sectionModel = viewModel.sections[indexPath.section] + switch sectionModel { + case let .active(_, cellViewModels): + guard let crowdloan = cellViewModels[indexPath.row].value else { + return + } + presenter?.selectCrowdloan(crowdloan.paraId) + case let .yourContributions(viewModel): + guard viewModel.value != nil else { + return + } + presenter?.handleYourContributions() + default: + return + } + } + + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + let sectionModel = viewModel.sections[section] + switch sectionModel { + case let .active(title, cells), let .completed(title, cells): + let headerView: VoteStatusSectionView = tableView.dequeueReusableHeaderFooterView() + switch title { + case let .loaded(value): + headerView.bind(viewModel: .loaded(value: .init(title: value, count: cells.count))) + case let .cached(value): + headerView.bind(viewModel: .cached(value: .init(title: value, count: cells.count))) + case .loading: + headerView.bind(viewModel: .loading) + } + return headerView + case let .empty(title): + let headerView: VoteStatusSectionView = tableView.dequeueReusableHeaderFooterView() + headerView.bind(viewModel: .loaded(value: .init(title: title, count: 0))) + return headerView + default: + return nil + } + } + + func tableView(_: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + let sectionModel = viewModel.sections[section] + switch sectionModel { + case let .active(state, _), let .completed(state, _): + switch state { + case .loading: + return Constants.headerMinimumHeight + case .loaded, .cached: + return UITableView.automaticDimension + } + case .empty: + return UITableView.automaticDimension + default: + return 0.0 + } + } + + func tableView(_: UITableView, willDisplay cell: UITableViewCell, forRowAt _: IndexPath) { + (cell as? SkeletonableViewCell)?.updateLoadingState() + } + + func tableView(_: UITableView, willDisplayHeaderView view: UIView, forSection _: Int) { + (view as? SkeletonableView)?.updateLoadingState() + } + + func tableView(_: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + let sectionModel = viewModel.sections[indexPath.section] + switch sectionModel { + case .yourContributions: + return Constants.yourContributionsRowHeight + case let .active(_, model), let .completed(_, model): + switch model[indexPath.row] { + case .loading: + return Constants.crowdloanRowMinimumHeight + case .cached, .loaded: + return UITableView.automaticDimension + } + default: + return UITableView.automaticDimension + } + } +} + +extension CrowdloanListViewManager: ErrorStateViewDelegate { + func didRetry(errorView _: ErrorStateView) { + presenter?.refresh(shouldReset: true) + } +} + +extension CrowdloanListViewManager: CrowdloansViewProtocol { + func didReceive(chainInfo: ChainBalanceViewModel) { + chainSelectionView.bind(viewModel: chainInfo) + } + + func didReceive(listState: CrowdloansViewModel) { + viewModel = listState + + tableView.reloadData() + } +} + +extension CrowdloanListViewManager: LoadableViewProtocol { + var loadableContentView: UIView! { + parent?.loadableContentView ?? UIView() + } + + var shouldDisableInteractionWhenLoading: Bool { + parent?.shouldDisableInteractionWhenLoading ?? false + } + + func didStartLoading() { + parent?.didStartLoading() + } + + func didStopLoading() { + parent?.didStopLoading() + } +} + +extension CrowdloanListViewManager: VoteChildViewProtocol { + var isSetup: Bool { + parent?.isSetup ?? false + } + + var controller: UIViewController { + parent?.controller ?? UIViewController() + } + + func bind() { + tableView.registerClassForCell(YourContributionsTableViewCell.self) + tableView.registerClassForCell(AboutCrowdloansTableViewCell.self) + tableView.registerClassForCell(CrowdloanTableViewCell.self) + tableView.registerClassForCell(BlurredTableViewCell.self) + tableView.registerClassForCell(BlurredTableViewCell.self) + tableView.registerHeaderFooterView(withClass: VoteStatusSectionView.self) + + tableView.dataSource = self + tableView.delegate = self + + tableView.reloadData() + } + + func unbind() { + tableView.unregisterClassForCell(YourContributionsTableViewCell.self) + tableView.unregisterClassForCell(AboutCrowdloansTableViewCell.self) + tableView.unregisterClassForCell(CrowdloanTableViewCell.self) + tableView.unregisterClassForCell(BlurredTableViewCell.self) + tableView.unregisterClassForCell(BlurredTableViewCell.self) + tableView.unregisterHeaderFooterView(withClass: VoteStatusSectionView.self) + + tableView.dataSource = nil + tableView.delegate = nil + + tableView.reloadData() + } +} + +extension CrowdloanListViewManager { + enum Constants { + static let yourContributionsRowHeight: CGFloat = 123 + static let crowdloanRowMinimumHeight: CGFloat = 145 + static let headerMinimumHeight: CGFloat = 56 + } +} diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListWireframe.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListWireframe.swift similarity index 95% rename from novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListWireframe.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListWireframe.swift index 1df247ba40..8807182717 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListWireframe.swift +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloanListWireframe.swift @@ -18,7 +18,7 @@ final class CrowdloanListWireframe: CrowdloanListWireframeProtocol { } func presentContributionSetup( - from view: CrowdloanListViewProtocol?, + from view: (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo? ) { @@ -65,7 +65,7 @@ final class CrowdloanListWireframe: CrowdloanListWireframeProtocol { view?.controller.navigationController?.pushViewController(contributionsModule.controller, animated: true) } - private func showContributionSetup(from view: CrowdloanListViewProtocol?, paraId: ParaId) { + private func showContributionSetup(from view: ControllerBackedProtocol?, paraId: ParaId) { guard let setupView = CrowdloanContributionSetupViewFactory.createView( for: paraId, state: state diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloansCalculator.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloansCalculator.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanList/CrowdloansCalculator.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloansCalculator.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloansListInteractor+Protocols.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloansListInteractor+Protocols.swift similarity index 86% rename from novawallet/Modules/Crowdloan/CrowdloanList/CrowdloansListInteractor+Protocols.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloansListInteractor+Protocols.swift index 1df95f1a61..04b401b599 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloansListInteractor+Protocols.swift +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/CrowdloansListInteractor+Protocols.swift @@ -7,7 +7,7 @@ extension CrowdloanListInteractor: CrowdloanListInteractorInputProtocol { applicationHandler.delegate = self guard let chain = crowdloanState.settings.value else { - presenter.didReceiveSelectedChain(result: .failure( + presenter?.didReceiveSelectedChain(result: .failure( PersistentValueSettingsError.missingValue )) return @@ -16,6 +16,7 @@ extension CrowdloanListInteractor: CrowdloanListInteractorInputProtocol { let accountId = selectedMetaAccount.fetch(for: chain.accountRequest())?.accountId setup(with: accountId, chain: chain) + becomeOnline(with: chain) } func setup() { @@ -33,7 +34,7 @@ extension CrowdloanListInteractor: CrowdloanListInteractorInputProtocol { func refresh() { guard let chain = crowdloanState.settings.value else { - presenter.didReceiveSelectedChain(result: .failure( + presenter?.didReceiveSelectedChain(result: .failure( PersistentValueSettingsError.missingValue )) return @@ -51,7 +52,7 @@ extension CrowdloanListInteractor: CrowdloanListInteractorInputProtocol { case .success: self?.handleSelectionChange(to: chainModel) case let .failure(error): - self?.presenter.didReceiveSelectedChain(result: .failure(error)) + self?.presenter?.didReceiveSelectedChain(result: .failure(error)) } } } @@ -83,7 +84,7 @@ extension CrowdloanListInteractor: CrowdloanLocalStorageSubscriber, CrowdloanLoc func handleBlockNumber(result: Result, chainId: ChainModel.Id) { if let chain = crowdloanState.settings.value, chain.chainId == chainId { provideCrowdloans(for: chain) - presenter.didReceiveBlockNumber(result: result) + presenter?.didReceiveBlockNumber(result: result) } } } @@ -96,7 +97,7 @@ extension CrowdloanListInteractor: WalletLocalStorageSubscriber, WalletLocalSubs ) { if let chain = crowdloanState.settings.value, chain.chainId == chainId { logger?.debug("Did receive balance for accountId: \(accountId.toHex()))") - presenter.didReceiveAccountInfo(result: result) + presenter?.didReceiveAccountInfo(result: result) } } } @@ -113,9 +114,9 @@ extension CrowdloanListInteractor: CrowdloanOffchainSubscriber, CrowdloanOffchai ) { switch result { case let .success(maybeContributions): - presenter.didReceiveExternalContributions(result: .success(maybeContributions ?? [])) + presenter?.didReceiveExternalContributions(result: .success(maybeContributions ?? [])) case let .failure(error): - presenter.didReceiveExternalContributions(result: .failure(error)) + presenter?.didReceiveExternalContributions(result: .failure(error)) } } } diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/View/AboutCrowdloansView.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/AboutCrowdloansView.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanList/View/AboutCrowdloansView.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/AboutCrowdloansView.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanEmptyView.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/CrowdloanEmptyView.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanEmptyView.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/CrowdloanEmptyView.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanTableViewCell.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/CrowdloanTableViewCell.swift similarity index 99% rename from novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanTableViewCell.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/CrowdloanTableViewCell.swift index a9434b7fc4..857ff1f2f6 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanTableViewCell.swift +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/CrowdloanTableViewCell.swift @@ -250,12 +250,11 @@ extension CrowdloanTableViewCell: SkeletonableViewCell, SkeletonableView { } func updateLoadingState() { - guard let viewModel = viewModel, viewModel.value != nil else { + if viewModel?.isLoading == false { + stopLoadingIfNeeded() + } else { startLoadingIfNeeded() - return } - - stopLoadingIfNeeded() } // swiftlint:disable function_body_length diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/View/YourContributionsView.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/YourContributionsView.swift similarity index 98% rename from novawallet/Modules/Crowdloan/CrowdloanList/View/YourContributionsView.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/YourContributionsView.swift index 6eb2f1a98a..d61cebf1ec 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/View/YourContributionsView.swift +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/View/YourContributionsView.swift @@ -169,12 +169,11 @@ extension YourContributionsView: SkeletonableView { } func updateLoadingState() { - guard let viewModel = viewModel, viewModel.value != nil else { + if viewModel?.isLoading == false { + stopLoadingIfNeeded() + } else { startLoadingIfNeeded() - return } - - stopLoadingIfNeeded() } func createSkeletons(for spaceSize: CGSize) -> [Skeletonable] { diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansChainViewModel.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansChainViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansChainViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansChainViewModel.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewInfo.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewInfo.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewInfo.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewInfo.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModel.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModel.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModelFactory.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModelFactory.swift similarity index 93% rename from novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModelFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModelFactory.swift index f37bb36e78..c194795264 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModelFactory.swift +++ b/novawallet/Modules/Vote/Crowdloan/CrowdloanList/ViewModel/CrowdloansViewModelFactory.swift @@ -5,13 +5,6 @@ import SubstrateSdk import BigInt protocol CrowdloansViewModelFactoryProtocol { - func createChainViewModel( - from chain: ChainModel, - asset: AssetModel, - balance: BigUInt?, - locale: Locale - ) -> CrowdloansChainViewModel - func createViewModel( from crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, @@ -314,40 +307,6 @@ final class CrowdloansViewModelFactory { } extension CrowdloansViewModelFactory: CrowdloansViewModelFactoryProtocol { - func createChainViewModel( - from chain: ChainModel, - asset: AssetModel, - balance: BigUInt?, - locale: Locale - ) -> CrowdloansChainViewModel { - let displayInfo = asset.displayInfo - - let amountFormatter = amountFormatterFactory.createTokenFormatter( - for: asset.displayInfo - ).value(for: locale) - - let amount: String - - if - let balance = balance, - let decimalAmount = Decimal.fromSubstrateAmount( - balance, - precision: displayInfo.assetPrecision - ) { - amount = amountFormatter.stringFromDecimal(decimalAmount) ?? "" - } else { - amount = "" - } - - let imageViewModel = RemoteImageViewModel(url: asset.icon ?? chain.icon) - - return CrowdloansChainViewModel( - networkName: chain.name, - balance: amount, - imageViewModel: imageViewModel - ) - } - func createErrorViewModel( chainAsset: ChainAssetDisplayInfo?, locale: Locale diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsInteractor.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsInteractor.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsInteractor.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsInteractor.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsPresenter.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsPresenter.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsPresenter.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsPresenter.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsProtocols.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsProtocols.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsProtocols.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsViewController.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsViewController.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsViewController.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsViewController.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsViewFactory.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsViewFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsViewFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsViewFactory.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsWireframe.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsWireframe.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsWireframe.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/CrowdloanYourContributionsWireframe.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsCell.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsCell.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsCell.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsCell.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsTotalCell.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsTotalCell.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsTotalCell.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsTotalCell.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsViewLayout.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsViewLayout.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsViewLayout.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/View/CrowdloanYourContributionsViewLayout.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanContributionViewModel.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanContributionViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanContributionViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanContributionViewModel.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanYourContributionsVMFactory.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanYourContributionsVMFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanYourContributionsVMFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanYourContributionsVMFactory.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanYourContributionsViewModel.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanYourContributionsViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanYourContributionsViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/CrowdloanYourContributionsViewModel.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/FormattedReturnInIntervalsViewModel.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/FormattedReturnInIntervalsViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/FormattedReturnInIntervalsViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/FormattedReturnInIntervalsViewModel.swift diff --git a/novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/ReturnInIntervalsViewModel.swift b/novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/ReturnInIntervalsViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CrowdloanYourContributions/ViewModel/ReturnInIntervalsViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/CrowdloanYourContributions/ViewModel/ReturnInIntervalsViewModel.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/AcalaBonusService.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/AcalaBonusService.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/AcalaBonusService.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/AcalaBonusService.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/AcalaKeys.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/AcalaKeys.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/AcalaKeys.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/AcalaKeys.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/AcalaStatementData.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/AcalaStatementData.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/AcalaStatementData.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/AcalaStatementData.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/AcalaTransferRequest.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/AcalaTransferRequest.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/AcalaTransferRequest.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/AcalaTransferRequest.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmPresenter.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmPresenter.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmPresenter.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmPresenter.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmProtocols.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmProtocols.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmProtocols.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmVC.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmVC.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmVC.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmVC.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmViewFactory.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmViewFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmViewFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionConfirm/AcalaContributionConfirmViewFactory.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupPresenter.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupPresenter.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupPresenter.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupPresenter.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupProtocols.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupProtocols.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupProtocols.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewController.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewController.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewController.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewController.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewFactory.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewFactory.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewLayout.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewLayout.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewLayout.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupViewLayout.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupWireframe.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupWireframe.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupWireframe.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/AcalaContributionSetupWireframe.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/Model/AcalaContributionMethod.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/Model/AcalaContributionMethod.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/Model/AcalaContributionMethod.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Acala/ContributionSetup/Model/AcalaContributionMethod.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Astar/AstarBonusService.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Astar/AstarBonusService.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Astar/AstarBonusService.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Astar/AstarBonusService.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Astar/AstarBonusServiceError.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Astar/AstarBonusServiceError.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Astar/AstarBonusServiceError.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Astar/AstarBonusServiceError.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Bifrost/BifrostBonusService.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Bifrost/BifrostBonusService.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Bifrost/BifrostBonusService.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Bifrost/BifrostBonusService.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/CrowdloanBonusService.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/CrowdloanBonusService.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/CrowdloanBonusService.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/CrowdloanBonusService.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/CrowdloanBonusServiceError.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/CrowdloanBonusServiceError.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/CrowdloanBonusServiceError.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/CrowdloanBonusServiceError.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/CustomCrowdloanDelegate.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/CustomCrowdloanDelegate.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/CustomCrowdloanDelegate.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/CustomCrowdloanDelegate.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Karura/KaruraBonusService.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Karura/KaruraBonusService.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Karura/KaruraBonusService.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Karura/KaruraBonusService.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Karura/KaruraResultData.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Karura/KaruraResultData.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Karura/KaruraResultData.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Karura/KaruraResultData.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Karura/KaruraStatementData.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Karura/KaruraStatementData.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Karura/KaruraStatementData.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Karura/KaruraStatementData.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Karura/KaruraVerifyInfo.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Karura/KaruraVerifyInfo.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Karura/KaruraVerifyInfo.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Karura/KaruraVerifyInfo.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Coordinator/MoonbeamCoordinator.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Coordinator/MoonbeamCoordinator.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Coordinator/MoonbeamCoordinator.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Coordinator/MoonbeamCoordinator.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Coordinator/MoonbeamFlowCoordinatorFactory.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Coordinator/MoonbeamFlowCoordinatorFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Coordinator/MoonbeamFlowCoordinatorFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Coordinator/MoonbeamFlowCoordinatorFactory.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamBonusService.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamBonusService.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamBonusService.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamBonusService.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamKeys.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamKeys.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamKeys.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamKeys.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsInteractor.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsInteractor.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsInteractor.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsInteractor.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsPresenter.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsPresenter.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsPresenter.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsPresenter.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsProtocols.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsProtocols.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsProtocols.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewController.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewController.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewController.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewController.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewFactory.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewFactory.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewFactory.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewLayout.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewLayout.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewLayout.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsViewLayout.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsWireframe.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsWireframe.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsWireframe.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/MoonbeamTerms/MoonbeamTermsWireframe.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamAgreeRemarkRequest.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamAgreeRemarkRequest.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamAgreeRemarkRequest.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamAgreeRemarkRequest.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamAgreeRemarkResponse.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamAgreeRemarkResponse.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamAgreeRemarkResponse.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamAgreeRemarkResponse.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamMakeSignatureRequest.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamMakeSignatureRequest.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamMakeSignatureRequest.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamMakeSignatureRequest.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamMakeSignatureResponse.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamMakeSignatureResponse.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamMakeSignatureResponse.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamMakeSignatureResponse.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamVerifiedResponse.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamVerifiedResponse.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamVerifiedResponse.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamVerifiedResponse.swift diff --git a/novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamVerifyRemarkRequest.swift b/novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamVerifyRemarkRequest.swift similarity index 100% rename from novawallet/Modules/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamVerifyRemarkRequest.swift rename to novawallet/Modules/Vote/Crowdloan/CustomCrowdloan/Moonbeam/Network/MoonbeamVerifyRemarkRequest.swift diff --git a/novawallet/Modules/Crowdloan/Model/Crowdloan.swift b/novawallet/Modules/Vote/Crowdloan/Model/Crowdloan.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Model/Crowdloan.swift rename to novawallet/Modules/Vote/Crowdloan/Model/Crowdloan.swift diff --git a/novawallet/Modules/Crowdloan/Model/CrowdloanContributionDict.swift b/novawallet/Modules/Vote/Crowdloan/Model/CrowdloanContributionDict.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Model/CrowdloanContributionDict.swift rename to novawallet/Modules/Vote/Crowdloan/Model/CrowdloanContributionDict.swift diff --git a/novawallet/Modules/Crowdloan/Model/CrowdloanDisplayInfo.swift b/novawallet/Modules/Vote/Crowdloan/Model/CrowdloanDisplayInfo.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Model/CrowdloanDisplayInfo.swift rename to novawallet/Modules/Vote/Crowdloan/Model/CrowdloanDisplayInfo.swift diff --git a/novawallet/Modules/Crowdloan/Model/CrowdloanFlow.swift b/novawallet/Modules/Vote/Crowdloan/Model/CrowdloanFlow.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Model/CrowdloanFlow.swift rename to novawallet/Modules/Vote/Crowdloan/Model/CrowdloanFlow.swift diff --git a/novawallet/Modules/Crowdloan/Model/CrowdloanMetadata.swift b/novawallet/Modules/Vote/Crowdloan/Model/CrowdloanMetadata.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Model/CrowdloanMetadata.swift rename to novawallet/Modules/Vote/Crowdloan/Model/CrowdloanMetadata.swift diff --git a/novawallet/Modules/Crowdloan/Model/CrowdloanSharedState.swift b/novawallet/Modules/Vote/Crowdloan/Model/CrowdloanSharedState.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Model/CrowdloanSharedState.swift rename to novawallet/Modules/Vote/Crowdloan/Model/CrowdloanSharedState.swift diff --git a/novawallet/Modules/Crowdloan/Model/CrowdloanStatus.swift b/novawallet/Modules/Vote/Crowdloan/Model/CrowdloanStatus.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Model/CrowdloanStatus.swift rename to novawallet/Modules/Vote/Crowdloan/Model/CrowdloanStatus.swift diff --git a/novawallet/Modules/Crowdloan/Model/ParachainLeaseInfo.swift b/novawallet/Modules/Vote/Crowdloan/Model/ParachainLeaseInfo.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Model/ParachainLeaseInfo.swift rename to novawallet/Modules/Vote/Crowdloan/Model/ParachainLeaseInfo.swift diff --git a/novawallet/Modules/Crowdloan/Operation/CrowdloanContributionResponse.swift b/novawallet/Modules/Vote/Crowdloan/Operation/CrowdloanContributionResponse.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/CrowdloanContributionResponse.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/CrowdloanContributionResponse.swift diff --git a/novawallet/Modules/Crowdloan/Operation/CrowdloanOperationFactory.swift b/novawallet/Modules/Vote/Crowdloan/Operation/CrowdloanOperationFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/CrowdloanOperationFactory.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/CrowdloanOperationFactory.swift diff --git a/novawallet/Modules/Crowdloan/Operation/ExternalContibution/AcalaContributionSource.swift b/novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/AcalaContributionSource.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/ExternalContibution/AcalaContributionSource.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/AcalaContributionSource.swift diff --git a/novawallet/Modules/Crowdloan/Operation/ExternalContibution/AcalaLiquidContributionResponse.swift b/novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/AcalaLiquidContributionResponse.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/ExternalContibution/AcalaLiquidContributionResponse.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/AcalaLiquidContributionResponse.swift diff --git a/novawallet/Modules/Crowdloan/Operation/ExternalContibution/ExternalContribution.swift b/novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/ExternalContribution.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/ExternalContibution/ExternalContribution.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/ExternalContribution.swift diff --git a/novawallet/Modules/Crowdloan/Operation/ExternalContibution/ExternalContributionSource.swift b/novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/ExternalContributionSource.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/ExternalContibution/ExternalContributionSource.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/ExternalContributionSource.swift diff --git a/novawallet/Modules/Crowdloan/Operation/ExternalContibution/ParallelContributionResponse.swift b/novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/ParallelContributionResponse.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/ExternalContibution/ParallelContributionResponse.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/ParallelContributionResponse.swift diff --git a/novawallet/Modules/Crowdloan/Operation/ExternalContibution/ParallelContributionSource.swift b/novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/ParallelContributionSource.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/ExternalContibution/ParallelContributionSource.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/ExternalContibution/ParallelContributionSource.swift diff --git a/novawallet/Modules/Crowdloan/Operation/LeaseParam.swift b/novawallet/Modules/Vote/Crowdloan/Operation/LeaseParam.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/LeaseParam.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/LeaseParam.swift diff --git a/novawallet/Modules/Crowdloan/Operation/UInt32+CrowdloanAccountId.swift b/novawallet/Modules/Vote/Crowdloan/Operation/UInt32+CrowdloanAccountId.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Operation/UInt32+CrowdloanAccountId.swift rename to novawallet/Modules/Vote/Crowdloan/Operation/UInt32+CrowdloanAccountId.swift diff --git a/novawallet/Modules/Crowdloan/Protocols/CrowdloanErrorPresentable.swift b/novawallet/Modules/Vote/Crowdloan/Protocols/CrowdloanErrorPresentable.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Protocols/CrowdloanErrorPresentable.swift rename to novawallet/Modules/Vote/Crowdloan/Protocols/CrowdloanErrorPresentable.swift diff --git a/novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanPresenter.swift b/novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanPresenter.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanPresenter.swift rename to novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanPresenter.swift diff --git a/novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanProtocols.swift b/novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanProtocols.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanProtocols.swift rename to novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanProtocols.swift diff --git a/novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewController.swift b/novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewController.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewController.swift rename to novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewController.swift diff --git a/novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewFactory.swift b/novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewFactory.swift rename to novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewFactory.swift diff --git a/novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewLayout.swift b/novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewLayout.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewLayout.swift rename to novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanViewLayout.swift diff --git a/novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanWireframe.swift b/novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanWireframe.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ReferralCrowdloan/ReferralCrowdloanWireframe.swift rename to novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ReferralCrowdloanWireframe.swift diff --git a/novawallet/Modules/Crowdloan/ReferralCrowdloan/ViewModel/AttributedString+Crowdloan.swift b/novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ViewModel/AttributedString+Crowdloan.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ReferralCrowdloan/ViewModel/AttributedString+Crowdloan.swift rename to novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ViewModel/AttributedString+Crowdloan.swift diff --git a/novawallet/Modules/Crowdloan/ReferralCrowdloan/ViewModel/ReferralCrowdloanViewModel.swift b/novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ViewModel/ReferralCrowdloanViewModel.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ReferralCrowdloan/ViewModel/ReferralCrowdloanViewModel.swift rename to novawallet/Modules/Vote/Crowdloan/ReferralCrowdloan/ViewModel/ReferralCrowdloanViewModel.swift diff --git a/novawallet/Modules/Crowdloan/Validation/CrowdloanDataValidatorFactory.swift b/novawallet/Modules/Vote/Crowdloan/Validation/CrowdloanDataValidatorFactory.swift similarity index 100% rename from novawallet/Modules/Crowdloan/Validation/CrowdloanDataValidatorFactory.swift rename to novawallet/Modules/Vote/Crowdloan/Validation/CrowdloanDataValidatorFactory.swift diff --git a/novawallet/Modules/Crowdloan/View/BlurredTableViewCell.swift b/novawallet/Modules/Vote/Crowdloan/View/BlurredTableViewCell.swift similarity index 89% rename from novawallet/Modules/Crowdloan/View/BlurredTableViewCell.swift rename to novawallet/Modules/Vote/Crowdloan/View/BlurredTableViewCell.swift index 9b16dfeb66..68856eda0b 100644 --- a/novawallet/Modules/Crowdloan/View/BlurredTableViewCell.swift +++ b/novawallet/Modules/Vote/Crowdloan/View/BlurredTableViewCell.swift @@ -4,6 +4,8 @@ class BlurredTableViewCell: UITableViewCell where TContentView: UI let view: TContentView = .init() let backgroundBlurView = TriangularedBlurView() + var shouldApplyHighlighting: Bool = false + var contentInsets: UIEdgeInsets = .init(top: 0, left: 16, bottom: 0, right: 16) { didSet { updateLayout() @@ -24,6 +26,14 @@ class BlurredTableViewCell: UITableViewCell where TContentView: UI setupLayout() } + override func setHighlighted(_ highlighted: Bool, animated: Bool) { + super.setHighlighted(highlighted, animated: animated) + + backgroundBlurView.overlayView.fillColor = shouldApplyHighlighting && highlighted ? + R.color.colorAccentSelected()! + : .clear + } + @available(*, unavailable) required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") diff --git a/novawallet/Modules/Crowdloan/View/CrowdloanRewardDestinationView.swift b/novawallet/Modules/Vote/Crowdloan/View/CrowdloanRewardDestinationView.swift similarity index 100% rename from novawallet/Modules/Crowdloan/View/CrowdloanRewardDestinationView.swift rename to novawallet/Modules/Vote/Crowdloan/View/CrowdloanRewardDestinationView.swift diff --git a/novawallet/Modules/Crowdloan/ViewModel/CrowdloanRewardDestinationVM.swift b/novawallet/Modules/Vote/Crowdloan/ViewModel/CrowdloanRewardDestinationVM.swift similarity index 100% rename from novawallet/Modules/Crowdloan/ViewModel/CrowdloanRewardDestinationVM.swift rename to novawallet/Modules/Vote/Crowdloan/ViewModel/CrowdloanRewardDestinationVM.swift diff --git a/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionPresenter.swift b/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionPresenter.swift new file mode 100644 index 0000000000..03bca00e1d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionPresenter.swift @@ -0,0 +1,108 @@ +import Foundation +import SoraFoundation + +final class GovernanceAssetSelectionPresenter: AssetSelectionBasePresenter { + var wireframe: GovernanceAssetSelectionWireframeProtocol? { + baseWireframe as? GovernanceAssetSelectionWireframeProtocol + } + + struct Option { + let chainAsset: ChainAsset + let governanceType: GovernanceType + } + + private var availableOptions: [Option] = [] + + private var selectedGovernanceType: GovernanceType? + private var selectedChainId: ChainModel.Id? + + init( + interactor: AssetSelectionInteractorInputProtocol, + wireframe: GovernanceAssetSelectionWireframeProtocol, + selectedChainId: ChainModel.Id?, + selectedGovernanceType: GovernanceType?, + assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol, + localizationManager: LocalizationManagerProtocol + ) { + self.selectedChainId = selectedChainId + self.selectedGovernanceType = selectedGovernanceType + + super.init( + interactor: interactor, + baseWireframe: wireframe, + assetBalanceFormatterFactory: assetBalanceFormatterFactory, + localizationManager: localizationManager + ) + } + + private func createViewModel( + for chainAsset: ChainAsset, + governanceType: GovernanceType + ) -> SelectableIconDetailsListViewModel { + let chain = chainAsset.chain + let asset = chainAsset.asset + + let icon = RemoteImageViewModel(url: asset.icon ?? chain.icon) + let title = governanceType.title(for: chain) + let isSelected = selectedChainId == chain.chainId && selectedGovernanceType == governanceType + let balance = extractFormattedBalance(for: chainAsset) ?? "" + + return SelectableIconDetailsListViewModel( + title: title, + subtitle: balance, + icon: icon, + isSelected: isSelected + ) + } + + override func updateView() { + // show gov2 options first but not testnets + availableOptions = assets.reduce(into: [Option]()) { accum, chainAsset in + if chainAsset.chain.hasGovernanceV2, !chainAsset.chain.isTestnet { + accum.append(.init(chainAsset: chainAsset, governanceType: .governanceV2)) + } + } + + // then show gov1 options + availableOptions = assets.reduce(into: availableOptions) { accum, chainAsset in + if chainAsset.chain.hasGovernanceV1, !chainAsset.chain.isTestnet { + accum.append(.init(chainAsset: chainAsset, governanceType: .governanceV1)) + } + } + + // then show gov2 testnets + availableOptions = assets.reduce(into: availableOptions) { accum, chainAsset in + if chainAsset.chain.hasGovernanceV2, chainAsset.chain.isTestnet { + accum.append(.init(chainAsset: chainAsset, governanceType: .governanceV2)) + } + } + + // finally show gov1 testnets + availableOptions = assets.reduce(into: availableOptions) { accum, chainAsset in + if chainAsset.chain.hasGovernanceV1, chainAsset.chain.isTestnet { + accum.append(.init(chainAsset: chainAsset, governanceType: .governanceV1)) + } + } + + let viewModels = availableOptions.map { + createViewModel(for: $0.chainAsset, governanceType: $0.governanceType) + } + + updateViewModels(viewModels) + + view?.didReload() + } + + override func handleAssetSelection(at index: Int) { + guard let view = view else { + return + } + + let option = availableOptions[index] + + wireframe?.complete( + on: view, + option: .init(chain: option.chainAsset.chain, type: option.governanceType) + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionProtocols.swift b/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionProtocols.swift new file mode 100644 index 0000000000..e1da74fcaf --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionProtocols.swift @@ -0,0 +1,12 @@ +import Foundation + +protocol GovernanceAssetSelectionDelegate: AnyObject { + func governanceAssetSelection( + view: AssetSelectionViewProtocol, + didCompleteWith option: GovernanceSelectedOption + ) +} + +protocol GovernanceAssetSelectionWireframeProtocol: AssetSelectionBaseWireframeProtocol { + func complete(on view: AssetSelectionViewProtocol, option: GovernanceSelectedOption) +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionViewFactory.swift b/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionViewFactory.swift new file mode 100644 index 0000000000..2f08f7941b --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionViewFactory.swift @@ -0,0 +1,62 @@ +import Foundation +import RobinHood +import SoraFoundation + +final class GovernanceAssetSelectionViewFactory { + static func createView( + for delegate: GovernanceAssetSelectionDelegate, + chainId: ChainModel.Id?, + governanceType: GovernanceType? + ) -> AssetSelectionViewProtocol? { + guard let currencyManager = CurrencyManager.shared else { + return nil + } + + let repository = ChainRepositoryFactory().createRepository( + for: nil, + sortDescriptors: [NSSortDescriptor.chainsByAddressPrefix] + ) + + let interactor = AssetSelectionInteractor( + selectedMetaAccount: SelectedWalletSettings.shared.value, + balanceSlice: \.freeInPlank, + repository: AnyDataProviderRepository(repository), + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactory.shared, + priceLocalSubscriptionFactory: PriceProviderFactory.shared, + assetFilter: { $0.chain.hasGovernance && $0.asset.isUtility }, + currencyManager: currencyManager, + operationQueue: OperationManagerFacade.sharedDefaultQueue + ) + + let wireframe = GovernanceAssetSelectionWireframe(delegate: delegate) + + let assetBalanceFormatterFactory = AssetBalanceFormatterFactory() + + let localizationManager = LocalizationManager.shared + + let presenter = GovernanceAssetSelectionPresenter( + interactor: interactor, + wireframe: wireframe, + selectedChainId: chainId, + selectedGovernanceType: governanceType, + assetBalanceFormatterFactory: assetBalanceFormatterFactory, + localizationManager: localizationManager + ) + + let title = LocalizableResource { locale in + R.string.localizable.commonSelectAsset(preferredLanguages: locale.rLanguages) + } + + let view = AssetSelectionViewController( + nibName: R.nib.selectionListViewController.name, + localizedTitle: title, + presenter: presenter, + localizationManager: localizationManager + ) + + presenter.view = view + interactor.presenter = presenter + + return view + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionWireframe.swift b/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionWireframe.swift new file mode 100644 index 0000000000..677af2ac7a --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceAssetSelection/GovernanceAssetSelectionWireframe.swift @@ -0,0 +1,17 @@ +import Foundation + +final class GovernanceAssetSelectionWireframe { + weak var delegate: GovernanceAssetSelectionDelegate? + + init(delegate: GovernanceAssetSelectionDelegate) { + self.delegate = delegate + } +} + +extension GovernanceAssetSelectionWireframe: GovernanceAssetSelectionWireframeProtocol { + func complete(on view: AssetSelectionViewProtocol, option: GovernanceSelectedOption) { + view.controller.dismiss(animated: true, completion: nil) + + delegate?.governanceAssetSelection(view: view, didCompleteWith: option) + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockInteractor.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockInteractor.swift new file mode 100644 index 0000000000..1475792e96 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockInteractor.swift @@ -0,0 +1,221 @@ +import Foundation +import SubstrateSdk +import RobinHood + +class GovernanceUnlockInteractor: GovernanceUnlockInteractorInputProtocol, AnyCancellableCleaning { + weak var basePresenter: GovernanceUnlockInteractorOutputProtocol? + + let chain: ChainModel + let selectedAccount: MetaChainAccountResponse + let subscriptionFactory: GovernanceSubscriptionFactoryProtocol + let lockStateFactory: GovernanceLockStateFactoryProtocol + let priceLocalSubscriptionFactory: PriceProviderFactoryProtocol + let generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol + let blockTimeService: BlockTimeEstimationServiceProtocol + let blockTimeFactory: BlockTimeOperationFactoryProtocol + let connection: JSONRPCEngine + let runtimeProvider: RuntimeProviderProtocol + let operationQueue: OperationQueue + + private var priceProvider: AnySingleValueProvider? + private var blockNumberProvider: AnyDataProvider? + + private var blockTimeCancellable: CancellableCall? + private var unlockScheduleCancellable: CancellableCall? + + init( + chain: ChainModel, + selectedAccount: MetaChainAccountResponse, + subscriptionFactory: GovernanceSubscriptionFactoryProtocol, + lockStateFactory: GovernanceLockStateFactoryProtocol, + priceLocalSubscriptionFactory: PriceProviderFactoryProtocol, + generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol, + blockTimeService: BlockTimeEstimationServiceProtocol, + blockTimeFactory: BlockTimeOperationFactoryProtocol, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + operationQueue: OperationQueue, + currencyManager: CurrencyManagerProtocol + ) { + self.chain = chain + self.selectedAccount = selectedAccount + self.subscriptionFactory = subscriptionFactory + self.lockStateFactory = lockStateFactory + self.priceLocalSubscriptionFactory = priceLocalSubscriptionFactory + self.generalLocalSubscriptionFactory = generalLocalSubscriptionFactory + self.blockTimeService = blockTimeService + self.blockTimeFactory = blockTimeFactory + self.connection = connection + self.runtimeProvider = runtimeProvider + self.operationQueue = operationQueue + self.currencyManager = currencyManager + } + + deinit { + clearVotingSubscription() + clearCancellable() + } + + private func clearCancellable() { + clear(cancellable: &blockTimeCancellable) + clear(cancellable: &unlockScheduleCancellable) + } + + private func provideBlockTime() { + guard blockTimeCancellable == nil else { + return + } + + let wrapper = blockTimeFactory.createBlockTimeOperation( + from: runtimeProvider, + blockTimeEstimationService: blockTimeService + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.blockTimeCancellable else { + return + } + + self?.blockTimeCancellable = nil + + do { + let blockTimeModel = try wrapper.targetOperation.extractNoCancellableResultData() + self?.basePresenter?.didReceiveBlockTime(blockTimeModel) + } catch { + self?.basePresenter?.didReceiveBaseError(.blockTimeFetchFailed(error)) + } + } + } + + blockTimeCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + func provideUnlockSchedule(for tracksVoting: ReferendumTracksVotingDistribution, blockHash: Data?) { + clear(cancellable: &unlockScheduleCancellable) + + let wrapper = lockStateFactory.buildUnlockScheduleWrapper( + for: tracksVoting, + from: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard self?.unlockScheduleCancellable === wrapper else { + return + } + + self?.unlockScheduleCancellable = nil + + do { + let schedule = try wrapper.targetOperation.extractNoCancellableResultData() + self?.basePresenter?.didReceiveUnlockSchedule(schedule) + } catch { + self?.basePresenter?.didReceiveBaseError(.unlockScheduleFetchFailed(error)) + } + } + } + + unlockScheduleCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + private func clearVotingSubscription() { + subscriptionFactory.unsubscribeFromAccountVotes(self, accountId: selectedAccount.chainAccount.accountId) + } + + private func subscribeVoting() { + subscriptionFactory.subscribeToAccountVotes( + self, + accountId: selectedAccount.chainAccount.accountId + ) { [weak self] result in + switch result { + case let .success(storageResult): + self?.basePresenter?.didReceiveVoting(storageResult) + case let .failure(error): + self?.basePresenter?.didReceiveBaseError(.votingSubscriptionFailed(error)) + case .none: + self?.basePresenter?.didReceiveVoting(.init(value: nil, blockHash: nil)) + } + } + } + + private func clearAndSubscribeBlockNumber() { + blockNumberProvider?.removeObserver(self) + blockNumberProvider = nil + + blockNumberProvider = subscribeToBlockNumber(for: chain.chainId) + } + + private func clearAndSubscribePrice() { + priceProvider?.removeObserver(self) + priceProvider = nil + + if let priceId = chain.utilityAsset()?.priceId { + priceProvider = subscribeToPrice(for: priceId, currency: selectedCurrency) + } + } + + private func makeSubscriptions() { + clearAndSubscribePrice() + clearAndSubscribeBlockNumber() + + clearVotingSubscription() + subscribeVoting() + } + + func setup() { + makeSubscriptions() + } + + func refreshBlockTime() { + provideBlockTime() + } + + func refreshUnlockSchedule(for tracksVoting: ReferendumTracksVotingDistribution, blockHash: Data?) { + provideUnlockSchedule(for: tracksVoting, blockHash: blockHash) + } + + func remakeSubscriptions() { + makeSubscriptions() + } +} + +extension GovernanceUnlockInteractor: PriceLocalSubscriptionHandler, PriceLocalStorageSubscriber { + func handlePrice(result: Result, priceId _: AssetModel.PriceId) { + switch result { + case let .success(price): + basePresenter?.didReceivePrice(price) + case let .failure(error): + basePresenter?.didReceiveBaseError(.priceSubscriptionFailed(error)) + } + } +} + +extension GovernanceUnlockInteractor: GeneralLocalStorageSubscriber, GeneralLocalStorageHandler { + func handleBlockNumber(result: Result, chainId _: ChainModel.Id) { + switch result { + case let .success(blockNumber): + if let blockNumber = blockNumber { + basePresenter?.didReceiveBlockNumber(blockNumber) + } + case let .failure(error): + basePresenter?.didReceiveBaseError(.blockNumberSubscriptionFailed(error)) + } + } +} + +extension GovernanceUnlockInteractor: SelectedCurrencyDepending { + func applyCurrency() { + guard basePresenter != nil else { + return + } + + clearAndSubscribePrice() + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockInteractorError.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockInteractorError.swift new file mode 100644 index 0000000000..982381e356 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockInteractorError.swift @@ -0,0 +1,9 @@ +import Foundation + +enum GovernanceUnlockInteractorError: Error { + case votingSubscriptionFailed(_ internalError: Error) + case unlockScheduleFetchFailed(_ internalError: Error) + case priceSubscriptionFailed(_ internalError: Error) + case blockNumberSubscriptionFailed(_ internalError: Error) + case blockTimeFetchFailed(_ internalError: Error) +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockProtocols.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockProtocols.swift new file mode 100644 index 0000000000..8e07ce2681 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlock/GovernanceUnlockProtocols.swift @@ -0,0 +1,17 @@ +import Foundation + +protocol GovernanceUnlockInteractorInputProtocol: AnyObject { + func setup() + func refreshBlockTime() + func refreshUnlockSchedule(for tracksVoting: ReferendumTracksVotingDistribution, blockHash: Data?) + func remakeSubscriptions() +} + +protocol GovernanceUnlockInteractorOutputProtocol: AnyObject { + func didReceiveVoting(_ result: CallbackStorageSubscriptionResult) + func didReceiveUnlockSchedule(_ schedule: GovernanceUnlockSchedule) + func didReceiveBlockNumber(_ block: BlockNumber) + func didReceiveBlockTime(_ time: BlockTime) + func didReceivePrice(_ price: PriceData?) + func didReceiveBaseError(_ error: GovernanceUnlockInteractorError) +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmInteractor.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmInteractor.swift new file mode 100644 index 0000000000..91f53ef412 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmInteractor.swift @@ -0,0 +1,185 @@ +import UIKit +import SubstrateSdk +import RobinHood +import BigInt + +final class GovernanceUnlockConfirmInteractor: GovernanceUnlockInteractor, AnyProviderAutoCleaning { + var presenter: GovernanceUnlockConfirmInteractorOutputProtocol? { + get { + basePresenter as? GovernanceUnlockConfirmInteractorOutputProtocol + } + + set { + basePresenter = newValue + } + } + + let walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol + let extrinsicFactory: GovernanceExtrinsicFactoryProtocol + let extrinsicService: ExtrinsicServiceProtocol + let signer: SigningWrapperProtocol + + private var locksSubscription: StreamableProvider? + private var assetBalanceProvider: StreamableProvider? + + init( + chain: ChainModel, + selectedAccount: MetaChainAccountResponse, + subscriptionFactory: GovernanceSubscriptionFactoryProtocol, + lockStateFactory: GovernanceLockStateFactoryProtocol, + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol, + extrinsicFactory: GovernanceExtrinsicFactoryProtocol, + extrinsicService: ExtrinsicServiceProtocol, + signer: SigningWrapperProtocol, + priceLocalSubscriptionFactory: PriceProviderFactoryProtocol, + generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol, + blockTimeService: BlockTimeEstimationServiceProtocol, + blockTimeFactory: BlockTimeOperationFactoryProtocol, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + operationQueue: OperationQueue, + currencyManager: CurrencyManagerProtocol + ) { + self.walletLocalSubscriptionFactory = walletLocalSubscriptionFactory + self.extrinsicFactory = extrinsicFactory + self.extrinsicService = extrinsicService + self.signer = signer + + super.init( + chain: chain, + selectedAccount: selectedAccount, + subscriptionFactory: subscriptionFactory, + lockStateFactory: lockStateFactory, + priceLocalSubscriptionFactory: priceLocalSubscriptionFactory, + generalLocalSubscriptionFactory: generalLocalSubscriptionFactory, + blockTimeService: blockTimeService, + blockTimeFactory: blockTimeFactory, + connection: connection, + runtimeProvider: runtimeProvider, + operationQueue: operationQueue, + currencyManager: currencyManager + ) + } + + private func clearAndSubscribeLocks() { + clear(streamableProvider: &locksSubscription) + + guard let assetId = chain.utilityAsset()?.assetId else { + return + } + + locksSubscription = subscribeToLocksProvider( + for: selectedAccount.chainAccount.accountId, + chainId: chain.chainId, + assetId: assetId + ) + } + + private func clearAndSubscribeBalance() { + clear(streamableProvider: &assetBalanceProvider) + + guard let assetId = chain.utilityAsset()?.assetId else { + return + } + + assetBalanceProvider = subscribeToAssetBalanceProvider( + for: selectedAccount.chainAccount.accountId, + chainId: chain.chainId, + assetId: assetId + ) + } + + private func createExtrinsicBuilderClosure( + for actions: Set + ) -> ExtrinsicBuilderClosure { + { [weak self] builder in + guard let strongSelf = self else { + return builder + } + + return try strongSelf.extrinsicFactory.unlock( + with: actions, + accountId: strongSelf.selectedAccount.chainAccount.accountId, + builder: builder + ) + } + } + + private func makeSubscription() { + clearAndSubscribeBalance() + clearAndSubscribeLocks() + } + + override func setup() { + super.setup() + + makeSubscription() + } + + override func remakeSubscriptions() { + super.remakeSubscriptions() + + makeSubscription() + } +} + +extension GovernanceUnlockConfirmInteractor: GovernanceUnlockConfirmInteractorInputProtocol { + func estimateFee(for actions: Set) { + let closure = createExtrinsicBuilderClosure(for: actions) + + extrinsicService.estimateFee(closure, runningIn: .main) { [weak self] result in + switch result { + case let .success(feeInfo): + if let fee = BigUInt(feeInfo.fee) { + self?.presenter?.didReceiveFee(fee) + } + case let .failure(error): + self?.presenter?.didReceiveError(.feeFetchFailed(error)) + } + } + } + + func unlock(using actions: Set) { + let closure = createExtrinsicBuilderClosure(for: actions) + + extrinsicService.submit(closure, signer: signer, runningIn: .main) { [weak self] result in + switch result { + case let .success(hashString): + self?.presenter?.didReceiveUnlockHash(hashString) + case let .failure(error): + self?.presenter?.didReceiveError(.unlockFailed(error)) + } + } + } +} + +extension GovernanceUnlockConfirmInteractor: WalletLocalStorageSubscriber, WalletLocalSubscriptionHandler { + func handleAccountLocks( + result: Result<[DataProviderChange], Error>, + accountId _: AccountId, + chainId _: ChainModel.Id, + assetId _: AssetModel.Id + ) { + switch result { + case let .success(changes): + let locks = changes.mergeToDict([:]).values + presenter?.didReceiveLocks(Array(locks)) + case let .failure(error): + presenter?.didReceiveError(.locksSubscriptionFailed(error)) + } + } + + func handleAssetBalance( + result: Result, + accountId _: AccountId, + chainId _: ChainModel.Id, + assetId _: AssetModel.Id + ) { + switch result { + case let .success(changes): + presenter?.didReceiveBalance(changes) + case let .failure(error): + presenter?.didReceiveError(.balanceSubscriptionFailed(error)) + } + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmPresenter.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmPresenter.swift new file mode 100644 index 0000000000..4f20e51af1 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmPresenter.swift @@ -0,0 +1,357 @@ +import Foundation +import BigInt +import SoraFoundation + +final class GovernanceUnlockConfirmPresenter { + weak var view: GovernanceUnlockConfirmViewProtocol? + let wireframe: GovernanceUnlockConfirmWireframeProtocol + let interactor: GovernanceUnlockConfirmInteractorInputProtocol + + let chain: ChainModel + let selectedAccount: MetaChainAccountResponse + let balanceViewModelFactory: BalanceViewModelFactoryProtocol + let lockChangeViewModelFactory: ReferendumLockChangeViewModelFactoryProtocol + let dataValidatingFactory: GovernanceValidatorFactoryProtocol + let logger: LoggerProtocol + + private var votingResult: CallbackStorageSubscriptionResult + private var unlockSchedule: GovernanceUnlockSchedule + private var locks: AssetLocks? + private var assetBalance: AssetBalance? + private var blockNumber: BlockNumber + private var price: PriceData? + private var fee: BigUInt? + + private lazy var walletDisplayViewModelFactory = WalletAccountViewModelFactory() + private lazy var addressDisplayViewModelFactory = DisplayAddressViewModelFactory() + + init( + interactor: GovernanceUnlockConfirmInteractorInputProtocol, + wireframe: GovernanceUnlockConfirmWireframeProtocol, + chain: ChainModel, + selectedAccount: MetaChainAccountResponse, + initData: GovernanceUnlockConfirmInitData, + balanceViewModelFactory: BalanceViewModelFactoryProtocol, + lockChangeViewModelFactory: ReferendumLockChangeViewModelFactoryProtocol, + dataValidatingFactory: GovernanceValidatorFactoryProtocol, + localizationManager: LocalizationManagerProtocol, + logger: LoggerProtocol + ) { + self.interactor = interactor + self.wireframe = wireframe + self.chain = chain + self.selectedAccount = selectedAccount + votingResult = initData.votingResult + unlockSchedule = initData.unlockSchedule + blockNumber = initData.blockNumber + self.balanceViewModelFactory = balanceViewModelFactory + self.lockChangeViewModelFactory = lockChangeViewModelFactory + self.dataValidatingFactory = dataValidatingFactory + self.logger = logger + self.localizationManager = localizationManager + } + + private func provideAmountViewModel() { + let amount = unlockSchedule.availableUnlock(at: blockNumber).amount + + guard + let precision = chain.utilityAsset()?.displayInfo.assetPrecision, + let decimalAmount = Decimal.fromSubstrateAmount(amount, precision: precision) else { + return + } + + let viewModel = balanceViewModelFactory.balanceFromPrice( + decimalAmount, + priceData: price + ).value(for: selectedLocale) + + view?.didReceiveAmount(viewModel: viewModel) + } + + private func provideWalletViewModel() { + guard + let viewModel = try? walletDisplayViewModelFactory.createDisplayViewModel( + from: selectedAccount + ) else { + return + } + + view?.didReceiveWallet(viewModel: viewModel.cellViewModel) + } + + private func provideAccountViewModel() { + guard let address = selectedAccount.chainAccount.toAddress() else { + return + } + + let viewModel = addressDisplayViewModelFactory.createViewModel(from: address) + view?.didReceiveAccount(viewModel: viewModel) + } + + private func provideFeeViewModel() { + if let fee = fee { + guard let precision = chain.utilityAsset()?.displayInfo.assetPrecision else { + return + } + + let feeDecimal = Decimal.fromSubstrateAmount( + fee, + precision: precision + ) ?? 0.0 + + let viewModel = balanceViewModelFactory.balanceFromPrice(feeDecimal, priceData: price) + .value(for: selectedLocale) + + view?.didReceiveFee(viewModel: viewModel) + } else { + view?.didReceiveFee(viewModel: nil) + } + } + + private func provideChangesViewModels() { + guard let tracksVoting = votingResult.value else { + return + } + + let totalLocked = tracksVoting.totalLocked() + let unlocking = unlockSchedule.availableUnlock(at: blockNumber).amount + let remainedLocked = totalLocked > unlocking ? totalLocked - unlocking : 0 + + if + let govViewModel = lockChangeViewModelFactory.createAmountViewModel( + initLocked: totalLocked, + resultLocked: remainedLocked, + locale: selectedLocale + ) { + view?.didReceiveLockedAmount(viewModel: govViewModel) + } + + if + let assetBalance = assetBalance, + let locks = locks, + let transferableViewModel = lockChangeViewModelFactory.createTransferableAmountViewModel( + resultLocked: remainedLocked, + balance: assetBalance, + locks: locks, + locale: selectedLocale + ) { + view?.didReceiveTransferableAmount(viewModel: transferableViewModel) + } + + if let locks = locks { + let remainedLocksViewModel = lockChangeViewModelFactory.createRemainedOtherLocksViewModel( + locks: locks, + locale: selectedLocale + ) + + view?.didReceiveRemainedLock(viewModel: remainedLocksViewModel) + } else { + view?.didReceiveRemainedLock(viewModel: nil) + } + } + + private func updateView() { + provideAmountViewModel() + provideWalletViewModel() + provideAccountViewModel() + provideFeeViewModel() + provideChangesViewModels() + } + + private func refreshFee() { + fee = nil + + provideFeeViewModel() + + let actions = unlockSchedule.availableUnlock(at: blockNumber).actions + + guard !actions.isEmpty else { + fee = 0 + + provideFeeViewModel() + + return + } + + interactor.estimateFee(for: actions) + } + + private func refreshUnlockSchedule() { + guard let tracksVoting = votingResult.value else { + return + } + + interactor.refreshUnlockSchedule(for: tracksVoting, blockHash: nil) + } +} + +extension GovernanceUnlockConfirmPresenter: GovernanceUnlockConfirmPresenterProtocol { + func setup() { + updateView() + + interactor.setup() + + refreshFee() + } + + func confirm() { + guard let assetInfo = chain.utilityAssetDisplayInfo() else { + return + } + + DataValidationRunner( + validators: [ + dataValidatingFactory.hasInPlank( + fee: fee, + locale: selectedLocale, + precision: assetInfo.assetPrecision + ) { [weak self] in + self?.refreshFee() + }, + dataValidatingFactory.canPayFeeInPlank( + balance: assetBalance?.transferable, + fee: fee, + asset: assetInfo, + locale: selectedLocale + ) + ] + ).runValidation { [weak self] in + guard + let blockNumber = self?.blockNumber, + let actions = self?.unlockSchedule.availableUnlock(at: blockNumber).actions, + !actions.isEmpty else { + return + } + + self?.view?.didStartLoading() + self?.interactor.unlock(using: actions) + } + } + + func presentSenderDetails() { + guard + let address = try? selectedAccount.chainAccount.accountId.toAddress(using: chain.chainFormat), + let view = view else { + return + } + + wireframe.presentAccountOptions( + from: view, + address: address, + chain: chain, + locale: selectedLocale + ) + } +} + +extension GovernanceUnlockConfirmPresenter: GovernanceUnlockConfirmInteractorOutputProtocol { + func didReceiveBalance(_ assetBalance: AssetBalance?) { + self.assetBalance = assetBalance + + provideChangesViewModels() + } + + func didReceiveLocks(_ locks: AssetLocks) { + self.locks = locks + + provideChangesViewModels() + } + + func didReceiveUnlockHash(_: String) { + view?.didStopLoading() + + wireframe.presentExtrinsicSubmission(from: view, completionAction: .dismiss, locale: selectedLocale) + } + + func didReceiveFee(_ fee: BigUInt) { + self.fee = fee + + provideFeeViewModel() + } + + func didReceiveError(_ error: GovernanceUnlockConfirmInteractorError) { + logger.error("Did receive error: \(error)") + + switch error { + case .locksSubscriptionFailed, .balanceSubscriptionFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case .feeFetchFailed: + wireframe.presentFeeStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshFee() + } + case let .unlockFailed(internalError): + view?.didStopLoading() + + if internalError.isWatchOnlySigning { + wireframe.presentDismissingNoSigningView(from: view) + } else { + _ = wireframe.present(error: internalError, from: view, locale: selectedLocale) + } + } + } + + func didReceiveVoting(_ result: CallbackStorageSubscriptionResult) { + votingResult = result + + if let tracksVoting = result.value { + interactor.refreshUnlockSchedule(for: tracksVoting, blockHash: result.blockHash) + } + + provideChangesViewModels() + } + + func didReceiveUnlockSchedule(_ schedule: GovernanceUnlockSchedule) { + if schedule != unlockSchedule { + unlockSchedule = schedule + + provideChangesViewModels() + provideAmountViewModel() + refreshFee() + } + } + + func didReceiveBlockNumber(_ block: BlockNumber) { + blockNumber = block + + provideFeeViewModel() + + provideChangesViewModels() + provideAmountViewModel() + refreshUnlockSchedule() + } + + func didReceiveBlockTime(_: BlockTime) {} + + func didReceivePrice(_ price: PriceData?) { + self.price = price + + provideAmountViewModel() + } + + func didReceiveBaseError(_ error: GovernanceUnlockInteractorError) { + logger.error("Did receive base error: \(error)") + + switch error { + case .votingSubscriptionFailed, .priceSubscriptionFailed, .blockNumberSubscriptionFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case .unlockScheduleFetchFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshUnlockSchedule() + } + case .blockTimeFetchFailed: + break + } + } +} + +extension GovernanceUnlockConfirmPresenter: Localizable { + func applyLocalization() { + if let view = view, view.isSetup { + updateView() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmProtocols.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmProtocols.swift new file mode 100644 index 0000000000..7b09765b5c --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmProtocols.swift @@ -0,0 +1,34 @@ +import BigInt + +protocol GovernanceUnlockConfirmViewProtocol: ControllerBackedProtocol, LoadableViewProtocol { + func didReceiveAmount(viewModel: BalanceViewModelProtocol) + func didReceiveWallet(viewModel: StackCellViewModel) + func didReceiveAccount(viewModel: DisplayAddressViewModel) + func didReceiveFee(viewModel: BalanceViewModelProtocol?) + func didReceiveTransferableAmount(viewModel: ReferendumLockTransitionViewModel) + func didReceiveLockedAmount(viewModel: ReferendumLockTransitionViewModel) + func didReceiveRemainedLock(viewModel: GovernanceRemainedLockViewModel?) +} + +protocol GovernanceUnlockConfirmPresenterProtocol: AnyObject { + func setup() + func confirm() + func presentSenderDetails() +} + +protocol GovernanceUnlockConfirmInteractorInputProtocol: GovernanceUnlockInteractorInputProtocol { + func estimateFee(for actions: Set) + func unlock(using actions: Set) +} + +protocol GovernanceUnlockConfirmInteractorOutputProtocol: GovernanceUnlockInteractorOutputProtocol { + func didReceiveBalance(_ assetBalance: AssetBalance?) + func didReceiveLocks(_ locks: AssetLocks) + func didReceiveUnlockHash(_ hash: String) + func didReceiveFee(_ fee: BigUInt) + func didReceiveError(_ error: GovernanceUnlockConfirmInteractorError) +} + +protocol GovernanceUnlockConfirmWireframeProtocol: AlertPresentable, ErrorPresentable, CommonRetryable, + FeeRetryable, MessageSheetPresentable, AddressOptionsPresentable, + ExtrinsicSubmissionPresenting, GovernanceErrorPresentable {} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewController.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewController.swift new file mode 100644 index 0000000000..fbd4342384 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewController.swift @@ -0,0 +1,156 @@ +import UIKit +import SoraFoundation + +final class GovernanceUnlockConfirmViewController: UIViewController, ViewHolder, ImportantViewProtocol { + typealias RootViewType = GovernanceUnlockConfirmViewLayout + + let presenter: GovernanceUnlockConfirmPresenterProtocol + + init( + presenter: GovernanceUnlockConfirmPresenterProtocol, + localizationManager: LocalizationManagerProtocol + ) { + self.presenter = presenter + super.init(nibName: nil, bundle: nil) + + self.localizationManager = localizationManager + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = GovernanceUnlockConfirmViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupHandlers() + setupLocalization() + + presenter.setup() + } + + private func setupHandlers() { + rootView.accountCell.addTarget(self, action: #selector(actionSender), for: .touchUpInside) + + rootView.actionLoadableView.actionButton.addTarget( + self, + action: #selector(actionConfirm), + for: .touchUpInside + ) + } + + private func setupLocalization() { + let languages = selectedLocale.rLanguages + + title = R.string.localizable.commonUnlock(preferredLanguages: languages) + + rootView.walletCell.titleLabel.text = R.string.localizable.commonWallet( + preferredLanguages: languages + ) + + rootView.accountCell.titleLabel.text = R.string.localizable.commonAccount( + preferredLanguages: languages + ) + + rootView.feeCell.rowContentView.locale = selectedLocale + + rootView.transferableTitleLabel.text = R.string.localizable.walletBalanceAvailable( + preferredLanguages: languages + ) + + rootView.lockAmountTitleLabel.text = R.string.localizable.commonGovLock( + preferredLanguages: languages + ) + + rootView.actionLoadableView.actionButton.imageWithTitleView?.title = R.string.localizable + .commonConfirm(preferredLanguages: selectedLocale.rLanguages) + } + + @objc private func actionConfirm() { + presenter.confirm() + } + + @objc private func actionSender() { + presenter.presentSenderDetails() + } +} + +extension GovernanceUnlockConfirmViewController: GovernanceUnlockConfirmViewProtocol { + func didReceiveAmount(viewModel: BalanceViewModelProtocol) { + rootView.amountView.bind(viewModel: viewModel) + } + + func didReceiveWallet(viewModel: StackCellViewModel) { + rootView.walletCell.bind(viewModel: viewModel) + } + + func didReceiveAccount(viewModel: DisplayAddressViewModel) { + rootView.accountCell.bind(viewModel: viewModel.cellViewModel) + } + + func didReceiveFee(viewModel: BalanceViewModelProtocol?) { + rootView.feeCell.rowContentView.bind(viewModel: viewModel) + } + + func didReceiveTransferableAmount(viewModel: ReferendumLockTransitionViewModel) { + rootView.transferableCell.bind(viewModel: viewModel) + } + + func didReceiveLockedAmount(viewModel: ReferendumLockTransitionViewModel) { + rootView.lockedAmountCell.bind(viewModel: viewModel) + } + + func didReceiveRemainedLock(viewModel: GovernanceRemainedLockViewModel?) { + if let viewModel = viewModel { + let amountString = NSMutableAttributedString( + string: viewModel.amount, + attributes: [ + .foregroundColor: R.color.colorWhite()!, + .font: UIFont.caption1 + ] + ) + + let remainingLocksString = viewModel.modules + .map { $0.firstLetterCapitalized() } + .joined(separator: ", ") + + let remainingLocksAttributedString = NSAttributedString( + string: R.string.localizable.govRemainsLockedSuffix( + remainingLocksString, + preferredLanguages: selectedLocale.rLanguages + ), + attributes: [ + .foregroundColor: R.color.colorTransparentText()!, + .font: UIFont.caption1 + ] + ) + + amountString.append(remainingLocksAttributedString) + + rootView.hintsView.bind(attributedTexts: [amountString]) + } else { + rootView.hintsView.bind(attributedTexts: []) + } + } + + func didStartLoading() { + rootView.actionLoadableView.startLoading() + } + + func didStopLoading() { + rootView.actionLoadableView.stopLoading() + } +} + +extension GovernanceUnlockConfirmViewController: Localizable { + func applyLocalization() { + if isViewLoaded { + setupLocalization() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewFactory.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewFactory.swift new file mode 100644 index 0000000000..a083d2ae5d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewFactory.swift @@ -0,0 +1,129 @@ +import Foundation +import RobinHood +import SoraFoundation + +struct GovernanceUnlockConfirmViewFactory { + static func createView( + for state: GovernanceSharedState, + initData: GovernanceUnlockConfirmInitData + ) -> GovernanceUnlockConfirmViewProtocol? { + guard let option = state.settings.value else { + return nil + } + + let chain = option.chain + + guard + let wallet = SelectedWalletSettings.shared.value, + let selectedAccount = wallet.fetchMetaChainAccount(for: chain.accountRequest()), + let interactor = createInteractor( + for: state, + option: option, + selectedAccount: selectedAccount + ), + let assetInfo = chain.utilityAssetDisplayInfo(), + let currencyManager = CurrencyManager.shared + else { + return nil + } + + let votingLockId = state.governanceId(for: option) + + let wireframe = GovernanceUnlockConfirmWireframe() + + let balanceViewModelFactory = BalanceViewModelFactory( + targetAssetInfo: assetInfo, + priceAssetInfoFactory: PriceAssetInfoFactory(currencyManager: currencyManager) + ) + + let localizationManager = LocalizationManager.shared + + let lockChangeViewModelFactory = ReferendumLockChangeViewModelFactory( + assetDisplayInfo: assetInfo, + votingLockId: votingLockId + ) + + let dataValidatingFactory = GovernanceValidatorFactory( + presentable: wireframe, + assetBalanceFormatterFactory: AssetBalanceFormatterFactory(), + quantityFormatter: NumberFormatter.quantity.localizableResource() + ) + + let presenter = GovernanceUnlockConfirmPresenter( + interactor: interactor, + wireframe: wireframe, + chain: chain, + selectedAccount: selectedAccount, + initData: initData, + balanceViewModelFactory: balanceViewModelFactory, + lockChangeViewModelFactory: lockChangeViewModelFactory, + dataValidatingFactory: dataValidatingFactory, + localizationManager: localizationManager, + logger: Logger.shared + ) + + let view = GovernanceUnlockConfirmViewController( + presenter: presenter, + localizationManager: localizationManager + ) + + presenter.view = view + dataValidatingFactory.view = view + interactor.presenter = presenter + + return view + } + + private static func createInteractor( + for state: GovernanceSharedState, + option: GovernanceSelectedOption, + selectedAccount: MetaChainAccountResponse + ) -> GovernanceUnlockConfirmInteractor? { + let chain = option.chain + + guard + let connection = state.chainRegistry.getConnection(for: chain.chainId), + let runtimeProvider = state.chainRegistry.getRuntimeProvider(for: chain.chainId), + let subscriptionFactory = state.subscriptionFactory, + let lockStateFactory = state.locksOperationFactory, + let blockTimeService = state.blockTimeService, + let blockTimeFactory = state.createBlockTimeOperationFactory(), + let currencyManager = CurrencyManager.shared else { + return nil + } + + let extrinsicFactory = state.createExtrinsicFactory(for: option) + + let operationQueue = OperationManagerFacade.sharedDefaultQueue + + let extrinsicService = ExtrinsicServiceFactory( + runtimeRegistry: runtimeProvider, + engine: connection, + operationManager: OperationManager(operationQueue: operationQueue) + ).createService(account: selectedAccount.chainAccount, chain: chain) + + let signer = SigningWrapperFactory().createSigningWrapper( + for: selectedAccount.metaId, + accountResponse: selectedAccount.chainAccount + ) + + return .init( + chain: chain, + selectedAccount: selectedAccount, + subscriptionFactory: subscriptionFactory, + lockStateFactory: lockStateFactory, + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactory.shared, + extrinsicFactory: extrinsicFactory, + extrinsicService: extrinsicService, + signer: signer, + priceLocalSubscriptionFactory: PriceProviderFactory.shared, + generalLocalSubscriptionFactory: state.generalLocalSubscriptionFactory, + blockTimeService: blockTimeService, + blockTimeFactory: blockTimeFactory, + connection: connection, + runtimeProvider: runtimeProvider, + operationQueue: operationQueue, + currencyManager: currencyManager + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewLayout.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewLayout.swift new file mode 100644 index 0000000000..2a1da42035 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmViewLayout.swift @@ -0,0 +1,94 @@ +import UIKit + +final class GovernanceUnlockConfirmViewLayout: UIView { + let containerView: ScrollableContainerView = { + let view = ScrollableContainerView(axis: .vertical, respectsSafeArea: true) + view.stackView.layoutMargins = UIEdgeInsets(top: 0.0, left: 16.0, bottom: 0.0, right: 16.0) + view.stackView.isLayoutMarginsRelativeArrangement = true + view.stackView.alignment = .fill + return view + }() + + let amountView = MultilineBalanceView() + + let senderTableView = StackTableView() + + let walletCell = StackTableCell() + + let accountCell: StackInfoTableCell = { + let cell = StackInfoTableCell() + cell.detailsLabel.lineBreakMode = .byTruncatingMiddle + return cell + }() + + let feeCell = StackNetworkFeeCell() + + let changesTableView = StackTableView() + + var transferableTitleLabel: UILabel { + transferableCell.rowContentView.titleView.detailsLabel + } + + var transferableCell: StackTitleValueDiffCell = .create { cell in + cell.rowContentView.titleView.imageView.image = R.image.iconGovTransferable() + } + + var lockAmountTitleLabel: UILabel { + lockedAmountCell.rowContentView.titleView.detailsLabel + } + + let lockedAmountCell: StackTitleValueDiffCell = .create { cell in + cell.rowContentView.titleView.imageView.image = R.image.iconGovAmountLock() + } + + let hintsView = HintListView() + + let actionLoadableView = LoadableActionView() + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = R.color.colorBlack() + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + addSubview(actionLoadableView) + actionLoadableView.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(UIConstants.horizontalInset) + make.bottom.equalTo(safeAreaLayoutGuide).inset(UIConstants.actionBottomInset) + make.height.equalTo(UIConstants.actionHeight) + } + + addSubview(containerView) + containerView.snp.makeConstraints { make in + make.top.leading.trailing.equalToSuperview() + make.bottom.equalTo(actionLoadableView.snp.top).offset(-8.0) + } + + containerView.stackView.addArrangedSubview(amountView) + containerView.stackView.setCustomSpacing(20.0, after: amountView) + + containerView.stackView.addArrangedSubview(senderTableView) + containerView.stackView.setCustomSpacing(12.0, after: senderTableView) + + senderTableView.addArrangedSubview(walletCell) + senderTableView.addArrangedSubview(accountCell) + senderTableView.addArrangedSubview(feeCell) + + containerView.stackView.addArrangedSubview(changesTableView) + + changesTableView.addArrangedSubview(transferableCell) + changesTableView.addArrangedSubview(lockedAmountCell) + + containerView.stackView.setCustomSpacing(16.0, after: changesTableView) + + containerView.stackView.addArrangedSubview(hintsView) + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmWireframe.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmWireframe.swift new file mode 100644 index 0000000000..54af173de7 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/GovernanceUnlockConfirmWireframe.swift @@ -0,0 +1,3 @@ +import Foundation + +final class GovernanceUnlockConfirmWireframe: GovernanceUnlockConfirmWireframeProtocol, ModalAlertPresenting {} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/Model/GovernanceUnlockConfirmInitData.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/Model/GovernanceUnlockConfirmInitData.swift new file mode 100644 index 0000000000..eecf86580e --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/Model/GovernanceUnlockConfirmInitData.swift @@ -0,0 +1,7 @@ +import Foundation + +struct GovernanceUnlockConfirmInitData { + let votingResult: CallbackStorageSubscriptionResult + let unlockSchedule: GovernanceUnlockSchedule + let blockNumber: BlockNumber +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/Model/GovernanceUnlockConfirmInteractorError.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/Model/GovernanceUnlockConfirmInteractorError.swift new file mode 100644 index 0000000000..bb551d7848 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/Model/GovernanceUnlockConfirmInteractorError.swift @@ -0,0 +1,8 @@ +import Foundation + +enum GovernanceUnlockConfirmInteractorError { + case locksSubscriptionFailed(_ internalError: Error) + case balanceSubscriptionFailed(_ internalError: Error) + case feeFetchFailed(_ internalError: Error) + case unlockFailed(_ internalError: Error) +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/ViewModel/GovernanceRemainedLockViewModel.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/ViewModel/GovernanceRemainedLockViewModel.swift new file mode 100644 index 0000000000..cadbd8b0c5 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockConfirm/ViewModel/GovernanceRemainedLockViewModel.swift @@ -0,0 +1,6 @@ +import Foundation + +struct GovernanceRemainedLockViewModel { + let amount: String + let modules: [String] +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupInteractor.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupInteractor.swift new file mode 100644 index 0000000000..20e6e61501 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupInteractor.swift @@ -0,0 +1,16 @@ +import UIKit +import SubstrateSdk + +final class GovernanceUnlockSetupInteractor: GovernanceUnlockInteractor { + var presenter: GovernanceUnlockSetupInteractorOutputProtocol? { + get { + basePresenter as? GovernanceUnlockSetupInteractorOutputProtocol + } + + set { + basePresenter = newValue + } + } +} + +extension GovernanceUnlockSetupInteractor: GovernanceUnlockSetupInteractorInputProtocol {} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupPresenter.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupPresenter.swift new file mode 100644 index 0000000000..d1ace4bf22 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupPresenter.swift @@ -0,0 +1,350 @@ +import Foundation +import SoraFoundation +import BigInt + +final class GovernanceUnlockSetupPresenter { + weak var view: GovernanceUnlockSetupViewProtocol? + let wireframe: GovernanceUnlockSetupWireframeProtocol + let interactor: GovernanceUnlockSetupInteractorInputProtocol + let balanceViewModelFactory: BalanceViewModelFactoryProtocol + let assetDisplayInfo: AssetBalanceDisplayInfo + let logger: LoggerProtocol + + private var votingResult: CallbackStorageSubscriptionResult? + private var unlockSchedule: GovernanceUnlockSchedule? + private var blockNumber: BlockNumber? + private var blockTime: BlockTime? + private var price: PriceData? + + private var maxStatusTimeInterval: TimeInterval? + private var countdownTimer: CountdownTimer? + + init( + initData: GovernanceUnlockInitData, + interactor: GovernanceUnlockSetupInteractorInputProtocol, + wireframe: GovernanceUnlockSetupWireframeProtocol, + balanceViewModelFactory: BalanceViewModelFactoryProtocol, + assetDisplayInfo: AssetBalanceDisplayInfo, + logger: LoggerProtocol, + localizationManager: LocalizationManagerProtocol + ) { + votingResult = initData.votingResult + unlockSchedule = initData.unlockSchedule + blockTime = initData.blockTime + blockNumber = initData.blockNumber + self.interactor = interactor + self.wireframe = wireframe + self.balanceViewModelFactory = balanceViewModelFactory + self.assetDisplayInfo = assetDisplayInfo + self.logger = logger + self.localizationManager = localizationManager + } + + deinit { + invalidateTimer() + } + + private func createTotalBalanceViewModel(for amount: BigUInt) -> BalanceViewModelProtocol { + let decimalAmount = Decimal.fromSubstrateAmount(amount, precision: assetDisplayInfo.assetPrecision) ?? 0 + return balanceViewModelFactory.balanceFromPrice(decimalAmount, priceData: price).value(for: selectedLocale) + } + + private func calculateMaxUnlockTimeInterval( + block: BlockNumber, + blockTime: BlockTime + ) -> TimeInterval? { + let intervals: [TimeInterval] = (unlockSchedule?.items ?? []).compactMap { item in + if block < item.unlockAt { + return block.secondsTo(block: item.unlockAt, blockDuration: blockTime) + } else { + return nil + } + } + + return intervals.max() + } + + private func createUnlockClaimState( + for unlockAt: BlockNumber, + block: BlockNumber, + blockTime: BlockTime, + elapsedTimeInterval: TimeInterval? + ) -> GovernanceUnlocksViewModel.ClaimState { + if block < unlockAt { + let remainedTimeInSeconds = block.secondsTo(block: unlockAt, blockDuration: blockTime) + + let tickedTime: TimeInterval + + if let elapsedTimeInterval = elapsedTimeInterval { + tickedTime = remainedTimeInSeconds > elapsedTimeInterval ? + remainedTimeInSeconds - elapsedTimeInterval : 0 + } else { + tickedTime = remainedTimeInSeconds + } + + if let leftTime = tickedTime.localizedDaysOrTime(for: selectedLocale) { + let time = R.string.localizable.commonTimeLeftFormat( + leftTime, + preferredLanguages: selectedLocale.rLanguages + ) + + return .afterPeriod(time: time) + } else { + return .afterPeriod(time: "") + } + + } else { + return .now + } + } + + private func createClaimableViewModel(for amount: BigUInt) -> GovernanceUnlocksViewModel.Item { + let amountDecimal = Decimal.fromSubstrateAmount( + amount, + precision: assetDisplayInfo.assetPrecision + ) ?? 0 + + let amountString = balanceViewModelFactory.amountFromValue(amountDecimal).value(for: selectedLocale) + + return .init(amount: amountString, claimState: .now) + } + + private func createUnlockViewModel( + for amount: BigUInt, + unlockAt: BlockNumber, + block: BlockNumber, + blockTime: BlockTime + ) -> GovernanceUnlocksViewModel.Item { + let amountDecimal = Decimal.fromSubstrateAmount( + amount, + precision: assetDisplayInfo.assetPrecision + ) ?? 0 + + let amountString = balanceViewModelFactory.amountFromValue(amountDecimal).value(for: selectedLocale) + + let claimState = createUnlockClaimState( + for: unlockAt, + block: block, + blockTime: blockTime, + elapsedTimeInterval: nil + ) + + return .init(amount: amountString, claimState: claimState) + } + + private func updateView() { + guard + let blockNumber = blockNumber, + let blockTime = blockTime, + let tracksVoting = votingResult?.value else { + return + } + + let totalViewModel = createTotalBalanceViewModel(for: tracksVoting.totalLocked()) + + let items: [GovernanceUnlocksViewModel.Item] + + if let unlockSchedule = unlockSchedule { + let availableUnlock = unlockSchedule.availableUnlock(at: blockNumber) + + let remainingUnlocks = unlockSchedule.remainingLocks(after: blockNumber) + + let remainingUnlockViewModels = remainingUnlocks.map { + createUnlockViewModel( + for: $0.amount, + unlockAt: $0.unlockAt, + block: blockNumber, + blockTime: blockTime + ) + } + + if !availableUnlock.isEmpty { + let availableUnlockViewModel = createClaimableViewModel(for: availableUnlock.amount) + items = [availableUnlockViewModel] + remainingUnlockViewModels + } else { + items = remainingUnlockViewModels + } + } else { + items = [] + } + + view?.didReceive(viewModel: .init(total: totalViewModel, items: items)) + } + + private func refreshUnlockSchedule() { + guard let tracksVoting = votingResult?.value else { + return + } + + interactor.refreshUnlockSchedule(for: tracksVoting, blockHash: nil) + } + + private func invalidateTimer() { + countdownTimer?.delegate = self + countdownTimer?.stop() + countdownTimer = nil + } + + private func setupTimerIfNeeded() { + invalidateTimer() + + guard + let blockNumber = blockNumber, + let blockTime = blockTime else { + return + } + + guard let maxTimeInterval = calculateMaxUnlockTimeInterval(block: blockNumber, blockTime: blockTime) else { + return + } + + maxStatusTimeInterval = maxTimeInterval + + countdownTimer = CountdownTimer() + countdownTimer?.delegate = self + countdownTimer?.start(with: maxTimeInterval) + } + + private func updateViewOnTimerTick() { + guard + let maxStatusTimeInterval = maxStatusTimeInterval, + let remainedInterval = countdownTimer?.remainedInterval, + let blockNumber = blockNumber, + let blockTime = blockTime else { + return + } + + let elapsedTimeInterval = maxStatusTimeInterval - remainedInterval + + let items: [GovernanceUnlocksViewModel.ClaimState] + + if let unlockSchedule = unlockSchedule { + let availableUnlock = unlockSchedule.availableUnlock(at: blockNumber) + + let remainingUnlocks = unlockSchedule.remainingLocks(after: blockNumber).map { + createUnlockClaimState( + for: $0.unlockAt, + block: blockNumber, + blockTime: blockTime, + elapsedTimeInterval: elapsedTimeInterval + ) + } + + if !availableUnlock.isEmpty { + items = [.now] + remainingUnlocks + } else { + items = remainingUnlocks + } + } else { + items = [] + } + + view?.didTickClaim(states: items) + } +} + +extension GovernanceUnlockSetupPresenter: GovernanceUnlockSetupPresenterProtocol { + func setup() { + interactor.setup() + } + + func unlock() { + guard + let votingResult = votingResult, + let unlockSchedule = unlockSchedule, + let blockNumber = blockNumber else { + return + } + + let initData = GovernanceUnlockConfirmInitData( + votingResult: votingResult, + unlockSchedule: unlockSchedule, + blockNumber: blockNumber + ) + + wireframe.showConfirm(from: view, initData: initData) + } +} + +extension GovernanceUnlockSetupPresenter: GovernanceUnlockSetupInteractorOutputProtocol { + func didReceiveVoting(_ result: CallbackStorageSubscriptionResult) { + votingResult = result + + updateView() + + if let tracksVoting = result.value { + interactor.refreshUnlockSchedule(for: tracksVoting, blockHash: result.blockHash) + } + } + + func didReceiveUnlockSchedule(_ schedule: GovernanceUnlockSchedule) { + unlockSchedule = schedule + + updateView() + } + + func didReceiveBlockNumber(_ block: BlockNumber) { + blockNumber = block + + updateView() + + interactor.refreshBlockTime() + + refreshUnlockSchedule() + } + + func didReceiveBlockTime(_ time: BlockTime) { + blockTime = time + + updateView() + + setupTimerIfNeeded() + } + + func didReceivePrice(_ price: PriceData?) { + self.price = price + + updateView() + } + + func didReceiveBaseError(_ error: GovernanceUnlockInteractorError) { + logger.error("Did receive error: \(error)") + + switch error { + case .votingSubscriptionFailed, .priceSubscriptionFailed, .blockNumberSubscriptionFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case .unlockScheduleFetchFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshUnlockSchedule() + } + case .blockTimeFetchFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.refreshBlockTime() + } + } + } +} + +extension GovernanceUnlockSetupPresenter: CountdownTimerDelegate { + func didStart(with _: TimeInterval) { + updateViewOnTimerTick() + } + + func didCountdown(remainedInterval _: TimeInterval) { + updateViewOnTimerTick() + } + + func didStop(with _: TimeInterval) { + updateViewOnTimerTick() + } +} + +extension GovernanceUnlockSetupPresenter: Localizable { + func applyLocalization() { + if let view = view, view.isSetup { + updateView() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupProtocols.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupProtocols.swift new file mode 100644 index 0000000000..95ba77ac08 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupProtocols.swift @@ -0,0 +1,17 @@ +protocol GovernanceUnlockSetupViewProtocol: ControllerBackedProtocol { + func didReceive(viewModel: GovernanceUnlocksViewModel) + func didTickClaim(states: [GovernanceUnlocksViewModel.ClaimState]) +} + +protocol GovernanceUnlockSetupPresenterProtocol: AnyObject { + func setup() + func unlock() +} + +protocol GovernanceUnlockSetupInteractorInputProtocol: GovernanceUnlockInteractorInputProtocol {} + +protocol GovernanceUnlockSetupInteractorOutputProtocol: GovernanceUnlockInteractorOutputProtocol {} + +protocol GovernanceUnlockSetupWireframeProtocol: AlertPresentable, ErrorPresentable, CommonRetryable { + func showConfirm(from view: GovernanceUnlockSetupViewProtocol?, initData: GovernanceUnlockConfirmInitData) +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewController.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewController.swift new file mode 100644 index 0000000000..687a99936a --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewController.swift @@ -0,0 +1,185 @@ +import UIKit +import SoraFoundation + +final class GovernanceUnlockSetupViewController: UIViewController, ViewHolder { + typealias RootViewType = GovernanceUnlockSetupViewLayout + + let presenter: GovernanceUnlockSetupPresenterProtocol + + private var viewModel: GovernanceUnlocksViewModel? + + init(presenter: GovernanceUnlockSetupPresenterProtocol, localizationManager: LocalizationManagerProtocol) { + self.presenter = presenter + super.init(nibName: nil, bundle: nil) + + self.localizationManager = localizationManager + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = GovernanceUnlockSetupViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupLocalization() + setupTableView() + setupHandlers() + updateUnlockState() + + presenter.setup() + } + + private func setupTableView() { + rootView.tableView.registerClassForCell(GovernanceUnlockTableViewCell.self) + rootView.tableView.registerClassForCell(CrowdloanYourContributionsTotalCell.self) + + rootView.tableView.dataSource = self + } + + private func setupHandlers() { + rootView.unlockButton.addTarget( + self, + action: #selector(actionUnlock), + for: .touchUpInside + ) + } + + private func setupLocalization() { + title = R.string.localizable.walletBalanceLocked(preferredLanguages: selectedLocale.rLanguages) + + rootView.unlockButton.imageWithTitleView?.title = R.string.localizable.commonUnlock( + preferredLanguages: selectedLocale.rLanguages + ) + rootView.unlockButton.invalidateLayout() + } + + private func updateUnlockState() { + let hasUnlockable = viewModel?.items.contains { + switch $0.claimState { + case .now: + return true + case .afterPeriod: + return false + } + } ?? false + + if hasUnlockable { + rootView.unlockButton.applyEnabledStyle() + } else { + rootView.unlockButton.applyDisabledStyle() + } + + rootView.unlockButton.isUserInteractionEnabled = hasUnlockable + } + + @objc private func actionUnlock() { + presenter.unlock() + } +} + +extension GovernanceUnlockSetupViewController: UITableViewDataSource { + func numberOfSections(in _: UITableView) -> Int { + viewModel != nil ? 2 : 0 + } + + func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int { + guard let viewModel = viewModel else { + return 0 + } + + if section == 0 { + return 1 + } else { + return viewModel.items.count + } + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + if indexPath.section == 0 { + let cell = tableView.dequeueReusableCellWithType( + CrowdloanYourContributionsTotalCell.self, + forIndexPath: indexPath + ) + + cell.view.apply(style: .readonly) + cell.view.bind( + model: .init( + title: R.string.localizable.crowdloanYouContributionsTotal( + preferredLanguages: selectedLocale.rLanguages + ), + count: nil, + amount: viewModel?.total.amount ?? "", + amountDetails: viewModel?.total.price ?? "" + ) + ) + + return cell + } else { + let cell = tableView.dequeueReusableCellWithType( + GovernanceUnlockTableViewCell.self, + forIndexPath: indexPath + ) + + if let viewModel = viewModel { + cell.bind(viewModel: viewModel.items[indexPath.row], locale: selectedLocale) + } + + return cell + } + } + + private func applyClaimStates() { + guard let items = viewModel?.items else { + return + } + + let visibleIndexPaths = rootView.tableView.indexPathsForVisibleRows?.filter { $0.section > 0 } ?? [] + + visibleIndexPaths.forEach { indexPath in + guard let cell = rootView.tableView.cellForRow(at: indexPath) as? GovernanceUnlockTableViewCell else { + return + } + + cell.bind(claimState: items[indexPath.row].claimState, locale: selectedLocale) + } + } +} + +extension GovernanceUnlockSetupViewController: GovernanceUnlockSetupViewProtocol { + func didReceive(viewModel: GovernanceUnlocksViewModel) { + self.viewModel = viewModel + + rootView.tableView.reloadData() + + updateUnlockState() + } + + func didTickClaim(states: [GovernanceUnlocksViewModel.ClaimState]) { + guard let viewModel = viewModel else { + return + } + + let newItems = zip(states, viewModel.items).map { + GovernanceUnlocksViewModel.Item(amount: $0.1.amount, claimState: $0.0) + } + + self.viewModel = .init(total: viewModel.total, items: newItems) + + applyClaimStates() + updateUnlockState() + } +} + +extension GovernanceUnlockSetupViewController: Localizable { + func applyLocalization() { + if isViewLoaded { + setupLocalization() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewFactory.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewFactory.swift new file mode 100644 index 0000000000..c9eb779c03 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewFactory.swift @@ -0,0 +1,77 @@ +import Foundation +import SoraFoundation + +struct GovernanceUnlockSetupViewFactory { + static func createView( + for state: GovernanceSharedState, + initData: GovernanceUnlockInitData + ) -> GovernanceUnlockSetupViewProtocol? { + guard + let interactor = createInteractor(for: state), + let assetInfo = state.settings.value?.chain.utilityAssetDisplayInfo(), + let currencyManager = CurrencyManager.shared else { + return nil + } + + let wireframe = GovernanceUnlockSetupWireframe(state: state) + + let balanceViewModelFactory = BalanceViewModelFactory( + targetAssetInfo: assetInfo, + priceAssetInfoFactory: PriceAssetInfoFactory(currencyManager: currencyManager) + ) + + let localizationManager = LocalizationManager.shared + + let presenter = GovernanceUnlockSetupPresenter( + initData: initData, + interactor: interactor, + wireframe: wireframe, + balanceViewModelFactory: balanceViewModelFactory, + assetDisplayInfo: assetInfo, + logger: Logger.shared, + localizationManager: LocalizationManager.shared + ) + + let view = GovernanceUnlockSetupViewController(presenter: presenter, localizationManager: localizationManager) + + presenter.view = view + interactor.presenter = presenter + + return view + } + + private static func createInteractor(for state: GovernanceSharedState) -> GovernanceUnlockSetupInteractor? { + guard + let wallet = SelectedWalletSettings.shared.value, + let chain = state.settings.value?.chain, + let selectedAccount = wallet.fetchMetaChainAccount(for: chain.accountRequest()), + let currencyManager = CurrencyManager.shared else { + return nil + } + + guard + let connection = state.chainRegistry.getConnection(for: chain.chainId), + let runtimeProvider = state.chainRegistry.getRuntimeProvider(for: chain.chainId), + let subscriptionFactory = state.subscriptionFactory, + let lockStateFactory = state.locksOperationFactory, + let blockTimeService = state.blockTimeService, + let blockTimeFactory = state.createBlockTimeOperationFactory() else { + return nil + } + + return .init( + chain: chain, + selectedAccount: selectedAccount, + subscriptionFactory: subscriptionFactory, + lockStateFactory: lockStateFactory, + priceLocalSubscriptionFactory: PriceProviderFactory.shared, + generalLocalSubscriptionFactory: state.generalLocalSubscriptionFactory, + blockTimeService: blockTimeService, + blockTimeFactory: blockTimeFactory, + connection: connection, + runtimeProvider: runtimeProvider, + operationQueue: OperationManagerFacade.sharedDefaultQueue, + currencyManager: currencyManager + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewLayout.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewLayout.swift new file mode 100644 index 0000000000..ebf8d4089c --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupViewLayout.swift @@ -0,0 +1,57 @@ +import UIKit + +final class GovernanceUnlockSetupViewLayout: UIView { + let tableView: UITableView = { + let tableView = UITableView() + tableView.backgroundColor = .clear + tableView.separatorStyle = .none + tableView.allowsSelection = false + return tableView + }() + + let unlockButton: TriangularedButton = { + let button = TriangularedButton() + button.applyDefaultStyle() + return button + }() + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = R.color.colorBlack() + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func layoutSubviews() { + super.layoutSubviews() + + let bottomInset = abs(distanceBetween(bottomOf: self, andTopOf: unlockButton)) + 16.0 + tableView.contentInset = .init(top: 0, left: 0, bottom: bottomInset, right: 0) + } + + private func distanceBetween(bottomOf view1: UIView, andTopOf view2: UIView) -> CGFloat { + let frame2 = view1.convert(view2.bounds, from: view2) + return frame2.minY - view1.bounds.maxY + } + + private func setupLayout() { + addSubview(tableView) + tableView.snp.makeConstraints { make in + make.top.equalTo(safeAreaLayoutGuide) + make.leading.bottom.trailing.equalToSuperview() + } + + addSubview(unlockButton) + unlockButton.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(UIConstants.horizontalInset) + make.bottom.equalTo(safeAreaLayoutGuide).inset(UIConstants.actionBottomInset) + make.height.equalTo(UIConstants.actionHeight) + } + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupWireframe.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupWireframe.swift new file mode 100644 index 0000000000..28c4831632 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/GovernanceUnlockSetupWireframe.swift @@ -0,0 +1,23 @@ +import Foundation + +final class GovernanceUnlockSetupWireframe: GovernanceUnlockSetupWireframeProtocol { + let state: GovernanceSharedState + + init(state: GovernanceSharedState) { + self.state = state + } + + func showConfirm( + from view: GovernanceUnlockSetupViewProtocol?, + initData: GovernanceUnlockConfirmInitData + ) { + guard let confirmView = GovernanceUnlockConfirmViewFactory.createView( + for: state, + initData: initData + ) else { + return + } + + view?.controller.navigationController?.pushViewController(confirmView.controller, animated: true) + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/Model/GovernanceUnlockInitData.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/Model/GovernanceUnlockInitData.swift new file mode 100644 index 0000000000..098f63eca5 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/Model/GovernanceUnlockInitData.swift @@ -0,0 +1,8 @@ +import Foundation + +struct GovernanceUnlockInitData { + let votingResult: CallbackStorageSubscriptionResult? + let unlockSchedule: GovernanceUnlockSchedule? + let blockNumber: BlockNumber? + let blockTime: BlockTime? +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/View/GovernanceUnlockTableViewCell.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/View/GovernanceUnlockTableViewCell.swift new file mode 100644 index 0000000000..138c8c5897 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/View/GovernanceUnlockTableViewCell.swift @@ -0,0 +1,62 @@ +import UIKit + +final class GovernanceUnlockTableViewCell: UITableViewCell { + private let lockView = GenericTitleValueView() + + var amountLabel: UILabel { lockView.titleView } + var detailsLabel: UILabel { lockView.valueView.detailsLabel } + var iconImageView: UIImageView { lockView.valueView.imageView } + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + + setupLayout() + applyStyle() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func bind(viewModel: GovernanceUnlocksViewModel.Item, locale: Locale) { + amountLabel.text = viewModel.amount + + bind(claimState: viewModel.claimState, locale: locale) + } + + func bind(claimState: GovernanceUnlocksViewModel.ClaimState, locale: Locale) { + switch claimState { + case let .afterPeriod(time): + lockView.valueView.hidesIcon = false + detailsLabel.textColor = R.color.colorTransparentText() + detailsLabel.text = time + case .now: + lockView.valueView.hidesIcon = true + detailsLabel.textColor = R.color.colorGreen() + detailsLabel.text = R.string.localizable.commonUnlockable(preferredLanguages: locale.rLanguages) + } + } + + private func applyStyle() { + backgroundColor = .clear + + amountLabel.apply(style: .regularSubhedlineWhite) + + detailsLabel.font = .caption1 + detailsLabel.numberOfLines = 1 + lockView.valueView.spacing = 4 + iconImageView.image = R.image.iconPending() + + lockView.valueView.mode = .detailsIcon + } + + private func setupLayout() { + addSubview(lockView) + lockView.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(UIConstants.horizontalInset) + make.top.bottom.equalToSuperview() + make.height.equalTo(40) + } + } +} diff --git a/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/ViewModel/GovernanceUnlocksViewModel.swift b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/ViewModel/GovernanceUnlocksViewModel.swift new file mode 100644 index 0000000000..18ceb0f4f6 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/GovernanceUnlockSetup/ViewModel/GovernanceUnlocksViewModel.swift @@ -0,0 +1,16 @@ +import Foundation + +struct GovernanceUnlocksViewModel { + enum ClaimState { + case now + case afterPeriod(time: String) + } + + struct Item { + let amount: String + let claimState: ClaimState + } + + let total: BalanceViewModelProtocol + let items: [Item] +} diff --git a/novawallet/Modules/Vote/Governance/Model/DemocracyDecidingFunctionProtocol.swift b/novawallet/Modules/Vote/Governance/Model/DemocracyDecidingFunctionProtocol.swift new file mode 100644 index 0000000000..f6ff9b1523 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/DemocracyDecidingFunctionProtocol.swift @@ -0,0 +1,68 @@ +import Foundation +import BigInt + +protocol DemocracyDecidingFunctionProtocol { + var thresholdType: Democracy.VoteThreshold { get } + func calculateThreshold( + for ayes: BigUInt, + nays: BigUInt, + turnout: BigUInt, + electorate: BigUInt + ) -> Decimal? +} + +final class Gov1DecidingFunction { + let thresholdType: Democracy.VoteThreshold + + init(thresholdType: Democracy.VoteThreshold) { + self.thresholdType = thresholdType + } + + private func calculateSupermajorityApprove(turnout: BigUInt, electorate: BigUInt) -> Decimal? { + guard + let turnoutSqrt = Decimal(turnout.squareRoot()), + let electorateSqrt = Decimal(electorate.squareRoot()) else { + return nil + } + + guard electorateSqrt + turnoutSqrt > 0 else { + return nil + } + + return electorateSqrt / (electorateSqrt + turnoutSqrt) + } + + private func calculateSupermajorityAgainst(turnout: BigUInt, electorate: BigUInt) -> Decimal? { + guard + let turnoutSqrt = Decimal(turnout.squareRoot()), + let electorateSqrt = Decimal(electorate.squareRoot()) else { + return nil + } + + guard electorateSqrt + turnoutSqrt > 0 else { + return nil + } + + return turnoutSqrt / (electorateSqrt + turnoutSqrt) + } +} + +extension Gov1DecidingFunction: DemocracyDecidingFunctionProtocol { + func calculateThreshold( + for _: BigUInt, + nays _: BigUInt, + turnout: BigUInt, + electorate: BigUInt + ) -> Decimal? { + switch thresholdType { + case .superMajorityApprove: + return calculateSupermajorityApprove(turnout: turnout, electorate: electorate) + case .superMajorityAgainst: + return calculateSupermajorityAgainst(turnout: turnout, electorate: electorate) + case .simpleMajority: + return 0.5 + case .unknown: + return nil + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/GovernanceDAppList.swift b/novawallet/Modules/Vote/Governance/Model/GovernanceDAppList.swift new file mode 100644 index 0000000000..dc632a41e5 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/GovernanceDAppList.swift @@ -0,0 +1,22 @@ +import Foundation +import SoraFoundation + +enum GovernanceDApps { + struct DApp: Codable, Equatable { + let title: String + let details: String + let url: String + let icon: URL + + func extractFullUrl(for referendumIndex: ReferendumIdLocal) throws -> URL { + try EndpointBuilder(urlTemplate: url).buildParameterURL(String(referendumIndex)) + } + } + + struct Item: Codable, Equatable { + let chainId: String + let dapps: [DApp] + } +} + +typealias GovernanceDAppList = [GovernanceDApps.Item] diff --git a/novawallet/Modules/Vote/Governance/Model/GovernanceLockState.swift b/novawallet/Modules/Vote/Governance/Model/GovernanceLockState.swift new file mode 100644 index 0000000000..4b0cd10463 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/GovernanceLockState.swift @@ -0,0 +1,13 @@ +import Foundation +import BigInt + +struct GovernanceLockState { + let maxLockedAmount: BigUInt + let lockedUntil: BlockNumber? +} + +struct GovernanceLockStateDiff { + let before: GovernanceLockState + let vote: ReferendumNewVote? + let after: GovernanceLockState? +} diff --git a/novawallet/Modules/Vote/Governance/Model/GovernanceOffchainApi.swift b/novawallet/Modules/Vote/Governance/Model/GovernanceOffchainApi.swift new file mode 100644 index 0000000000..7f25d54fcc --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/GovernanceOffchainApi.swift @@ -0,0 +1,5 @@ +import Foundation + +enum GovernanceOffchainApi: String { + case polkassembly +} diff --git a/novawallet/Modules/Vote/Governance/Model/GovernanceServiceFactory.swift b/novawallet/Modules/Vote/Governance/Model/GovernanceServiceFactory.swift new file mode 100644 index 0000000000..65651dc718 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/GovernanceServiceFactory.swift @@ -0,0 +1,57 @@ +import Foundation +import RobinHood + +protocol GovernanceServiceFactoryProtocol { + func createBlockTimeService(for chainId: ChainModel.Id) throws -> BlockTimeEstimationServiceProtocol +} + +final class GovernanceServiceFactory: GovernanceServiceFactoryProtocol { + let chainRegisty: ChainRegistryProtocol + let storageFacade: StorageFacadeProtocol + let eventCenter: EventCenterProtocol + let operationQueue: OperationQueue + let logger: LoggerProtocol + + private lazy var substrateDataProviderFactory = SubstrateDataProviderFactory( + facade: storageFacade, + operationManager: OperationManager(operationQueue: operationQueue) + ) + + init( + chainRegisty: ChainRegistryProtocol, + storageFacade: StorageFacadeProtocol, + eventCenter: EventCenterProtocol, + operationQueue: OperationQueue, + logger: LoggerProtocol + ) { + self.chainRegisty = chainRegisty + self.storageFacade = storageFacade + self.eventCenter = eventCenter + self.operationQueue = operationQueue + self.logger = logger + } + + func createBlockTimeService(for chainId: ChainModel.Id) throws -> BlockTimeEstimationServiceProtocol { + guard let runtimeService = chainRegisty.getRuntimeProvider(for: chainId) else { + throw ChainRegistryError.runtimeMetadaUnavailable + } + + guard let connection = chainRegisty.getConnection(for: chainId) else { + throw ChainRegistryError.connectionUnavailable + } + + let repositoryFactory = SubstrateRepositoryFactory(storageFacade: storageFacade) + + let repository = repositoryFactory.createChainStorageItemRepository() + + return BlockTimeEstimationService( + chainId: chainId, + connection: connection, + runtimeService: runtimeService, + repository: repository, + eventCenter: eventCenter, + operationQueue: operationQueue, + logger: logger + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/GovernanceSharedState.swift b/novawallet/Modules/Vote/Governance/Model/GovernanceSharedState.swift new file mode 100644 index 0000000000..fb2d3dcd43 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/GovernanceSharedState.swift @@ -0,0 +1,165 @@ +import Foundation +import SoraKeystore +import RobinHood +import SubstrateSdk + +final class GovernanceSharedState { + let settings: GovernanceChainSettings + let generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol + let govMetadataLocalSubscriptionFactory: GovMetadataLocalSubscriptionFactoryProtocol + let requestFactory: StorageRequestFactoryProtocol + let chainRegistry: ChainRegistryProtocol + let operationQueue: OperationQueue + + private(set) var subscriptionFactory: GovernanceSubscriptionFactoryProtocol? + private(set) var referendumsOperationFactory: ReferendumsOperationFactoryProtocol? + private(set) var locksOperationFactory: GovernanceLockStateFactoryProtocol? + private(set) var blockTimeService: BlockTimeEstimationServiceProtocol? + + init( + chainRegistry: ChainRegistryProtocol = ChainRegistryFacade.sharedRegistry, + substrateStorageFacade: StorageFacadeProtocol = SubstrateDataStorageFacade.shared, + generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol? = nil, + blockTimeService: BlockTimeEstimationServiceProtocol? = nil, + internalSettings: SettingsManagerProtocol = SettingsManager.shared, + requestFactory: StorageRequestFactoryProtocol = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: OperationManager(operationQueue: OperationManagerFacade.sharedDefaultQueue) + ), + operationQueue: OperationQueue = OperationManagerFacade.sharedDefaultQueue, + logger: LoggerProtocol = Logger.shared + ) { + self.chainRegistry = chainRegistry + settings = GovernanceChainSettings(chainRegistry: chainRegistry, settings: internalSettings) + + govMetadataLocalSubscriptionFactory = GovMetadataLocalSubscriptionFactory( + storageFacade: substrateStorageFacade, + operationQueue: operationQueue, + logger: logger + ) + + self.blockTimeService = blockTimeService + + if let generalLocalSubscriptionFactory = generalLocalSubscriptionFactory { + self.generalLocalSubscriptionFactory = generalLocalSubscriptionFactory + } else { + self.generalLocalSubscriptionFactory = GeneralStorageSubscriptionFactory( + chainRegistry: chainRegistry, + storageFacade: substrateStorageFacade, + operationManager: OperationManager(operationQueue: OperationManagerFacade.sharedDefaultQueue), + logger: Logger.shared + ) + } + + self.requestFactory = requestFactory + self.operationQueue = operationQueue + } + + func replaceBlockTimeService(_ newService: BlockTimeEstimationServiceProtocol?) { + blockTimeService = newService + } + + func replaceGovernanceFactory(for option: GovernanceSelectedOption?) { + subscriptionFactory = nil + referendumsOperationFactory = nil + locksOperationFactory = nil + + guard let option = option else { + return + } + + let chainId = option.chain.chainId + + switch option.type { + case .governanceV2: + let operationFactory = Gov2OperationFactory( + requestFactory: requestFactory, + operationQueue: operationQueue + ) + + referendumsOperationFactory = operationFactory + + subscriptionFactory = Gov2SubscriptionFactory( + chainId: chainId, + operationFactory: operationFactory, + chainRegistry: chainRegistry, + operationQueue: operationQueue + ) + + locksOperationFactory = Gov2LockStateFactory( + requestFactory: requestFactory, + unlocksCalculator: GovUnlocksCalculator() + ) + case .governanceV1: + let operationFactory = Gov1OperationFactory( + requestFactory: requestFactory, + operationQueue: operationQueue + ) + + referendumsOperationFactory = operationFactory + + subscriptionFactory = Gov1SubscriptionFactory( + chainId: chainId, + operationFactory: operationFactory, + chainRegistry: chainRegistry, + operationQueue: operationQueue + ) + + locksOperationFactory = Gov1LockStateFactory( + requestFactory: requestFactory, + unlocksCalculator: GovUnlocksCalculator() + ) + } + } + + func createExtrinsicFactory( + for option: GovernanceSelectedOption + ) -> GovernanceExtrinsicFactoryProtocol { + switch option.type { + case .governanceV2: + return Gov2ExtrinsicFactory() + case .governanceV1: + return Gov1ExtrinsicFactory() + } + } + + func createActionsDetailsFactory( + for option: GovernanceSelectedOption + ) -> ReferendumActionOperationFactoryProtocol { + switch option.type { + case .governanceV2: + return Gov2ActionOperationFactory( + requestFactory: requestFactory, + operationQueue: operationQueue + ) + case .governanceV1: + let gov2ActionsFactory = Gov2ActionOperationFactory( + requestFactory: requestFactory, + operationQueue: operationQueue + ) + + return Gov1ActionOperationFactory( + gov2OperationFactory: gov2ActionsFactory, + requestFactory: requestFactory, + operationQueue: operationQueue + ) + } + } + + func governanceId(for option: GovernanceSelectedOption) -> String { + switch option.type { + case .governanceV2: + return ConvictionVoting.lockId + case .governanceV1: + return Democracy.lockId + } + } + + func createBlockTimeOperationFactory() -> BlockTimeOperationFactoryProtocol? { + guard let chain = settings.value?.chain else { + return nil + } + + return BlockTimeOperationFactory(chain: chain) + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/GovernanceType.swift b/novawallet/Modules/Vote/Governance/Model/GovernanceType.swift new file mode 100644 index 0000000000..dcaa79f0ba --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/GovernanceType.swift @@ -0,0 +1,34 @@ +import Foundation + +enum GovernanceType: String, Equatable { + case governanceV1 = "governance-v1" + case governanceV2 = "governance" + + func title(for chain: ChainModel) -> String { + guard let asset = chain.utilityAsset() else { + return "" + } + + let assetTitle = asset.name ?? chain.name + + guard chain.hasGovernanceV1, chain.hasGovernanceV2 else { + return assetTitle + } + + switch self { + case .governanceV1: + return assetTitle + " " + "Governance v1" + case .governanceV2: + return assetTitle + " " + "OpenGov" + } + } + + func compatible(with chain: ChainModel) -> Bool { + switch self { + case .governanceV1: + return chain.hasGovernanceV1 + case .governanceV2: + return chain.hasGovernanceV2 + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/GovernanceUnlockSchedule.swift b/novawallet/Modules/Vote/Governance/Model/GovernanceUnlockSchedule.swift new file mode 100644 index 0000000000..b2afda7a72 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/GovernanceUnlockSchedule.swift @@ -0,0 +1,60 @@ +import Foundation +import BigInt + +struct GovernanceUnlockSchedule: Equatable { + enum Action: Equatable, Hashable { + case unvote(track: TrackIdLocal, index: ReferendumIdLocal) + case unlock(track: TrackIdLocal) + } + + struct Item: Equatable { + let amount: BigUInt + + /// use 0 to mark the lock is available to unlock now + let unlockAt: BlockNumber + + let actions: Set + + var isEmpty: Bool { + amount == 0 && actions.isEmpty + } + + static func emptyUnlock(at block: BlockNumber) -> Item { + .init(amount: 0, unlockAt: block, actions: []) + } + } + + struct Claimable: Equatable { + let amount: BigUInt + let actions: Set + + var isEmpty: Bool { + amount == 0 && actions.isEmpty + } + + static func empty() -> Claimable { + Claimable(amount: 0, actions: []) + } + } + + let items: [Item] + + func lockedBalance() -> BigUInt { + items.reduce(BigUInt(0)) { $0 + $1.amount } + } + + func availableUnlock(at block: BlockNumber) -> Claimable { + items + .filter { $0.unlockAt <= block } + .reduce(Claimable.empty()) { accum, unlock in + .init( + amount: accum.amount + unlock.amount, + actions: accum.actions.union(unlock.actions) + ) + } + } + + func remainingLocks(after block: BlockNumber) -> [Item] { + items.filter { $0.unlockAt > block } + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumAccountVoteLocal.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumAccountVoteLocal.swift new file mode 100644 index 0000000000..c38e52ffc2 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumAccountVoteLocal.swift @@ -0,0 +1,113 @@ +import Foundation +import BigInt + +enum ReferendumAccountVoteLocal { + case split(ConvictionVoting.AccountVoteSplit) + case standard(ConvictionVoting.AccountVoteStandard) + + var hasAyeVotes: Bool { + switch self { + case let .split(voting): + return voting.aye > 0 + case let .standard(voting): + return voting.vote.aye + } + } + + var hasNayVotes: Bool { + switch self { + case let .split(voting): + return voting.nay > 0 + case let .standard(voting): + return !voting.vote.aye + } + } + + /// post conviction votes for referendum + var ayes: BigUInt { + switch self { + case let .split(value): + let splitConviction = ConvictionVoting.Conviction.none + return splitConviction.votes(for: value.aye) ?? 0 + case let .standard(value): + if value.vote.aye { + return value.vote.conviction.votes(for: value.balance) ?? 0 + } else { + return 0 + } + } + } + + var nays: BigUInt { + switch self { + case let .split(value): + let splitConviction = ConvictionVoting.Conviction.none + return splitConviction.votes(for: value.nay) ?? 0 + case let .standard(value): + if !value.vote.aye { + return value.vote.conviction.votes(for: value.balance) ?? 0 + } else { + return 0 + } + } + } + + var ayeBalance: BigUInt { + switch self { + case let .split(value): + return value.aye + case let .standard(value): + if value.vote.aye { + return value.balance + } else { + return 0 + } + } + } + + var nayBalance: BigUInt { + switch self { + case let .split(value): + return value.nay + case let .standard(value): + if !value.vote.aye { + return value.balance + } else { + return 0 + } + } + } + + var totalBalance: BigUInt { + ayeBalance + nayBalance + } + + var conviction: Decimal? { + switch self { + case .split: + return 0.1 + case let .standard(value): + return value.vote.conviction.decimalValue + } + } + + var convictionValue: ConvictionVoting.Conviction { + switch self { + case .split: + return .none + case let .standard(voting): + return voting.vote.conviction + } + } + + init?(accountVote: ConvictionVoting.AccountVote) { + switch accountVote { + case let .split(split): + self = .split(split) + case let .standard(standard): + self = .standard(standard) + case .unknown: + return nil + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumActionLocal.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumActionLocal.swift new file mode 100644 index 0000000000..8574ba9f20 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumActionLocal.swift @@ -0,0 +1,27 @@ +import Foundation +import BigInt +import SubstrateSdk + +struct ReferendumActionLocal { + struct AmountSpendDetails { + let amount: BigUInt + let beneficiary: MultiAddress + } + + enum Call { + case concrete(C) + case tooLong + + var value: C? { + switch self { + case let .concrete(call): + return call + case .tooLong: + return nil + } + } + } + + let amountSpendDetails: AmountSpendDetails? + let call: Call>? +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumDecidingFunctionProtocol.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumDecidingFunctionProtocol.swift new file mode 100644 index 0000000000..a2e64213f2 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumDecidingFunctionProtocol.swift @@ -0,0 +1,84 @@ +import Foundation + +protocol ReferendumDecidingFunctionProtocol { + var curve: Referenda.Curve { get } + func calculateThreshold(for block: BlockNumber) -> Decimal? +} + +struct Gov2LocalDecidingFunction: ReferendumDecidingFunctionProtocol { + let curve: Referenda.Curve + let startBlock: BlockNumber? + let period: Moment + + private func calculateLinearDecreasing(from xPoint: Decimal, params: Referenda.LinearDecreasingCurve) -> Decimal? { + guard + let length = Decimal.fromSubstratePerbill(value: params.length), + length > 0.0, + let ceil = Decimal.fromSubstratePerbill(value: params.ceil), + let floor = Decimal.fromSubstratePerbill(value: params.floor) else { + return nil + } + + return ceil - (ceil - floor) * min(xPoint, length) / length + } + + private func calculateReciprocal(from xPoint: Decimal, params: Referenda.ReciprocalCurve) -> Decimal? { + let factor = Decimal.fromFixedI64(value: params.factor) + let xOffset = Decimal.fromFixedI64(value: params.xOffset) + let yOffset = Decimal.fromFixedI64(value: params.yOffset) + + let xAdd = xPoint + xOffset + + guard xAdd > 0 else { + return nil + } + + return factor / xAdd + yOffset + } + + private func calculateSteppedDecreasing( + from xPoint: Decimal, + params: Referenda.SteppedDecreasingCurve + ) -> Decimal? { + guard + let begin = Decimal.fromSubstratePerbill(value: params.begin), + let end = Decimal.fromSubstratePerbill(value: params.end), + let period = Decimal.fromSubstratePerbill(value: params.period), + period > 0, + let step = Decimal.fromSubstratePerbill(value: params.step) else { + return nil + } + + let periodIndex = (xPoint / period).floor() + let yPoint = min(begin - periodIndex * step, begin) + + return max(yPoint, end) + } +} + +extension Gov2LocalDecidingFunction { + func calculateThreshold(for block: BlockNumber) -> Decimal? { + let xPoint: Decimal + + let startBlock = self.startBlock ?? block + + if block < startBlock { + xPoint = 0 + } else if block > startBlock + period { + xPoint = 1 + } else { + xPoint = Decimal(block - startBlock) / Decimal(period) + } + + switch curve { + case let .linearDecreasing(params): + return calculateLinearDecreasing(from: xPoint, params: params) + case let .reciprocal(params): + return calculateReciprocal(from: xPoint, params: params) + case let .steppedDecreasing(params): + return calculateSteppedDecreasing(from: xPoint, params: params) + case .unknown: + return nil + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumDelegatingLocal.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumDelegatingLocal.swift new file mode 100644 index 0000000000..f40da966e2 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumDelegatingLocal.swift @@ -0,0 +1,22 @@ +import Foundation +import BigInt + +struct ReferendumDelegatingLocal { + let balance: BigUInt + + let target: AccountId + + let conviction: ConvictionVoting.Conviction + + let delegations: ConvictionVoting.Delegations + + let prior: ConvictionVoting.PriorLock + + init(remote: ConvictionVoting.Delegating) { + balance = remote.balance + target = remote.target + conviction = remote.conviction + delegations = remote.delegations + prior = remote.prior + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumLocal.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumLocal.swift new file mode 100644 index 0000000000..e7541a9737 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumLocal.swift @@ -0,0 +1,249 @@ +import Foundation +import BigInt +import SubstrateSdk + +typealias ReferendumIdLocal = UInt +typealias TrackIdLocal = UInt + +struct ReferendumLocal { + let index: ReferendumIdLocal + let state: ReferendumStateLocal + let proposer: AccountId? + + var canVote: Bool { + switch state { + case .preparing, .deciding: + return true + case .approved, .rejected, .cancelled, .timedOut, .killed, .executed: + return false + } + } + + var trackId: TrackIdLocal? { + track.map { TrackIdLocal($0.trackId) } + } + + var track: GovernanceTrackLocal? { + switch state { + case let .preparing(model): + return model.track + case let .deciding(model): + return model.track + case .approved, .rejected, .cancelled, .timedOut, .killed, .executed: + return nil + } + } + + var voting: ReferendumStateLocal.Voting? { + switch state { + case let .preparing(model): + return model.voting + case let .deciding(model): + return model.voting + case .approved, .rejected, .cancelled, .timedOut, .killed, .executed: + return nil + } + } + + var deposit: BigUInt? { + switch state { + case let .preparing(model): + return model.deposit + case let .deciding(model): + return model.deposit + case let .approved(model): + return model.deposit + case let .rejected(model): + return model.deposit + case let .cancelled(model): + return model.deposit + case let .timedOut(model): + return model.deposit + case .killed, .executed: + return nil + } + } +} + +struct SupportAndVotesLocal { + let ayes: BigUInt + let nays: BigUInt + let support: BigUInt + let totalIssuance: BigUInt + + /// fraction of ayes + var approvalFraction: Decimal? { + guard + let total = Decimal(ayes + nays), total > 0, + let ayesDecimal = Decimal(ayes) else { + return nil + } + + return ayesDecimal / total + } + + /// fraction of voted tokens + var supportFraction: Decimal { + guard + let totalDecimal = Decimal(totalIssuance), totalDecimal > 0, + let supportDecimal = Decimal(support) else { + return 0.0 + } + + return supportDecimal / totalDecimal + } + + /// nil if not deciding yet + let approvalFunction: ReferendumDecidingFunctionProtocol? + let supportFunction: ReferendumDecidingFunctionProtocol? + + func isPassing(at block: BlockNumber) -> Bool { + guard + let approvalThreshold = approvalFunction?.calculateThreshold(for: block), + let supportThreshold = supportFunction?.calculateThreshold(for: block), + let approvalFraction = approvalFraction else { + return false + } + + return approvalFraction >= approvalThreshold && supportFraction >= supportThreshold + } +} + +struct VotingThresholdLocal { + let ayes: BigUInt + let nays: BigUInt + let turnout: BigUInt + let electorate: BigUInt + + /// fraction of ayes + var approvalFraction: Decimal? { + guard + let total = Decimal(ayes + nays), total > 0, + let ayesDecimal = Decimal(ayes) else { + return nil + } + + return ayesDecimal / total + } + + let thresholdFunction: DemocracyDecidingFunctionProtocol + + func calculateThreshold() -> Decimal? { + thresholdFunction.calculateThreshold( + for: ayes, + nays: nays, + turnout: turnout, + electorate: electorate + ) + } + + func isPassing() -> Bool { + if let threshold = calculateThreshold(), let approvalFraction = approvalFraction { + return approvalFraction > threshold + } else { + return false + } + } +} + +enum ReferendumStateLocal { + enum Voting { + case supportAndVotes(SupportAndVotesLocal) + case threshold(VotingThresholdLocal) + } + + struct Deciding { + let track: GovernanceTrackLocal + let proposal: Democracy.Proposal? + let voting: Voting + let submitted: BlockNumber + let since: BlockNumber + let period: Moment + let confirmationUntil: BlockNumber? + let deposit: BigUInt? + + var rejectedAt: BlockNumber { + since + period + } + + func isPassing(for currentBlock: BlockNumber) -> Bool { + switch voting { + case let .supportAndVotes(model): + return model.isPassing(at: currentBlock) + case let .threshold(model): + return model.isPassing() + } + } + } + + struct InQueuePosition { + let index: Int + let total: Int + } + + struct Preparing { + let track: GovernanceTrackLocal + let proposal: SupportPallet.Bounded> + let voting: Voting + let deposit: BigUInt? + let since: BlockNumber + let preparingPeriod: Moment + let timeoutPeriod: Moment + let inQueue: Bool + let inQueuePosition: InQueuePosition? + + var preparingEnd: BlockNumber { + since + preparingPeriod + } + + var timeoutAt: BlockNumber { + since + timeoutPeriod + } + } + + struct Approved { + let since: BlockNumber + let whenEnactment: BlockNumber? + let deposit: BigUInt? + } + + struct NotApproved { + let atBlock: BlockNumber + let deposit: BigUInt? + } + + case preparing(model: Preparing) + case deciding(model: Deciding) + case approved(model: Approved) + case rejected(model: NotApproved) + case cancelled(model: NotApproved) + case timedOut(model: NotApproved) + case killed(atBlock: Moment) + case executed + + var completed: Bool { + switch self { + case .preparing, .deciding: + return false + case .approved, .rejected, .cancelled, .timedOut, .killed, .executed: + return true + } + } + + var proposal: SupportPallet.Bounded>? { + switch self { + case let .preparing(model): + return model.proposal + case let .deciding(model): + return model.proposal + case .approved, .rejected, .cancelled, .timedOut, .killed, .executed: + return nil + } + } +} + +struct GovernanceTrackLocal { + let trackId: UInt16 + let name: String + let totalTracksCount: Int +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumMetadataLocal.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumMetadataLocal.swift new file mode 100644 index 0000000000..5efae07341 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumMetadataLocal.swift @@ -0,0 +1,49 @@ +import Foundation +import RobinHood + +struct ReferendumMetadataPreview: Equatable { + let chainId: String + let referendumId: ReferendumIdLocal + let title: String? +} + +enum ReferendumMetadataStatus: String { + case started = "Started" + case passed = "Passed" + case notPassed = "NotPassed" + case executed = "Executed" +} + +struct ReferendumMetadataLocal: Equatable { + struct TimelineItem: Equatable, Codable { + let block: BlockNumber + let status: String + } + + let chainId: String + let referendumId: ReferendumIdLocal + let title: String? + let content: String? + let proposer: String? + let timeline: [TimelineItem]? + + func proposerAccountId(for chainFormat: ChainFormat) -> AccountId? { + try? proposer?.toAccountId(using: chainFormat) + } +} + +extension ReferendumMetadataLocal: Identifiable { + static func identifier(from chainId: ChainModel.Id, referendumId: ReferendumIdLocal) -> String { + chainId + "-" + String(referendumId) + } + + var identifier: String { + Self.identifier(from: chainId, referendumId: referendumId) + } +} + +extension ReferendumMetadataPreview: Identifiable { + var identifier: String { + ReferendumMetadataLocal.identifier(from: chainId, referendumId: referendumId) + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumNewVote.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumNewVote.swift new file mode 100644 index 0000000000..2482be105d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumNewVote.swift @@ -0,0 +1,18 @@ +import Foundation + +struct ReferendumNewVote { + let index: ReferendumIdLocal + let voteAction: ReferendumVoteAction + + func toAccountVote() -> ReferendumAccountVoteLocal { + .standard( + .init( + vote: .init( + aye: voteAction.isAye, + conviction: voteAction.conviction + ), + balance: voteAction.amount + ) + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumVoteAction.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumVoteAction.swift new file mode 100644 index 0000000000..16f12f23e1 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumVoteAction.swift @@ -0,0 +1,8 @@ +import Foundation +import BigInt + +struct ReferendumVoteAction: Hashable { + let amount: BigUInt + let conviction: ConvictionVoting.Conviction + let isAye: Bool +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumVoterLocal.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumVoterLocal.swift new file mode 100644 index 0000000000..daee93509c --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumVoterLocal.swift @@ -0,0 +1,6 @@ +import Foundation + +struct ReferendumVoterLocal { + let accountId: AccountId + let vote: ReferendumAccountVoteLocal +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumVotingLocal.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumVotingLocal.swift new file mode 100644 index 0000000000..7ef309e3b3 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumVotingLocal.swift @@ -0,0 +1,126 @@ +import Foundation +import BigInt + +struct ReferendumAccountVotingDistribution { + let votes: [ReferendumIdLocal: ReferendumAccountVoteLocal] + let votedTracks: [TrackIdLocal: Set] + let delegatings: [TrackIdLocal: ReferendumDelegatingLocal] + let priorLocks: [TrackIdLocal: ConvictionVoting.PriorLock] + let maxVotesPerTrack: UInt32 + + init( + votes: [ReferendumIdLocal: ReferendumAccountVoteLocal] = [:], + votedTracks: [TrackIdLocal: Set] = [:], + delegatings: [TrackIdLocal: ReferendumDelegatingLocal] = [:], + priorLocks: [TrackIdLocal: ConvictionVoting.PriorLock] = [:], + maxVotesPerTrack: UInt32 + ) { + self.votes = votes + self.votedTracks = votedTracks + self.delegatings = delegatings + self.priorLocks = priorLocks + self.maxVotesPerTrack = maxVotesPerTrack + } + + func tracksByReferendums() -> [ReferendumIdLocal: TrackIdLocal] { + let initial = [ReferendumIdLocal: TrackIdLocal]() + + return votedTracks.reduce(into: initial) { accum, keyValue in + let trackId = keyValue.key + + for referendumId in keyValue.value { + accum[referendumId] = trackId + } + } + } + + func lockedBalance(for trackId: TrackIdLocal) -> BigUInt { + if let delegating = delegatings[trackId] { + return max(delegating.balance, delegating.prior.amount) + } else { + let maxVotedBalance = (votedTracks[trackId] ?? []).map { referendumId in + votes[referendumId]?.totalBalance ?? 0 + } + .max() ?? 0 + + let priorLockedBalance = priorLocks[trackId]?.amount ?? 0 + + return max(maxVotedBalance, priorLockedBalance) + } + } + + func addingVote( + _ vote: ReferendumAccountVoteLocal, + referendumId: ReferendumIdLocal + ) -> ReferendumAccountVotingDistribution { + var newVotes = votes + newVotes[referendumId] = vote + + return ReferendumAccountVotingDistribution( + votes: newVotes, + votedTracks: votedTracks, + delegatings: delegatings, + priorLocks: priorLocks, + maxVotesPerTrack: maxVotesPerTrack + ) + } + + func addingDelegating( + _ delegating: ReferendumDelegatingLocal, + trackId: TrackIdLocal + ) -> ReferendumAccountVotingDistribution { + var newDelegatings = delegatings + newDelegatings[trackId] = delegating + + return ReferendumAccountVotingDistribution( + votes: votes, + votedTracks: votedTracks, + delegatings: newDelegatings, + priorLocks: priorLocks, + maxVotesPerTrack: maxVotesPerTrack + ) + } + + func addingReferendum( + _ referendumIndex: ReferendumIdLocal, + track: TrackIdLocal + ) -> ReferendumAccountVotingDistribution { + var newVotedTracks = votedTracks + var referendums = newVotedTracks[track] ?? Set() + referendums.insert(referendumIndex) + newVotedTracks[track] = referendums + + return ReferendumAccountVotingDistribution( + votes: votes, + votedTracks: newVotedTracks, + delegatings: delegatings, + priorLocks: priorLocks, + maxVotesPerTrack: maxVotesPerTrack + ) + } + + func addingPriorLock( + _ priorLock: ConvictionVoting.PriorLock, + track: TrackIdLocal + ) -> ReferendumAccountVotingDistribution { + var newPriorLocks = priorLocks + newPriorLocks[track] = priorLock + + return ReferendumAccountVotingDistribution( + votes: votes, + votedTracks: votedTracks, + delegatings: delegatings, + priorLocks: newPriorLocks, + maxVotesPerTrack: maxVotesPerTrack + ) + } +} + +struct ReferendumTracksVotingDistribution { + let votes: ReferendumAccountVotingDistribution + let trackLocks: [ConvictionVoting.ClassLock] + + func totalLocked() -> BigUInt { + trackLocks.reduce(BigUInt(0)) { max($0, $1.amount) } + } +} diff --git a/novawallet/Modules/Vote/Governance/Model/ReferendumsSorting.swift b/novawallet/Modules/Vote/Governance/Model/ReferendumsSorting.swift new file mode 100644 index 0000000000..3eaca363c4 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Model/ReferendumsSorting.swift @@ -0,0 +1,67 @@ +import Foundation + +protocol ReferendumsSorting { + func compare(referendum1: ReferendumLocal, referendum2: ReferendumLocal) -> Bool +} + +final class ReferendumsTimeSortingProvider { + private func getGroup(for referendum: ReferendumLocal) -> UInt32 { + referendum.state.completed ? 1 : 0 + } + + private func getPositionForOngoing(referendum: ReferendumLocal) -> UInt32 { + switch referendum.state { + case let .preparing(model): + return model.timeoutAt + case let .deciding(model): + if let confirmation = model.confirmationUntil { + return confirmation + } else { + return model.rejectedAt + } + default: + return UInt32.max + } + } + + private func getPositionForCompleted(referendum: ReferendumLocal) -> UInt32 { + switch referendum.state { + case let .approved(model): + if let executeAt = model.whenEnactment { + return executeAt + } else { + return UInt32.max + } + default: + return UInt32.max + } + } +} + +extension ReferendumsTimeSortingProvider: ReferendumsSorting { + func compare(referendum1: ReferendumLocal, referendum2: ReferendumLocal) -> Bool { + let group1 = getGroup(for: referendum1) + let group2 = getGroup(for: referendum2) + + guard group1 == group2 else { + return group1 < group2 + } + + let pos1: UInt32 + let pos2: UInt32 + + if referendum1.state.completed { + pos1 = getPositionForCompleted(referendum: referendum1) + pos2 = getPositionForCompleted(referendum: referendum2) + } else { + pos1 = getPositionForOngoing(referendum: referendum1) + pos2 = getPositionForOngoing(referendum: referendum2) + } + + guard pos1 != pos2 else { + return referendum1.index > referendum2.index + } + + return pos1 < pos2 + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Action/Gov1ActionOperationFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Action/Gov1ActionOperationFactory.swift new file mode 100644 index 0000000000..f1bf561188 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Action/Gov1ActionOperationFactory.swift @@ -0,0 +1,173 @@ +import Foundation +import RobinHood +import SubstrateSdk +import BigInt + +final class Gov1ActionOperationFactory: GovernanceActionOperationFactory { + let gov2OperationFactory: Gov2ActionOperationFactory + + init( + gov2OperationFactory: Gov2ActionOperationFactory, + requestFactory: StorageRequestFactoryProtocol, + operationQueue: OperationQueue + ) { + self.gov2OperationFactory = gov2OperationFactory + + super.init(requestFactory: requestFactory, operationQueue: operationQueue) + } + + private func createDemocracyPreimageWrapper( + dependingOn keyEncodingOperation: BaseOperation<[Data]>, + storageSizeOperation: BaseOperation, + connection: JSONRPCEngine, + codingFactory: RuntimeCoderFactoryProtocol + ) -> BaseOperation<[ReferendumActionLocal.Call>?]> { + OperationCombiningService>?>( + operationManager: OperationManager(operationQueue: operationQueue) + ) { + let optResult = try storageSizeOperation.extractNoCancellableResultData() + + if let size = optResult, size <= Self.maxFetchCallSize { + let callFetchWrapper: CompoundOperationWrapper<[StorageResponse]> = + self.requestFactory.queryItems( + engine: connection, + keys: { try keyEncodingOperation.extractNoCancellableResultData() }, + factory: { codingFactory }, + storagePath: Democracy.preimages + ) + + let mappingOperation = ClosureOperation>?> { + let responses = try callFetchWrapper.targetOperation.extractNoCancellableResultData() + guard case let .available(call) = responses.first?.value else { + return nil + } + + let decoder = try codingFactory.createDecoder(from: call.data) + + let optCall: RuntimeCall? = try? decoder.read( + of: GenericType.call.name, + with: codingFactory.createRuntimeJsonContext().toRawContext() + ) + + if let call = optCall { + return .concrete(call) + } else { + return nil + } + } + + mappingOperation.addDependency(callFetchWrapper.targetOperation) + + let wrapper = CompoundOperationWrapper( + targetOperation: mappingOperation, + dependencies: callFetchWrapper.allOperations + ) + + return [wrapper] + } else { + let wrapper = CompoundOperationWrapper>?>.createWithResult( + .tooLong + ) + return [wrapper] + } + }.longrunOperation() + } + + private func fetchDemocracyPreimage( + for hash: Data, + connection: JSONRPCEngine, + codingFactory: RuntimeCoderFactoryProtocol + ) -> CompoundOperationWrapper>?> { + let keyEncodingOperation = MapKeyEncodingOperation( + path: Democracy.preimages, + storageKeyFactory: StorageKeyFactory() + ) + + keyEncodingOperation.codingFactory = codingFactory + keyEncodingOperation.keyParams = [BytesCodable(wrappedValue: hash)] + + let storageSizeOperation = JSONRPCListOperation( + engine: connection, + method: RemoteStorageSize.method + ) + + storageSizeOperation.configurationBlock = { + do { + if let key = try keyEncodingOperation.extractNoCancellableResultData().first { + storageSizeOperation.parameters = [key.toHex(includePrefix: true)] + } else { + storageSizeOperation.result = .failure(CommonError.dataCorruption) + } + } catch { + storageSizeOperation.result = .failure(error) + } + } + + storageSizeOperation.addDependency(keyEncodingOperation) + + let combiningOperation = createDemocracyPreimageWrapper( + dependingOn: keyEncodingOperation, + storageSizeOperation: storageSizeOperation, + connection: connection, + codingFactory: codingFactory + ) + + combiningOperation.addDependency(storageSizeOperation) + + let mappingOperation = ClosureOperation>?> { + guard let action = try combiningOperation.extractNoCancellableResultData().first else { + return nil + } + + return action + } + + mappingOperation.addDependency(combiningOperation) + + let dependencies = [keyEncodingOperation, storageSizeOperation, combiningOperation] + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: dependencies) + } + + override func fetchCall( + for hash: Data, + connection: JSONRPCEngine, + codingFactoryOperation: BaseOperation + ) -> CompoundOperationWrapper>?> { + let fetchOperation = OperationCombiningService>?>( + operationManager: OperationManager(operationQueue: operationQueue) + ) { + let codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + + if codingFactory.metadata.getStorageMetadata(for: Democracy.preimages) != nil { + let wrapper = self.fetchDemocracyPreimage( + for: hash, + connection: connection, + codingFactory: codingFactory + ) + + return [wrapper] + } else { + let wrapper = self.gov2OperationFactory.fetchCall( + for: hash, + connection: connection, + codingFactoryOperation: codingFactoryOperation + ) + + return [wrapper] + } + }.longrunOperation() + + let mappingOperation = ClosureOperation>?> { + guard let action = try fetchOperation.extractNoCancellableResultData().first else { + return nil + } + + return action + } + + mappingOperation.addDependency(fetchOperation) + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: [fetchOperation]) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Action/Gov2ActionOperationFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Action/Gov2ActionOperationFactory.swift new file mode 100644 index 0000000000..2f90b07243 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Action/Gov2ActionOperationFactory.swift @@ -0,0 +1,83 @@ +import Foundation +import SubstrateSdk +import RobinHood + +final class Gov2ActionOperationFactory: GovernanceActionOperationFactory { + // swiftlint:disable:next function_body_length + override func fetchCall( + for hash: Data, + connection: JSONRPCEngine, + codingFactoryOperation: BaseOperation + ) -> CompoundOperationWrapper>?> { + let statusKeyParams: () throws -> [BytesCodable] = { + [BytesCodable(wrappedValue: hash)] + } + + let statusFetchWrapper: CompoundOperationWrapper<[StorageResponse]> = + requestFactory.queryItems( + engine: connection, + keyParams: statusKeyParams, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: Preimage.statusForStoragePath + ) + + let callKeyParams: () throws -> [Preimage.PreimageKey] = { + let status = try statusFetchWrapper.targetOperation.extractNoCancellableResultData().first?.value + + guard let length = status?.length, length <= Self.maxFetchCallSize else { + return [] + } + + return [Preimage.PreimageKey(hash: hash, length: length)] + } + + let callFetchWrapper: CompoundOperationWrapper<[StorageResponse]> = requestFactory.queryItems( + engine: connection, + keyParams: callKeyParams, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: Preimage.preimageForStoragePath + ) + + callFetchWrapper.addDependency(wrapper: statusFetchWrapper) + + let mappingOperation = ClosureOperation>?> { + let callKeys = try callKeyParams() + + guard !callKeys.isEmpty else { + let optStatus = try statusFetchWrapper.targetOperation.extractNoCancellableResultData().first?.value + + if let length = optStatus?.length { + return length > Self.maxFetchCallSize ? .tooLong : nil + } else { + return nil + } + } + + let responses = try callFetchWrapper.targetOperation.extractNoCancellableResultData() + guard let response = responses.first?.value else { + return nil + } + + let codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + + let decoder = try codingFactory.createDecoder(from: response.wrappedValue) + + let optCall: RuntimeCall? = try? decoder.read( + of: GenericType.call.name, + with: codingFactory.createRuntimeJsonContext().toRawContext() + ) + + if let call = optCall { + return .concrete(call) + } else { + return nil + } + } + + mappingOperation.addDependency(callFetchWrapper.targetOperation) + + let dependencies = statusFetchWrapper.allOperations + callFetchWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: dependencies) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Action/GovernanceActionOperationFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Action/GovernanceActionOperationFactory.swift new file mode 100644 index 0000000000..a39714d966 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Action/GovernanceActionOperationFactory.swift @@ -0,0 +1,188 @@ +import Foundation +import RobinHood +import SubstrateSdk + +class GovernanceActionOperationFactory { + static let maxFetchCallSize: UInt32 = 1024 + + let requestFactory: StorageRequestFactoryProtocol + let operationQueue: OperationQueue + + init(requestFactory: StorageRequestFactoryProtocol, operationQueue: OperationQueue) { + self.requestFactory = requestFactory + self.operationQueue = operationQueue + } + + func fetchCall( + for _: Data, + connection _: JSONRPCEngine, + codingFactoryOperation _: BaseOperation + ) -> CompoundOperationWrapper>?> { + fatalError("Must be overriden by child class") + } + + private func createCallFetchWrapper( + dependingOn codingFactoryOperation: BaseOperation, + referendum: ReferendumLocal, + requestFactory _: StorageRequestFactoryProtocol, + connection: JSONRPCEngine + ) -> CompoundOperationWrapper>?> { + let callDecodingService = OperationCombiningService>?>( + operationManager: OperationManager(operationQueue: operationQueue) + ) { + switch referendum.state.proposal { + case let .legacy(hash): + let wrapper = self.fetchCall( + for: hash, + connection: connection, + codingFactoryOperation: codingFactoryOperation + ) + return [wrapper] + case let .inline(value): + return [CompoundOperationWrapper.createWithResult(.concrete(value))] + case let .lookup(lookup): + if lookup.len <= Self.maxFetchCallSize { + let wrapper = self.fetchCall( + for: lookup.hash, + connection: connection, + codingFactoryOperation: codingFactoryOperation + ) + + return [wrapper] + } else { + return [CompoundOperationWrapper.createWithResult(.tooLong)] + } + case .none, .unknown: + return [] + } + } + + let callDecodingOperation = callDecodingService.longrunOperation() + let mappingOperation = ClosureOperation>?> { + try callDecodingOperation.extractNoCancellableResultData().first ?? nil + } + + mappingOperation.addDependency(callDecodingOperation) + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: [callDecodingOperation]) + } + + private func createSpendAmountExtractionWrapper( + dependingOn callOperation: BaseOperation>?>, + codingFactoryOperation: BaseOperation, + connection: JSONRPCEngine, + requestFactory: StorageRequestFactoryProtocol + ) -> CompoundOperationWrapper { + let operationManager = OperationManager(operationQueue: operationQueue) + let fetchService = OperationCombiningService( + operationManager: operationManager + ) { + guard let call = try callOperation.extractNoCancellableResultData()?.value else { + return [CompoundOperationWrapper.createWithResult(nil)] + } + + let codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + let context = codingFactory.createRuntimeJsonContext() + + let codingPath = CallCodingPath(moduleName: call.moduleName, callName: call.callName) + + if codingPath == Treasury.spendCallPath { + let spendCall = try call.args.map(to: Treasury.SpendCall.self, with: context.toRawContext()) + + let details = ReferendumActionLocal.AmountSpendDetails( + amount: spendCall.amount, + beneficiary: spendCall.beneficiary + ) + + return [CompoundOperationWrapper.createWithResult(details)] + } + + if codingPath == Treasury.approveProposalCallPath { + let approveCall = try call.args.map(to: Treasury.ApproveProposal.self, with: context.toRawContext()) + + let keyClosure: () throws -> [StringScaleMapper] = { + [StringScaleMapper(value: approveCall.proposalId)] + } + + let wrapper: CompoundOperationWrapper<[StorageResponse]> = requestFactory.queryItems( + engine: connection, + keyParams: keyClosure, + factory: { codingFactory }, + storagePath: Treasury.proposalsStoragePath + ) + + let mapOperation = ClosureOperation { + let responses = try wrapper.targetOperation.extractNoCancellableResultData() + guard let proposal = responses.first?.value else { + return nil + } + + return ReferendumActionLocal.AmountSpendDetails( + amount: proposal.value, + beneficiary: .accoundId(proposal.beneficiary) + ) + } + + mapOperation.addDependency(wrapper.targetOperation) + + return [CompoundOperationWrapper(targetOperation: mapOperation, dependencies: wrapper.allOperations)] + } + + return [CompoundOperationWrapper.createWithResult(nil)] + } + + let fetchOperation = fetchService.longrunOperation() + + let mapOperation = ClosureOperation { + try fetchOperation.extractNoCancellableResultData().first ?? nil + } + + mapOperation.addDependency(fetchOperation) + + return CompoundOperationWrapper(targetOperation: mapOperation, dependencies: [fetchOperation]) + } +} + +extension GovernanceActionOperationFactory: ReferendumActionOperationFactoryProtocol { + func fetchActionWrapper( + for referendum: ReferendumLocal, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol + ) -> CompoundOperationWrapper { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let callFetchWrapper = createCallFetchWrapper( + dependingOn: codingFactoryOperation, + referendum: referendum, + requestFactory: requestFactory, + connection: connection + ) + + callFetchWrapper.addDependency(operations: [codingFactoryOperation]) + + let amountDetailsWrapper = createSpendAmountExtractionWrapper( + dependingOn: callFetchWrapper.targetOperation, + codingFactoryOperation: codingFactoryOperation, + connection: connection, + requestFactory: requestFactory + ) + + amountDetailsWrapper.addDependency(wrapper: callFetchWrapper) + amountDetailsWrapper.addDependency(operations: [codingFactoryOperation]) + + let mapOperation = ClosureOperation { + let call = try callFetchWrapper.targetOperation.extractNoCancellableResultData() + let amountDetails = try amountDetailsWrapper.targetOperation.extractNoCancellableResultData() + + return ReferendumActionLocal(amountSpendDetails: amountDetails, call: call) + } + + mapOperation.addDependency(callFetchWrapper.targetOperation) + mapOperation.addDependency(amountDetailsWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + callFetchWrapper.allOperations + + amountDetailsWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mapOperation, dependencies: dependencies) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Extrinsics/Gov1ExtrinsicFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Extrinsics/Gov1ExtrinsicFactory.swift new file mode 100644 index 0000000000..81ef5630c4 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Extrinsics/Gov1ExtrinsicFactory.swift @@ -0,0 +1,52 @@ +import Foundation +import SubstrateSdk + +final class Gov1ExtrinsicFactory: GovernanceExtrinsicFactory, GovernanceExtrinsicFactoryProtocol { + func vote( + _ action: ReferendumVoteAction, + referendum: ReferendumIdLocal, + builder: ExtrinsicBuilderProtocol + ) throws -> ExtrinsicBuilderProtocol { + let accountVote = ConvictionVoting.AccountVote.standard( + .init( + vote: .init(aye: action.isAye, conviction: action.conviction), + balance: action.amount + ) + ) + + let voteCall = Democracy.VoteCall( + referendumIndex: Referenda.ReferendumIndex(referendum), + vote: accountVote + ) + + return try builder.adding(call: voteCall.runtimeCall) + } + + func unlock( + with actions: Set, + accountId: AccountId, + builder: ExtrinsicBuilderProtocol + ) throws -> ExtrinsicBuilderProtocol { + let removeVoteCalls: [RuntimeCall] = actions.compactMap { action in + switch action { + case let .unvote(_, index): + return Democracy.RemoveVoteCall(index: Referenda.ReferendumIndex(index)).runtimeCall + case .unlock: + return nil + } + } + + let unlockCalls: [RuntimeCall] = actions.compactMap { action in + switch action { + case .unlock: + return Democracy.UnlockCall(target: .accoundId(accountId)).runtimeCall + case .unvote: + return nil + } + } + + let newBuilder = try appendCalls(removeVoteCalls, builder: builder) + + return try appendCalls(unlockCalls, builder: newBuilder) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Extrinsics/Gov2ExtrinsicFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Extrinsics/Gov2ExtrinsicFactory.swift new file mode 100644 index 0000000000..960c7ec0eb --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Extrinsics/Gov2ExtrinsicFactory.swift @@ -0,0 +1,58 @@ +import Foundation +import SubstrateSdk + +final class Gov2ExtrinsicFactory: GovernanceExtrinsicFactory, GovernanceExtrinsicFactoryProtocol { + func vote( + _ action: ReferendumVoteAction, + referendum: ReferendumIdLocal, + builder: ExtrinsicBuilderProtocol + ) throws -> ExtrinsicBuilderProtocol { + let accountVote = ConvictionVoting.AccountVote.standard( + .init( + vote: .init(aye: action.isAye, conviction: action.conviction), + balance: action.amount + ) + ) + + let voteCall = ConvictionVoting.VoteCall( + referendumIndex: Referenda.ReferendumIndex(referendum), + vote: accountVote + ) + + return try builder.adding(call: voteCall.runtimeCall) + } + + func unlock( + with actions: Set, + accountId: AccountId, + builder: ExtrinsicBuilderProtocol + ) throws -> ExtrinsicBuilderProtocol { + let removeVoteCalls: [RuntimeCall] = actions.compactMap { action in + switch action { + case let .unvote(track, index): + return ConvictionVoting.RemoveVoteCall( + track: Referenda.TrackId(track), + index: Referenda.ReferendumIndex(index) + ).runtimeCall + case .unlock: + return nil + } + } + + let unlockCalls: [RuntimeCall] = actions.compactMap { action in + switch action { + case let .unlock(track): + return ConvictionVoting.UnlockCall( + track: Referenda.TrackId(track), + target: .accoundId(accountId) + ).runtimeCall + case .unvote: + return nil + } + } + + let newBuilder = try appendCalls(removeVoteCalls, builder: builder) + + return try appendCalls(unlockCalls, builder: newBuilder) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Extrinsics/GovernanceExtrinsicFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Extrinsics/GovernanceExtrinsicFactory.swift new file mode 100644 index 0000000000..c372fa7d17 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Extrinsics/GovernanceExtrinsicFactory.swift @@ -0,0 +1,11 @@ +import Foundation +import SubstrateSdk + +class GovernanceExtrinsicFactory { + func appendCalls( + _ calls: [C], + builder: ExtrinsicBuilderProtocol + ) throws -> ExtrinsicBuilderProtocol { + try calls.reduce(builder) { try $0.adding(call: $1) } + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1LocalMappingFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1LocalMappingFactory.swift new file mode 100644 index 0000000000..8171be6d85 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1LocalMappingFactory.swift @@ -0,0 +1,134 @@ +import Foundation +import BigInt + +final class Gov1LocalMappingFactory { + private func mapOngoing( + referendum: Democracy.OngoingStatus, + index: Referenda.ReferendumIndex, + additionalInfo: Gov1OperationFactory.AdditionalInfo + ) -> ReferendumLocal { + let track = GovernanceTrackLocal( + trackId: Gov1OperationFactory.trackId, + name: Gov1OperationFactory.trackName, + totalTracksCount: 1 + ) + + let submitted = referendum.end - additionalInfo.votingPeriod + + let voting = VotingThresholdLocal( + ayes: referendum.tally.ayes, + nays: referendum.tally.nays, + turnout: referendum.tally.turnout, + electorate: additionalInfo.totalIssuance, + thresholdFunction: Gov1DecidingFunction(thresholdType: referendum.threshold) + ) + + let state = ReferendumStateLocal.Deciding( + track: track, + proposal: referendum.universalProposal, + voting: .threshold(voting), + submitted: submitted, + since: submitted, + period: additionalInfo.votingPeriod, + confirmationUntil: referendum.end, + deposit: nil + ) + + return .init(index: ReferendumIdLocal(index), state: .deciding(model: state), proposer: nil) + } + + private func mapFinished( + referendum: Democracy.FinishedStatus, + index: Referenda.ReferendumIndex, + enactmentBlock: BlockNumber? + ) -> ReferendumLocal { + if referendum.approved { + if let enactmentBlock = enactmentBlock { + let approved = ReferendumStateLocal.Approved( + since: referendum.end, + whenEnactment: enactmentBlock, + deposit: nil + ) + + return .init(index: ReferendumIdLocal(index), state: .approved(model: approved), proposer: nil) + } else { + return .init(index: ReferendumIdLocal(index), state: .executed, proposer: nil) + } + } else { + let rejected = ReferendumStateLocal.NotApproved( + atBlock: referendum.end, + deposit: nil + ) + return .init(index: ReferendumIdLocal(index), state: .rejected(model: rejected), proposer: nil) + } + } +} + +extension Gov1LocalMappingFactory { + func mapRemote( + referendum: Democracy.ReferendumInfo, + index: Referenda.ReferendumIndex, + additionalInfo: Gov1OperationFactory.AdditionalInfo, + enactmentBlock: BlockNumber? + ) -> ReferendumLocal? { + switch referendum { + case let .ongoing(status): + return mapOngoing(referendum: status, index: index, additionalInfo: additionalInfo) + case let .finished(status): + return mapFinished( + referendum: status, + index: index, + enactmentBlock: enactmentBlock + ) + case .unknown: + return nil + } + } + + func mapToTracksVoting( + _ voting: Democracy.Voting?, + lockedBalance: BigUInt?, + maxVotes: UInt32 + ) -> ReferendumTracksVotingDistribution { + let accountVoting = mapToAccountVoting(voting, maxVotes: maxVotes) + + let trackId = Gov1OperationFactory.trackId + + if let lockedBalance = lockedBalance, lockedBalance > 0 { + let trackLock = ConvictionVoting.ClassLock(trackId: trackId, amount: lockedBalance) + return .init(votes: accountVoting, trackLocks: [trackLock]) + } else { + return .init(votes: accountVoting, trackLocks: []) + } + } + + func mapToAccountVoting( + _ voting: Democracy.Voting?, + maxVotes: UInt32 + ) -> ReferendumAccountVotingDistribution { + let initVotingLocal = ReferendumAccountVotingDistribution(maxVotesPerTrack: maxVotes) + + if let voting = voting { + let track = TrackIdLocal(Gov1OperationFactory.trackId) + switch voting { + case let .direct(castingVoting): + return castingVoting.votes.reduce(initVotingLocal) { result, vote in + let newResult = result.addingReferendum(ReferendumIdLocal(vote.pollIndex), track: track) + + guard let localVote = ReferendumAccountVoteLocal(accountVote: vote.accountVote) else { + return newResult + } + + return newResult.addingVote(localVote, referendumId: ReferendumIdLocal(vote.pollIndex)) + }.addingPriorLock(castingVoting.prior, track: track) + case let .delegating(delegatingVoting): + let delegatingLocal = ReferendumDelegatingLocal(remote: delegatingVoting) + return initVotingLocal.addingDelegating(delegatingLocal, trackId: track) + case .unknown: + return initVotingLocal + } + } else { + return initVotingLocal + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1OperationFactory+Protocol.swift b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1OperationFactory+Protocol.swift new file mode 100644 index 0000000000..7008a131c2 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1OperationFactory+Protocol.swift @@ -0,0 +1,248 @@ +import Foundation +import RobinHood +import BigInt +import SubstrateSdk + +extension Gov1OperationFactory: ReferendumsOperationFactoryProtocol { + func fetchAllReferendumsWrapper( + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol + ) -> CompoundOperationWrapper<[ReferendumLocal]> { + let request = UnkeyedRemoteStorageRequest(storagePath: Democracy.referendumInfo) + + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let referendumWrapper: CompoundOperationWrapper<[ReferendumIndexKey: Democracy.ReferendumInfo]> = + requestFactory.queryByPrefix( + engine: connection, + request: request, + storagePath: request.storagePath, + factory: { try codingFactoryOperation.extractNoCancellableResultData() } + ) + + referendumWrapper.addDependency(operations: [codingFactoryOperation]) + + let enactmentsWrapper = createEnacmentTimeFetchWrapper( + dependingOn: referendumWrapper.targetOperation, + connection: connection, + runtimeProvider: runtimeProvider, + blockHash: nil + ) + + enactmentsWrapper.addDependency(wrapper: referendumWrapper) + + let additionalWrapper = createAdditionalInfoWrapper( + dependingOn: codingFactoryOperation, + connection: connection, + blockHash: nil + ) + + additionalWrapper.addDependency(operations: [codingFactoryOperation]) + + let mapOperation = createReferendumMapOperation( + dependingOn: referendumWrapper.targetOperation, + additionalInfoOperation: additionalWrapper.targetOperation, + enactmentsOperation: enactmentsWrapper.targetOperation + ) + + mapOperation.addDependency(additionalWrapper.targetOperation) + mapOperation.addDependency(referendumWrapper.targetOperation) + mapOperation.addDependency(enactmentsWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + referendumWrapper.allOperations + + enactmentsWrapper.allOperations + additionalWrapper.allOperations + + return .init(targetOperation: mapOperation, dependencies: dependencies) + } + + func fetchReferendumWrapper( + for remoteReferendum: Democracy.ReferendumInfo, + index: ReferendumIdLocal, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let additionalInfoWrapper = createAdditionalInfoWrapper( + dependingOn: codingFactoryOperation, + connection: connection, + blockHash: blockHash + ) + + additionalInfoWrapper.addDependency(operations: [codingFactoryOperation]) + + let referendumOperation = ClosureOperation<[ReferendumIndexKey: Democracy.ReferendumInfo]> { + let referendumIndexKey = ReferendumIndexKey(referendumIndex: Referenda.ReferendumIndex(index)) + return [referendumIndexKey: remoteReferendum] + } + + let enactmentsWrapper = createEnacmentTimeFetchWrapper( + dependingOn: referendumOperation, + connection: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + enactmentsWrapper.addDependency(operations: [referendumOperation]) + + let mergeOperation = createReferendumMapOperation( + dependingOn: referendumOperation, + additionalInfoOperation: additionalInfoWrapper.targetOperation, + enactmentsOperation: enactmentsWrapper.targetOperation + ) + + mergeOperation.addDependency(referendumOperation) + mergeOperation.addDependency(additionalInfoWrapper.targetOperation) + mergeOperation.addDependency(enactmentsWrapper.targetOperation) + + let mapOperation = ClosureOperation { + guard let referendum = try mergeOperation.extractNoCancellableResultData().first else { + throw BaseOperationError.unexpectedDependentResult + } + + return referendum + } + + mapOperation.addDependency(mergeOperation) + + let dependencies = [codingFactoryOperation, referendumOperation] + + additionalInfoWrapper.allOperations + enactmentsWrapper.allOperations + [mergeOperation] + + return CompoundOperationWrapper(targetOperation: mapOperation, dependencies: dependencies) + } + + func fetchTracksVotingWrapper( + for voting: Democracy.Voting?, + accountId: AccountId, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let lockKeys: () throws -> [BytesCodable] = { + [BytesCodable(wrappedValue: accountId)] + } + + let locksWrapper: CompoundOperationWrapper<[StorageResponse]> = requestFactory.queryItems( + engine: connection, + keyParams: lockKeys, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: .balanceLocks, + at: blockHash + ) + + locksWrapper.addDependency(operations: [codingFactoryOperation]) + + let maxVotesOperation = createMaxVotesOperation(dependingOn: codingFactoryOperation) + maxVotesOperation.addDependency(codingFactoryOperation) + + let mappingOperation = ClosureOperation { + let maxVotes = try maxVotesOperation.extractNoCancellableResultData() + let locks = try locksWrapper.targetOperation.extractNoCancellableResultData().first?.value + + let lockedAmount = locks? + .first { String(data: $0.identifier, encoding: .utf8) == Democracy.lockId }? + .amount ?? 0 + + return Gov1LocalMappingFactory().mapToTracksVoting(voting, lockedBalance: lockedAmount, maxVotes: maxVotes) + } + + mappingOperation.addDependency(maxVotesOperation) + mappingOperation.addDependency(locksWrapper.targetOperation) + + let dependencies = [codingFactoryOperation, maxVotesOperation] + locksWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: dependencies) + } + + func fetchAccountVotesWrapper( + for accountId: AccountId, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let keyParams: () throws -> [BytesCodable] = { + [BytesCodable(wrappedValue: accountId)] + } + + let votesWrapper: CompoundOperationWrapper<[StorageResponse]> = + requestFactory.queryItems( + engine: connection, + keyParams: keyParams, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: Democracy.votingOf, + at: blockHash + ) + + votesWrapper.addDependency(operations: [codingFactoryOperation]) + + let maxVotesOperation = createMaxVotesOperation(dependingOn: codingFactoryOperation) + maxVotesOperation.addDependency(codingFactoryOperation) + + let mappingOperation = ClosureOperation { + let optVoting = try votesWrapper.targetOperation.extractNoCancellableResultData().first?.value + let maxVotes = try maxVotesOperation.extractNoCancellableResultData() + + return Gov1LocalMappingFactory().mapToAccountVoting(optVoting, maxVotes: maxVotes) + } + + mappingOperation.addDependency(votesWrapper.targetOperation) + mappingOperation.addDependency(maxVotesOperation) + + let dependencies = [codingFactoryOperation, maxVotesOperation] + votesWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: dependencies) + } + + func fetchVotersWrapper( + for referendumIndex: ReferendumIdLocal, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol + ) -> CompoundOperationWrapper<[ReferendumVoterLocal]> { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let request = UnkeyedRemoteStorageRequest(storagePath: Democracy.votingOf) + + let votesWrapper: CompoundOperationWrapper<[Democracy.VotingOfKey: Democracy.Voting]> = + requestFactory.queryByPrefix( + engine: connection, + request: request, + storagePath: Democracy.votingOf, + factory: { try codingFactoryOperation.extractNoCancellableResultData() } + ) + + votesWrapper.addDependency(operations: [codingFactoryOperation]) + + let mappingOperation = ClosureOperation<[ReferendumVoterLocal]> { + let votesResult = try votesWrapper.targetOperation.extractNoCancellableResultData() + + return votesResult.compactMap { keyValue in + let accountId = keyValue.key.accountId + let voting = keyValue.value + + switch voting { + case let .direct(directVoting): + guard + let vote = directVoting.votes.first(where: { $0.pollIndex == referendumIndex }), + let accountVote = ReferendumAccountVoteLocal(accountVote: vote.accountVote) else { + return nil + } + + return ReferendumVoterLocal(accountId: accountId, vote: accountVote) + case .delegating, .unknown: + return nil + } + } + } + + mappingOperation.addDependency(votesWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + votesWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: dependencies) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1OperationFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1OperationFactory.swift new file mode 100644 index 0000000000..59ea1464d4 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov1OperationFactory.swift @@ -0,0 +1,283 @@ +import Foundation +import RobinHood +import BigInt +import SubstrateSdk + +final class Gov1OperationFactory { + static let trackName: String = "root" + static let trackId: Referenda.TrackId = 0 + + struct AdditionalInfo { + let votingPeriod: UInt32 + let enactmentPeriod: UInt32 + let totalIssuance: BigUInt + let block: BlockNumber + } + + typealias SchedulerKeysClosure = () throws -> [SchedulerTaskName] + + struct SchedulerTaskName: Encodable { + static let taskNameSize = 32 + + enum EncodingScheme { + case legacy + case migrating + case actual + } + + let index: Referenda.ReferendumIndex + let encodingScheme: EncodingScheme + + init(index: Referenda.ReferendumIndex, encodingScheme: EncodingScheme = .actual) { + self.index = index + self.encodingScheme = encodingScheme + } + + func encode(to encoder: Encoder) throws { + let scaleEncoder = ScaleEncoder() + Democracy.lockId.data(using: .utf8).map { scaleEncoder.appendRaw(data: $0) } + try index.encode(scaleEncoder: scaleEncoder) + + let encodedData = scaleEncoder.encode() + let keyData: Data + + switch encodingScheme { + case .legacy: + keyData = encodedData + case .migrating: + keyData = try encodedData.blake2b32() + case .actual: + keyData = try hash(data: encodedData, ifExceeds: Self.taskNameSize) + } + + var container = encoder.singleValueContainer() + try container.encode(BytesCodable(wrappedValue: keyData)) + } + + private func hash(data: Data, ifExceeds size: Int) throws -> Data { + if data.count <= size { + return data.fillRightWithZeros(ifLess: size) + } else { + let hashedData = try data.blake2b32() + + if hashedData.count <= size { + return hashedData.fillRightWithZeros(ifLess: size) + } else { + return hashedData.prefix(size) + } + } + } + } + + let requestFactory: StorageRequestFactoryProtocol + let operationQueue: OperationQueue + + init(requestFactory: StorageRequestFactoryProtocol, operationQueue: OperationQueue) { + self.requestFactory = requestFactory + self.operationQueue = operationQueue + } + + private func prepareSchedulerKeysClosure( + dependingOn referendumOperation: BaseOperation<[ReferendumIndexKey: Democracy.ReferendumInfo]>, + codingFactoryOperation: BaseOperation, + storagePath: StorageCodingPath + ) -> SchedulerKeysClosure { + { + let referendums = try referendumOperation.extractNoCancellableResultData() + + let codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + let metadata = codingFactory.metadata + + let shouldUseLegacyEncoding: Bool = metadata.isMapStorageKeyOfType(storagePath) { key in + // legacy keys are composed of unbounded byte array + codingFactory.isBytesArrayType(key) + } + + let keys: [[SchedulerTaskName]] = referendums.compactMap { keyValue in + switch keyValue.value { + case let .finished(status): + if status.approved { + if shouldUseLegacyEncoding { + let key = SchedulerTaskName( + index: keyValue.key.referendumIndex, + encodingScheme: .legacy + ) + + return [key] + } else { + let key1 = SchedulerTaskName( + index: keyValue.key.referendumIndex, + encodingScheme: .actual + ) + + let key2 = SchedulerTaskName( + index: keyValue.key.referendumIndex, + encodingScheme: .migrating + ) + + return [key1, key2] + } + } else { + return nil + } + default: + return nil + } + } + + return keys.flatMap { $0 } + } + } + + func createEnacmentTimeFetchWrapper( + dependingOn referendumOperation: BaseOperation<[ReferendumIndexKey: Democracy.ReferendumInfo]>, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper<[ReferendumIdLocal: BlockNumber]> { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let storagePath = OnChainScheduler.lookupTaskPath + + let keysClosure = prepareSchedulerKeysClosure( + dependingOn: referendumOperation, + codingFactoryOperation: codingFactoryOperation, + storagePath: storagePath + ) + + let enactmentWrapper: CompoundOperationWrapper<[StorageResponse]> = + requestFactory.queryItems( + engine: connection, + keyParams: keysClosure, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: storagePath, + at: blockHash + ) + + enactmentWrapper.addDependency(operations: [codingFactoryOperation]) + + let mapOperation = ClosureOperation<[ReferendumIdLocal: BlockNumber]> { + let keys = try keysClosure() + let results = try enactmentWrapper.targetOperation.extractNoCancellableResultData() + + return zip(keys, results).reduce(into: [ReferendumIdLocal: BlockNumber]()) { accum, keyResult in + guard let when = keyResult.1.value?.when else { + return + } + + accum[ReferendumIdLocal(keyResult.0.index)] = when + } + } + + mapOperation.addDependency(enactmentWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + enactmentWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mapOperation, dependencies: dependencies) + } + + func createAdditionalInfoWrapper( + dependingOn codingFactoryOperation: BaseOperation, + connection: JSONRPCEngine, + blockHash: Data? + ) -> CompoundOperationWrapper { + let votingPeriodOperation = PrimitiveConstantOperation(path: Democracy.votingPeriod) + votingPeriodOperation.configurationBlock = { + do { + votingPeriodOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + votingPeriodOperation.result = .failure(error) + } + } + + let enactmentPeriodOperation = PrimitiveConstantOperation(path: Democracy.enactmentPeriod) + enactmentPeriodOperation.configurationBlock = { + do { + enactmentPeriodOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + enactmentPeriodOperation.result = .failure(error) + } + } + + let totalIssuanceWrapper: CompoundOperationWrapper>> = + requestFactory.queryItem( + engine: connection, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: .totalIssuance, + at: blockHash + ) + + let blockNumberWrapper: CompoundOperationWrapper>> = + requestFactory.queryItem( + engine: connection, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: .blockNumber, + at: blockHash + ) + + let mapOperation = ClosureOperation { + let votingPeriod = try votingPeriodOperation.extractNoCancellableResultData() + let totalIssuance = try totalIssuanceWrapper.targetOperation.extractNoCancellableResultData().value + let enactmentPeriod = try enactmentPeriodOperation.extractNoCancellableResultData() + let block = try blockNumberWrapper.targetOperation.extractNoCancellableResultData().value + + return .init( + votingPeriod: votingPeriod, + enactmentPeriod: enactmentPeriod, + totalIssuance: totalIssuance?.value ?? 0, + block: block?.value ?? 0 + ) + } + + mapOperation.addDependency(votingPeriodOperation) + mapOperation.addDependency(totalIssuanceWrapper.targetOperation) + mapOperation.addDependency(enactmentPeriodOperation) + mapOperation.addDependency(blockNumberWrapper.targetOperation) + + let dependencies = [votingPeriodOperation, enactmentPeriodOperation] + totalIssuanceWrapper.allOperations + + blockNumberWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mapOperation, dependencies: dependencies) + } + + func createReferendumMapOperation( + dependingOn referendumOperation: BaseOperation<[ReferendumIndexKey: Democracy.ReferendumInfo]>, + additionalInfoOperation: BaseOperation, + enactmentsOperation: BaseOperation<[ReferendumIdLocal: BlockNumber]> + ) -> BaseOperation<[ReferendumLocal]> { + ClosureOperation<[ReferendumLocal]> { + let remoteReferendums = try referendumOperation.extractNoCancellableResultData() + let additionalInfo = try additionalInfoOperation.extractNoCancellableResultData() + let enacmentBlocks = try enactmentsOperation.extractNoCancellableResultData() + + let mappingFactory = Gov1LocalMappingFactory() + + return remoteReferendums.compactMap { keyedReferendum in + let referendumIndex = ReferendumIdLocal(keyedReferendum.key.referendumIndex) + let remoteReferendum = keyedReferendum.value + + return mappingFactory.mapRemote( + referendum: remoteReferendum, + index: Referenda.ReferendumIndex(referendumIndex), + additionalInfo: additionalInfo, + enactmentBlock: enacmentBlocks[referendumIndex] + ) + } + } + } + + func createMaxVotesOperation( + dependingOn codingFactoryOperation: BaseOperation + ) -> BaseOperation { + let maxVotesOperation = PrimitiveConstantOperation(path: Democracy.maxVotes) + maxVotesOperation.configurationBlock = { + do { + maxVotesOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + maxVotesOperation.result = .failure(error) + } + } + + return maxVotesOperation + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2LocalMappingFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2LocalMappingFactory.swift new file mode 100644 index 0000000000..8eb5c58239 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2LocalMappingFactory.swift @@ -0,0 +1,236 @@ +import Foundation +import BigInt + +final class Gov2LocalMappingFactory { + private func createDecidingState( + from status: ReferendumInfo.OngoingStatus, + deciding: ReferendumInfo.DecidingStatus, + track: Referenda.TrackInfo, + additionalInfo: Gov2OperationFactory.AdditionalInfo + ) -> ReferendumStateLocal { + let approvalFunction = Gov2LocalDecidingFunction( + curve: track.minApproval, + startBlock: deciding.since, + period: track.decisionPeriod + ) + + let supportFunction = Gov2LocalDecidingFunction( + curve: track.minSupport, + startBlock: deciding.since, + period: track.decisionPeriod + ) + + let votes = SupportAndVotesLocal( + ayes: status.tally.ayes, + nays: status.tally.nays, + support: status.tally.support, + totalIssuance: additionalInfo.totalIssuance, + approvalFunction: approvalFunction, + supportFunction: supportFunction + ) + + let localTrack = GovernanceTrackLocal( + trackId: status.track, + name: track.name, + totalTracksCount: additionalInfo.tracks.count + ) + + let deposit = deposit(from: status.submissionDeposit, decision: status.decisionDeposit) + + let model = ReferendumStateLocal.Deciding( + track: localTrack, + proposal: status.proposal, + voting: .supportAndVotes(votes), + submitted: status.submitted, + since: deciding.since, + period: track.decisionPeriod, + confirmationUntil: deciding.confirming, + deposit: deposit + ) + + return .deciding(model: model) + } + + private func createPreparingState( + from status: ReferendumInfo.OngoingStatus, + index: Referenda.ReferendumIndex, + track: Referenda.TrackInfo, + additionalInfo: Gov2OperationFactory.AdditionalInfo, + trackQueue: [Referenda.TrackQueueItem]? + ) -> ReferendumStateLocal { + let approvalFunction = Gov2LocalDecidingFunction( + curve: track.minApproval, + startBlock: nil, + period: track.decisionPeriod + ) + + let supportFunction = Gov2LocalDecidingFunction( + curve: track.minSupport, + startBlock: nil, + period: track.decisionPeriod + ) + + let votes = SupportAndVotesLocal( + ayes: status.tally.ayes, + nays: status.tally.nays, + support: status.tally.support, + totalIssuance: additionalInfo.totalIssuance, + approvalFunction: approvalFunction, + supportFunction: supportFunction + ) + + let localTrack = GovernanceTrackLocal( + trackId: status.track, + name: track.name, + totalTracksCount: additionalInfo.tracks.count + ) + + let inQueuePosition: ReferendumStateLocal.InQueuePosition? + + if + status.inQueue, + let queue = trackQueue, + let position = queue.firstIndex(where: { $0.referendum == index }) { + inQueuePosition = .init(index: position, total: queue.count) + } else { + inQueuePosition = nil + } + + let preparing = ReferendumStateLocal.Preparing( + track: localTrack, + proposal: status.proposal, + voting: .supportAndVotes(votes), + deposit: status.decisionDeposit?.amount, + since: status.submitted, + preparingPeriod: track.preparePeriod, + timeoutPeriod: additionalInfo.undecidingTimeout, + inQueue: status.inQueue, + inQueuePosition: inQueuePosition + ) + + return .preparing(model: preparing) + } + + private func createOngoingReferendumState( + from status: ReferendumInfo.OngoingStatus, + index: Referenda.ReferendumIndex, + additionalInfo: Gov2OperationFactory.AdditionalInfo, + trackQueue: [Referenda.TrackQueueItem]? + ) -> ReferendumLocal? { + guard let track = additionalInfo.tracks[status.track] else { + return nil + } + + let state: ReferendumStateLocal + + if let deciding = status.deciding { + state = createDecidingState( + from: status, + deciding: deciding, + track: track, + additionalInfo: additionalInfo + ) + } else { + state = createPreparingState( + from: status, + index: index, + track: track, + additionalInfo: additionalInfo, + trackQueue: trackQueue + ) + } + + return ReferendumLocal(index: UInt(index), state: state, proposer: status.submissionDeposit.who) + } + + // swiftlint:disable:next function_body_length + func mapRemote( + referendum: ReferendumInfo, + index: Referenda.ReferendumIndex, + additionalInfo: Gov2OperationFactory.AdditionalInfo, + enactmentBlock: BlockNumber?, + inQueueState: [Referenda.TrackId: [Referenda.TrackQueueItem]] + ) -> ReferendumLocal? { + switch referendum { + case let .ongoing(status): + return createOngoingReferendumState( + from: status, + index: index, + additionalInfo: additionalInfo, + trackQueue: inQueueState[status.track] + ) + case let .approved(status): + let state: ReferendumStateLocal + + if let enactmentBlock = enactmentBlock { + let value = ReferendumStateLocal.Approved( + since: status.since, + whenEnactment: enactmentBlock, + deposit: deposit(from: status.submissionDeposit, decision: status.decisionDeposit) + ) + state = .approved(model: value) + } else { + state = .executed + } + + return ReferendumLocal( + index: UInt(index), + state: state, + proposer: status.submissionDeposit.who + ) + case let .rejected(status): + let value = notApproved( + from: status.since, + submission: status.submissionDeposit, + decision: status.decisionDeposit + ) + + return ReferendumLocal( + index: UInt(index), + state: .rejected(model: value), + proposer: status.submissionDeposit.who + ) + case let .timedOut(status): + let value = notApproved( + from: status.since, + submission: status.submissionDeposit, + decision: status.decisionDeposit + ) + + return ReferendumLocal( + index: UInt(index), + state: .timedOut(model: value), + proposer: status.submissionDeposit.who + ) + case let .cancelled(status): + let value = notApproved( + from: status.since, + submission: status.submissionDeposit, + decision: status.decisionDeposit + ) + + return ReferendumLocal( + index: UInt(index), + state: .cancelled(model: value), + proposer: status.submissionDeposit.who + ) + case let .killed(atBlock): + return ReferendumLocal(index: UInt(index), state: .killed(atBlock: atBlock), proposer: nil) + case .unknown: + return nil + } + } + + private func deposit(from submission: Referenda.Deposit, decision: Referenda.Deposit?) -> BigUInt { + submission.amount + (decision?.amount ?? 0) + } + + private func notApproved( + from atBlock: BlockNumber, + submission: Referenda.Deposit, + decision: Referenda.Deposit? + ) -> ReferendumStateLocal.NotApproved { + let deposit = deposit(from: submission, decision: decision) + return .init(atBlock: atBlock, deposit: deposit) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2OperationFactory+Protocol.swift b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2OperationFactory+Protocol.swift new file mode 100644 index 0000000000..3e92debd20 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2OperationFactory+Protocol.swift @@ -0,0 +1,241 @@ +import Foundation +import SubstrateSdk +import RobinHood +import BigInt + +extension Gov2OperationFactory: ReferendumsOperationFactoryProtocol { + func fetchAllReferendumsWrapper( + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol + ) -> CompoundOperationWrapper<[ReferendumLocal]> { + let request = UnkeyedRemoteStorageRequest(storagePath: Referenda.referendumInfo) + + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let referendumWrapper: CompoundOperationWrapper<[ReferendumIndexKey: ReferendumInfo]> = + requestFactory.queryByPrefix( + engine: connection, + request: request, + storagePath: request.storagePath, + factory: { try codingFactoryOperation.extractNoCancellableResultData() } + ) + + referendumWrapper.addDependency(operations: [codingFactoryOperation]) + + let additionalInfoWrapper = createAdditionalInfoWrapper( + from: connection, + runtimeProvider: runtimeProvider, + blockHash: nil + ) + + let enactmentsWrapper = createEnacmentTimeFetchWrapper( + dependingOn: referendumWrapper.targetOperation, + connection: connection, + runtimeProvider: runtimeProvider, + blockHash: nil + ) + + enactmentsWrapper.addDependency(wrapper: referendumWrapper) + + let inQueueStateWrapper = createTrackQueueOperation( + dependingOn: referendumWrapper.targetOperation, + connection: connection, + runtimeProvider: runtimeProvider, + requestFactory: requestFactory + ) + + inQueueStateWrapper.addDependency(operations: [referendumWrapper.targetOperation]) + + let mapOperation = createReferendumMapOperation( + dependingOn: referendumWrapper.targetOperation, + additionalInfoOperation: additionalInfoWrapper.targetOperation, + enactmentsOperation: enactmentsWrapper.targetOperation, + inQueueOperation: inQueueStateWrapper.targetOperation + ) + + mapOperation.addDependency(referendumWrapper.targetOperation) + mapOperation.addDependency(additionalInfoWrapper.targetOperation) + mapOperation.addDependency(enactmentsWrapper.targetOperation) + mapOperation.addDependency(inQueueStateWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + referendumWrapper.allOperations + + additionalInfoWrapper.allOperations + inQueueStateWrapper.allOperations + enactmentsWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mapOperation, dependencies: dependencies) + } + + func fetchReferendumWrapper( + for remoteReferendum: ReferendumInfo, + index: ReferendumIdLocal, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper { + let additionalInfoWrapper = createAdditionalInfoWrapper( + from: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + let referendumOperation = ClosureOperation<[ReferendumIndexKey: ReferendumInfo]> { + let referendumIndexKey = ReferendumIndexKey(referendumIndex: Referenda.ReferendumIndex(index)) + return [referendumIndexKey: remoteReferendum] + } + + let enactmentsWrapper = createEnacmentTimeFetchWrapper( + dependingOn: referendumOperation, + connection: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + enactmentsWrapper.addDependency(operations: [referendumOperation]) + + let inQueueStateWrapper = createTrackQueueOperation( + dependingOn: referendumOperation, + connection: connection, + runtimeProvider: runtimeProvider, + requestFactory: requestFactory + ) + + inQueueStateWrapper.addDependency(operations: [referendumOperation]) + + let mergeOperation = createReferendumMapOperation( + dependingOn: referendumOperation, + additionalInfoOperation: additionalInfoWrapper.targetOperation, + enactmentsOperation: enactmentsWrapper.targetOperation, + inQueueOperation: inQueueStateWrapper.targetOperation + ) + + mergeOperation.addDependency(referendumOperation) + mergeOperation.addDependency(additionalInfoWrapper.targetOperation) + mergeOperation.addDependency(enactmentsWrapper.targetOperation) + mergeOperation.addDependency(inQueueStateWrapper.targetOperation) + + let mapOperation = ClosureOperation { + guard let referendum = try mergeOperation.extractNoCancellableResultData().first else { + throw BaseOperationError.unexpectedDependentResult + } + + return referendum + } + + mapOperation.addDependency(mergeOperation) + + let dependencies = [referendumOperation] + additionalInfoWrapper.allOperations + + enactmentsWrapper.allOperations + inQueueStateWrapper.allOperations + [mergeOperation] + + return CompoundOperationWrapper(targetOperation: mapOperation, dependencies: dependencies) + } + + func fetchAccountVotesWrapper( + for accountId: AccountId, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let request = MapRemoteStorageRequest(storagePath: ConvictionVoting.votingFor) { + BytesCodable(wrappedValue: accountId) + } + + let votesWrapper: CompoundOperationWrapper<[ConvictionVoting.VotingForKey: ConvictionVoting.Voting]> = + requestFactory.queryByPrefix( + engine: connection, + request: request, + storagePath: ConvictionVoting.votingFor, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + at: blockHash + ) + + votesWrapper.addDependency(operations: [codingFactoryOperation]) + + let maxVotesOperation = createMaxVotesOperation(dependingOn: codingFactoryOperation) + maxVotesOperation.addDependency(codingFactoryOperation) + + let mappingOperation = ClosureOperation { + let voting = try votesWrapper.targetOperation.extractNoCancellableResultData() + let maxVotes = try maxVotesOperation.extractNoCancellableResultData() + + let initVotingLocal = ReferendumAccountVotingDistribution(maxVotesPerTrack: maxVotes) + + return voting.reduce(initVotingLocal) { resultVoting, votingKeyValue in + let voting = votingKeyValue.value + let track = TrackIdLocal(votingKeyValue.key.trackId) + switch voting { + case let .casting(castingVoting): + return castingVoting.votes.reduce(resultVoting) { result, vote in + let newResult = result.addingReferendum(ReferendumIdLocal(vote.pollIndex), track: track) + + guard let localVote = ReferendumAccountVoteLocal(accountVote: vote.accountVote) else { + return newResult + } + + return newResult.addingVote(localVote, referendumId: ReferendumIdLocal(vote.pollIndex)) + }.addingPriorLock(castingVoting.prior, track: track) + case let .delegating(delegatingVoting): + let delegatingLocal = ReferendumDelegatingLocal(remote: delegatingVoting) + return resultVoting.addingDelegating(delegatingLocal, trackId: track) + case .unknown: + return resultVoting + } + } + } + + mappingOperation.addDependency(votesWrapper.targetOperation) + mappingOperation.addDependency(maxVotesOperation) + + let dependencies = [codingFactoryOperation, maxVotesOperation] + votesWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: dependencies) + } + + func fetchVotersWrapper( + for referendumIndex: ReferendumIdLocal, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol + ) -> CompoundOperationWrapper<[ReferendumVoterLocal]> { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let request = UnkeyedRemoteStorageRequest(storagePath: ConvictionVoting.votingFor) + + let votesWrapper: CompoundOperationWrapper<[ConvictionVoting.VotingForKey: ConvictionVoting.Voting]> = + requestFactory.queryByPrefix( + engine: connection, + request: request, + storagePath: ConvictionVoting.votingFor, + factory: { try codingFactoryOperation.extractNoCancellableResultData() } + ) + + votesWrapper.addDependency(operations: [codingFactoryOperation]) + + let mappingOperation = ClosureOperation<[ReferendumVoterLocal]> { + let votesResult = try votesWrapper.targetOperation.extractNoCancellableResultData() + + return votesResult.compactMap { keyValue in + let accountId = keyValue.key.accountId + let voting = keyValue.value + + switch voting { + case let .casting(castingVoting): + guard + let vote = castingVoting.votes.first(where: { $0.pollIndex == referendumIndex }), + let accountVote = ReferendumAccountVoteLocal(accountVote: vote.accountVote) else { + return nil + } + + return ReferendumVoterLocal(accountId: accountId, vote: accountVote) + case .delegating, .unknown: + return nil + } + } + } + + mappingOperation.addDependency(votesWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + votesWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: dependencies) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2OperationFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2OperationFactory.swift new file mode 100644 index 0000000000..ee56e89536 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Fetch/Gov2OperationFactory.swift @@ -0,0 +1,266 @@ +import Foundation +import SubstrateSdk +import RobinHood +import BigInt + +final class Gov2OperationFactory { + struct AdditionalInfo { + let tracks: [Referenda.TrackId: Referenda.TrackInfo] + let totalIssuance: BigUInt + let undecidingTimeout: Moment + } + + struct SchedulerTaskName: Encodable { + let index: Referenda.ReferendumIndex + + func encode(to encoder: Encoder) throws { + let scaleEncoder = ScaleEncoder() + "assembly".data(using: .utf8).map { scaleEncoder.appendRaw(data: $0) } + try "enactment".encode(scaleEncoder: scaleEncoder) + try index.encode(scaleEncoder: scaleEncoder) + + let data = try scaleEncoder.encode().blake2b32() + + var container = encoder.singleValueContainer() + try container.encode(BytesCodable(wrappedValue: data)) + } + } + + let requestFactory: StorageRequestFactoryProtocol + let operationQueue: OperationQueue + + init(requestFactory: StorageRequestFactoryProtocol, operationQueue: OperationQueue) { + self.requestFactory = requestFactory + self.operationQueue = operationQueue + } + + func createEnacmentTimeFetchWrapper( + dependingOn referendumOperation: BaseOperation<[ReferendumIndexKey: ReferendumInfo]>, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper<[ReferendumIdLocal: BlockNumber]> { + let keysClosure: () throws -> [SchedulerTaskName] = { + let referendums = try referendumOperation.extractNoCancellableResultData() + + return referendums.compactMap { keyValue in + switch keyValue.value { + case .approved: + return SchedulerTaskName(index: keyValue.key.referendumIndex) + default: + return nil + } + } + } + + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let enactmentWrapper: CompoundOperationWrapper<[StorageResponse]> = + requestFactory.queryItems( + engine: connection, + keyParams: keysClosure, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: OnChainScheduler.lookupTaskPath, + at: blockHash + ) + + enactmentWrapper.addDependency(operations: [codingFactoryOperation]) + + let mapOperation = ClosureOperation<[ReferendumIdLocal: BlockNumber]> { + let keys = try keysClosure() + let results = try enactmentWrapper.targetOperation.extractNoCancellableResultData() + + return zip(keys, results).reduce(into: [ReferendumIdLocal: BlockNumber]()) { accum, keyResult in + guard let when = keyResult.1.value?.when else { + return + } + + accum[ReferendumIdLocal(keyResult.0.index)] = when + } + } + + mapOperation.addDependency(enactmentWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + enactmentWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: mapOperation, dependencies: dependencies) + } + + func createReferendumMapOperation( + dependingOn referendumOperation: BaseOperation<[ReferendumIndexKey: ReferendumInfo]>, + additionalInfoOperation: BaseOperation, + enactmentsOperation: BaseOperation<[ReferendumIdLocal: BlockNumber]>, + inQueueOperation: BaseOperation<[Referenda.TrackId: [Referenda.TrackQueueItem]]> + ) -> BaseOperation<[ReferendumLocal]> { + ClosureOperation<[ReferendumLocal]> { + let remoteReferendums = try referendumOperation.extractNoCancellableResultData() + let additionalInfo = try additionalInfoOperation.extractNoCancellableResultData() + let enactments = try enactmentsOperation.extractNoCancellableResultData() + let inQueueState = try inQueueOperation.extractNoCancellableResultData() + + let mappingFactory = Gov2LocalMappingFactory() + + return remoteReferendums.compactMap { keyedReferendum in + let referendumIndex = ReferendumIdLocal(keyedReferendum.key.referendumIndex) + let remoteReferendum = keyedReferendum.value + + return mappingFactory.mapRemote( + referendum: remoteReferendum, + index: Referenda.ReferendumIndex(referendumIndex), + additionalInfo: additionalInfo, + enactmentBlock: enactments[referendumIndex], + inQueueState: inQueueState + ) + } + } + } + + func createAdditionalInfoWrapper( + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let tracksOperation = StorageConstantOperation<[Referenda.Track]>(path: Referenda.tracks) + + tracksOperation.configurationBlock = { + do { + tracksOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + tracksOperation.result = .failure(error) + } + } + + let undecidingTimeoutOperation = PrimitiveConstantOperation(path: Referenda.undecidingTimeout) + + undecidingTimeoutOperation.configurationBlock = { + do { + undecidingTimeoutOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + undecidingTimeoutOperation.result = .failure(error) + } + } + + let totalIssuanceWrapper: CompoundOperationWrapper>> = + requestFactory.queryItem( + engine: connection, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: .totalIssuance, + at: blockHash + ) + + let fetchOperations = [tracksOperation, undecidingTimeoutOperation] + totalIssuanceWrapper.allOperations + fetchOperations.forEach { $0.addDependency(codingFactoryOperation) } + + let mappingOperation = ClosureOperation { + let tracks = try tracksOperation.extractNoCancellableResultData().reduce( + into: [Referenda.TrackId: Referenda.TrackInfo]() + ) { $0[$1.trackId] = $1.info } + + let undecidingTimeout = try undecidingTimeoutOperation.extractNoCancellableResultData() + + let totalIssuance = try totalIssuanceWrapper.targetOperation.extractNoCancellableResultData().value + + return AdditionalInfo( + tracks: tracks, + totalIssuance: totalIssuance?.value ?? 0, + undecidingTimeout: undecidingTimeout + ) + } + + let dependencies = [codingFactoryOperation] + fetchOperations + + fetchOperations.forEach { mappingOperation.addDependency($0) } + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: dependencies) + } + + func createMaxVotesOperation( + dependingOn codingFactoryOperation: BaseOperation + ) -> BaseOperation { + let maxVotesOperation = PrimitiveConstantOperation(path: ConvictionVoting.maxVotes) + maxVotesOperation.configurationBlock = { + do { + maxVotesOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + maxVotesOperation.result = .failure(error) + } + } + + return maxVotesOperation + } + + func createTrackQueueOperation( + dependingOn referendumOperation: BaseOperation<[ReferendumIndexKey: ReferendumInfo]>, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + requestFactory: StorageRequestFactoryProtocol + ) -> CompoundOperationWrapper<[Referenda.TrackId: [Referenda.TrackQueueItem]]> { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let fetchOperation: BaseOperation<[[Referenda.TrackId: [Referenda.TrackQueueItem]]]> = + OperationCombiningService(operationManager: OperationManager(operationQueue: operationQueue)) { + let referendums = try referendumOperation.extractNoCancellableResultData() + + let trackIdsList: [Referenda.TrackId] = referendums.compactMap { keyValue in + let referendum = keyValue.value + + switch referendum { + case let .ongoing(status): + if status.inQueue { + return status.track + } else { + return nil + } + default: + return nil + } + } + + let keyParams = Array(Set(trackIdsList).map { StringScaleMapper(value: $0) }) + + guard !keyParams.isEmpty else { return [] } + + let wrapper: CompoundOperationWrapper<[StorageResponse<[Referenda.TrackQueueItem]>]> = + requestFactory.queryItems( + engine: connection, + keyParams: { keyParams }, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: Referenda.trackQueue + ) + + let mappingOperation = ClosureOperation<[Referenda.TrackId: [Referenda.TrackQueueItem]]> { + let responses = try wrapper.targetOperation.extractNoCancellableResultData() + + let initValue = [Referenda.TrackId: [Referenda.TrackQueueItem]]() + return zip(keyParams, responses).reduce(into: initValue) { accum, trackQueue in + accum[trackQueue.0.value] = trackQueue.1.value + } + } + + mappingOperation.addDependency(wrapper.targetOperation) + + let result = CompoundOperationWrapper( + targetOperation: mappingOperation, + dependencies: wrapper.allOperations + ) + + return [result] + + }.longrunOperation() + + fetchOperation.addDependency(codingFactoryOperation) + + let mappingOperation = ClosureOperation<[Referenda.TrackId: [Referenda.TrackQueueItem]]> { + try fetchOperation.extractNoCancellableResultData().first ?? [:] + } + + mappingOperation.addDependency(fetchOperation) + + return CompoundOperationWrapper( + targetOperation: mappingOperation, + dependencies: [codingFactoryOperation, fetchOperation] + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/GovernanceExtrinsicFactoryProtocol.swift b/novawallet/Modules/Vote/Governance/Operation/GovernanceExtrinsicFactoryProtocol.swift new file mode 100644 index 0000000000..7e3c993e08 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/GovernanceExtrinsicFactoryProtocol.swift @@ -0,0 +1,16 @@ +import Foundation +import SubstrateSdk + +protocol GovernanceExtrinsicFactoryProtocol { + func vote( + _ vote: ReferendumVoteAction, + referendum: ReferendumIdLocal, + builder: ExtrinsicBuilderProtocol + ) throws -> ExtrinsicBuilderProtocol + + func unlock( + with actions: Set, + accountId: AccountId, + builder: ExtrinsicBuilderProtocol + ) throws -> ExtrinsicBuilderProtocol +} diff --git a/novawallet/Modules/Vote/Governance/Operation/GovernanceOperationProtocols.swift b/novawallet/Modules/Vote/Governance/Operation/GovernanceOperationProtocols.swift new file mode 100644 index 0000000000..792a7480fa --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/GovernanceOperationProtocols.swift @@ -0,0 +1,48 @@ +import Foundation +import SubstrateSdk +import RobinHood + +protocol ReferendumsOperationFactoryProtocol { + func fetchAllReferendumsWrapper( + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol + ) -> CompoundOperationWrapper<[ReferendumLocal]> + + func fetchAccountVotesWrapper( + for accountId: AccountId, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper + + func fetchVotersWrapper( + for referendumIndex: ReferendumIdLocal, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol + ) -> CompoundOperationWrapper<[ReferendumVoterLocal]> +} + +protocol ReferendumActionOperationFactoryProtocol { + func fetchActionWrapper( + for referendum: ReferendumLocal, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol + ) -> CompoundOperationWrapper +} + +protocol GovernanceLockStateFactoryProtocol { + func calculateLockStateDiff( + for trackVotes: ReferendumTracksVotingDistribution, + newVote: ReferendumNewVote?, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper + + func buildUnlockScheduleWrapper( + for tracksVoting: ReferendumTracksVotingDistribution, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Locks/Gov1LockStateFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Locks/Gov1LockStateFactory.swift new file mode 100644 index 0000000000..9374be0cd2 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Locks/Gov1LockStateFactory.swift @@ -0,0 +1,86 @@ +import Foundation +import RobinHood +import SubstrateSdk + +final class Gov1LockStateFactory: GovernanceLockStateFactory { + override func createReferendumsWrapper( + for referendumIds: Set, + connection: JSONRPCEngine, + codingFactoryOperation: BaseOperation, + blockHash: Data? + ) -> CompoundOperationWrapper<[ReferendumIdLocal: GovUnlockReferendumProtocol]> { + let remoteIndexes = Array(referendumIds.map { StringScaleMapper(value: $0) }) + + let wrapper: CompoundOperationWrapper<[StorageResponse]> = requestFactory.queryItems( + engine: connection, + keyParams: { remoteIndexes }, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: Democracy.referendumInfo, + at: blockHash + ) + + let mappingOperation = ClosureOperation<[ReferendumIdLocal: GovUnlockReferendumProtocol]> { + let responses = try wrapper.targetOperation.extractNoCancellableResultData() + + let initAccum = [ReferendumIdLocal: GovUnlockReferendumProtocol]() + return zip(remoteIndexes, responses).reduce(into: initAccum) { accum, pair in + accum[pair.0.value] = pair.1.value.map { Gov1UnlockReferendum(referendum: $0) } + } + } + + mappingOperation.addDependency(wrapper.targetOperation) + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: wrapper.allOperations) + } + + override func createAdditionalInfoWrapper( + dependingOn codingFactoryOperation: BaseOperation + ) -> CompoundOperationWrapper { + let lockingPeriodOperation = PrimitiveConstantOperation(path: Democracy.voteLockingPeriod) + + lockingPeriodOperation.configurationBlock = { + do { + lockingPeriodOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + lockingPeriodOperation.result = .failure(error) + } + } + + lockingPeriodOperation.configurationBlock = { + do { + lockingPeriodOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + lockingPeriodOperation.result = .failure(error) + } + } + + let votingPeriodOperation = PrimitiveConstantOperation(path: Democracy.votingPeriod) + + votingPeriodOperation.configurationBlock = { + do { + votingPeriodOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + votingPeriodOperation.result = .failure(error) + } + } + + let mappingOperation = ClosureOperation { + let lockingPeriod = try lockingPeriodOperation.extractNoCancellableResultData() + let votingPeriod = try votingPeriodOperation.extractNoCancellableResultData() + + return GovUnlockCalculationInfo( + decisionPeriods: [Gov1OperationFactory.trackId: votingPeriod], + undecidingTimeout: 0, + voteLockingPeriod: lockingPeriod + ) + } + + mappingOperation.addDependency(lockingPeriodOperation) + mappingOperation.addDependency(votingPeriodOperation) + + return CompoundOperationWrapper( + targetOperation: mappingOperation, + dependencies: [lockingPeriodOperation, votingPeriodOperation] + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Locks/Gov1UnlockReferendum.swift b/novawallet/Modules/Vote/Governance/Operation/Locks/Gov1UnlockReferendum.swift new file mode 100644 index 0000000000..43bbd45530 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Locks/Gov1UnlockReferendum.swift @@ -0,0 +1,37 @@ +import Foundation + +final class Gov1UnlockReferendum { + let referendum: Democracy.ReferendumInfo + + init(referendum: Democracy.ReferendumInfo) { + self.referendum = referendum + } +} + +extension Gov1UnlockReferendum: GovUnlockReferendumProtocol { + func estimateVoteLockingPeriod( + for accountVote: ReferendumAccountVoteLocal, + additionalInfo: GovUnlockCalculationInfo + ) throws -> BlockNumber? { + let conviction = accountVote.convictionValue + + guard let convictionPeriod = conviction.conviction(for: additionalInfo.voteLockingPeriod) else { + throw CommonError.dataCorruption + } + + switch referendum { + case let .ongoing(status): + return status.end + convictionPeriod + case let .finished(status): + if status.approved, accountVote.hasAyeVotes { + return status.end + convictionPeriod + } else if !status.approved, accountVote.hasNayVotes { + return status.end + convictionPeriod + } else { + return nil + } + case .unknown: + return nil + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Locks/Gov2LockStateFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Locks/Gov2LockStateFactory.swift new file mode 100644 index 0000000000..1126c06e4a --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Locks/Gov2LockStateFactory.swift @@ -0,0 +1,92 @@ +import Foundation +import RobinHood +import SubstrateSdk + +final class Gov2LockStateFactory: GovernanceLockStateFactory { + override func createReferendumsWrapper( + for referendumIds: Set, + connection: JSONRPCEngine, + codingFactoryOperation: BaseOperation, + blockHash: Data? + ) -> CompoundOperationWrapper<[ReferendumIdLocal: GovUnlockReferendumProtocol]> { + let remoteIndexes = Array(referendumIds.map { StringScaleMapper(value: $0) }) + + let wrapper: CompoundOperationWrapper<[StorageResponse]> = requestFactory.queryItems( + engine: connection, + keyParams: { remoteIndexes }, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: Referenda.referendumInfo, + at: blockHash + ) + + let mappingOperation = ClosureOperation<[ReferendumIdLocal: GovUnlockReferendumProtocol]> { + let responses = try wrapper.targetOperation.extractNoCancellableResultData() + + let initAccum = [ReferendumIdLocal: GovUnlockReferendumProtocol]() + return zip(remoteIndexes, responses).reduce(into: initAccum) { accum, pair in + accum[pair.0.value] = pair.1.value.map { Gov2UnlockReferendum(referendumInfo: $0) } + } + } + + mappingOperation.addDependency(wrapper.targetOperation) + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: wrapper.allOperations) + } + + override func createAdditionalInfoWrapper( + dependingOn codingFactoryOperation: BaseOperation + ) -> CompoundOperationWrapper { + let tracksOperation = StorageConstantOperation<[Referenda.Track]>(path: Referenda.tracks) + + tracksOperation.configurationBlock = { + do { + tracksOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + tracksOperation.result = .failure(error) + } + } + + let undecidingTimeoutOperation = PrimitiveConstantOperation(path: Referenda.undecidingTimeout) + + undecidingTimeoutOperation.configurationBlock = { + do { + undecidingTimeoutOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + undecidingTimeoutOperation.result = .failure(error) + } + } + + let lockingPeriodOperation = PrimitiveConstantOperation(path: ConvictionVoting.voteLockingPeriodPath) + + lockingPeriodOperation.configurationBlock = { + do { + lockingPeriodOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + lockingPeriodOperation.result = .failure(error) + } + } + + let fetchOperations = [tracksOperation, undecidingTimeoutOperation, lockingPeriodOperation] + fetchOperations.forEach { $0.addDependency(codingFactoryOperation) } + + let mappingOperation = ClosureOperation { + let decisionPeriods = try tracksOperation.extractNoCancellableResultData().reduce( + into: [Referenda.TrackId: Moment]() + ) { $0[$1.trackId] = $1.info.decisionPeriod } + + let undecidingTimeout = try undecidingTimeoutOperation.extractNoCancellableResultData() + + let lockingPeriod = try lockingPeriodOperation.extractNoCancellableResultData() + + return GovUnlockCalculationInfo( + decisionPeriods: decisionPeriods, + undecidingTimeout: undecidingTimeout, + voteLockingPeriod: lockingPeriod + ) + } + + fetchOperations.forEach { mappingOperation.addDependency($0) } + + return CompoundOperationWrapper(targetOperation: mappingOperation, dependencies: fetchOperations) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Locks/Gov2UnlockReferendum.swift b/novawallet/Modules/Vote/Governance/Operation/Locks/Gov2UnlockReferendum.swift new file mode 100644 index 0000000000..2209ab9d59 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Locks/Gov2UnlockReferendum.swift @@ -0,0 +1,52 @@ +import Foundation + +final class Gov2UnlockReferendum { + let referendumInfo: ReferendumInfo + + init(referendumInfo: ReferendumInfo) { + self.referendumInfo = referendumInfo + } +} + +extension Gov2UnlockReferendum: GovUnlockReferendumProtocol { + func estimateVoteLockingPeriod( + for accountVote: ReferendumAccountVoteLocal, + additionalInfo: GovUnlockCalculationInfo + ) throws -> BlockNumber? { + let conviction = accountVote.convictionValue + + guard let convictionPeriod = conviction.conviction(for: additionalInfo.voteLockingPeriod) else { + throw CommonError.dataCorruption + } + + switch referendumInfo { + case let .ongoing(ongoingStatus): + guard let decisionPeriod = additionalInfo.decisionPeriods[ongoingStatus.track] else { + return nil + } + + if let decidingSince = ongoingStatus.deciding?.since { + return decidingSince + decisionPeriod + convictionPeriod + } else { + return ongoingStatus.submitted + additionalInfo.undecidingTimeout + + decisionPeriod + convictionPeriod + } + case let .approved(completedStatus): + if accountVote.hasAyeVotes { + return completedStatus.since + convictionPeriod + } else { + return nil + } + case let .rejected(completedStatus): + if accountVote.hasNayVotes { + return completedStatus.since + convictionPeriod + } else { + return nil + } + case .killed, .timedOut, .cancelled: + return nil + case .unknown: + throw CommonError.dataCorruption + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Locks/GovUnlocksCalculator.swift b/novawallet/Modules/Vote/Governance/Operation/Locks/GovUnlocksCalculator.swift new file mode 100644 index 0000000000..5e681ee501 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Locks/GovUnlocksCalculator.swift @@ -0,0 +1,287 @@ +import Foundation +import BigInt + +/** + * Given the information about Voting (priors + active votes), statuses of referenda and track locks + * Constructs the estimated claiming schedule. + * The schedule is exact when all involved referenda are completed. Only ongoing referenda' end time is estimateted + * + * The claiming schedule shows how much tokens will be unlocked and when. + * Schedule may consist of zero or more [GovernanceUnlockSchedule.Item] with corresponding actions to do. + * + * The algorithm itself consists of several parts + * + * 1. Determine individual unlocks + * This step is based on prior [ConvictionVoting.PriorLock], [ConvictionVoting.AccountVote], + * [ConvictionVoting.Delegating] + * a. Each non-zero prior (both from casting and delegating) has a single individual unlock + * b. Each non-zero vote has a single individual unlock. + * However, unlock time for votes is at least unlock time of corresponding prior. + * c. Find a gap between [voting] and [trackLocks], which indicates an extra claimable amount + * To provide additive effect of gap, we add total voting lock on top of it: + * if [voting] has some pending locks - they gonna delay their amount but always leaving + * trackGap untouched & claimable. + * On the other hand, if other tracks have locks bigger than [voting]'s total lock, + * trackGap will be partially or full delayed by them + * + * During this step we also determine the set of [GovernanceUnlockSchedule.Action] + * + * 2. Combine all locks with the same unlock time into single lock + * a. Result's amount is the maximum between combined locks + * b. Result's affects is a concatenation of all affects from combined locks + * + * 3. Construct preliminary unlock schedule based on the following algorithm + * a. Sort pairs from step (2) by descending [GovernanceUnlockSchedule.Item.unlockAt] order; + * b. For each item in the sorted list, find the difference between the biggest currently + * processed lock and item's amount; + * c. Since we start from the most far locks in the future, finding a positive difference means that + * this difference is actually an entry in desired unlock schedule. Negative difference means that this unlock is + * completely covered by future's unlock with bigger amount. + * Thus, we should discard it from the schedule and move its affects to the currently known maximum lock + * in order to not to loose its actions when unlocking maximum lock. + * + * 4. To find which unlocks are claimable one should call [GovernanceUnlockSchedule.availableItem(at:)] + * function by providing current block number; + */ +final class GovUnlocksCalculator { + private func createUnlocksFromVotes( + _ votes: [ReferendumIdLocal: ReferendumAccountVoteLocal], + referendums: [ReferendumIdLocal: GovUnlockReferendumProtocol], + tracks: [ReferendumIdLocal: TrackIdLocal], + additionalInfo: GovUnlockCalculationInfo + ) -> [TrackIdLocal: [GovernanceUnlockSchedule.Item]] { + let initial = [TrackIdLocal: [GovernanceUnlockSchedule.Item]]() + + return votes.reduce(into: initial) { accum, voteKeyValue in + let referendumId = voteKeyValue.key + let vote = voteKeyValue.value + + guard let referendum = referendums[referendumId], let trackId = tracks[referendumId] else { + return + } + + do { + let unlockAt = try referendum.estimateVoteLockingPeriod( + for: vote, + additionalInfo: additionalInfo + ) ?? 0 + + let unvoteAction = GovernanceUnlockSchedule.Action.unvote(track: trackId, index: referendumId) + let unlockAction = GovernanceUnlockSchedule.Action.unlock(track: trackId) + + let unlock = GovernanceUnlockSchedule.Item( + amount: vote.totalBalance, + unlockAt: unlockAt, + actions: [unvoteAction, unlockAction] + ) + + accum[trackId] = (accum[trackId] ?? []) + [unlock] + } catch { + return + } + } + } + + private func createUnlockFromPrior( + _ prior: ConvictionVoting.PriorLock, + trackId: TrackIdLocal + ) -> GovernanceUnlockSchedule.Item { + let priorUnlockAction = GovernanceUnlockSchedule.Action.unlock(track: trackId) + + return GovernanceUnlockSchedule.Item( + amount: prior.amount, + unlockAt: prior.unlockAt, + actions: [priorUnlockAction] + ) + } + + private func extendUnlocksForVotesWithPriors( + _ unlocks: [TrackIdLocal: [GovernanceUnlockSchedule.Item]], + priors: [TrackIdLocal: ConvictionVoting.PriorLock] + ) -> [TrackIdLocal: [GovernanceUnlockSchedule.Item]] { + priors.reduce(into: unlocks) { accum, keyValue in + let trackId = keyValue.key + let priorLock = keyValue.value + + guard priorLock.exists else { + return + } + + /// one can't unlock voted amount if there is a prior in the track that unlocks later + let items: [GovernanceUnlockSchedule.Item] = (unlocks[trackId] ?? []).map { unlock in + if priorLock.unlockAt > unlock.unlockAt { + return GovernanceUnlockSchedule.Item( + amount: unlock.amount, + unlockAt: priorLock.unlockAt, + actions: unlock.actions + ) + } else { + return unlock + } + } + + /// also add a prior unlock separately + let priorUnlock = createUnlockFromPrior(priorLock, trackId: trackId) + + accum[trackId] = items + [priorUnlock] + } + } + + private func extendUnlocksWithDelegatingPriors( + _ unlocks: [TrackIdLocal: [GovernanceUnlockSchedule.Item]], + delegations: [TrackIdLocal: ReferendumDelegatingLocal] + ) -> [TrackIdLocal: [GovernanceUnlockSchedule.Item]] { + delegations.reduce(into: unlocks) { accum, keyValue in + let trackId = keyValue.key + let priorLock = keyValue.value.prior + + guard priorLock.exists else { + return + } + + let priorUnlock = createUnlockFromPrior(priorLock, trackId: trackId) + + /// one can either vote directly or delegate + accum[trackId] = [priorUnlock] + } + } + + private func extendUnlocksWithFreeTracksLocks( + _ tracksVoting: ReferendumTracksVotingDistribution, + unlocks: [TrackIdLocal: [GovernanceUnlockSchedule.Item]] + ) -> [TrackIdLocal: [GovernanceUnlockSchedule.Item]] { + tracksVoting.trackLocks.reduce(into: unlocks) { accum, trackLock in + let trackId = TrackIdLocal(trackLock.trackId) + let trackLockAmount = trackLock.amount + + let neededLockAmount = tracksVoting.votes.lockedBalance(for: trackId) + + if trackLockAmount > neededLockAmount { + let priorUnlockAction = GovernanceUnlockSchedule.Action.unlock(track: trackId) + + let unlock = GovernanceUnlockSchedule.Item( + amount: trackLockAmount, + unlockAt: 0, + actions: [priorUnlockAction] + ) + + accum[trackId] = (accum[trackId] ?? []) + [unlock] + } + } + } + + private func createVotingUnlocks( + for tracksVoting: ReferendumTracksVotingDistribution, + referendums: [ReferendumIdLocal: GovUnlockReferendumProtocol], + additionalInfo: GovUnlockCalculationInfo + ) -> [TrackIdLocal: [GovernanceUnlockSchedule.Item]] { + let tracks = tracksVoting.votes.tracksByReferendums() + + let voteUnlocksByTrack = createUnlocksFromVotes( + tracksVoting.votes.votes, + referendums: referendums, + tracks: tracks, + additionalInfo: additionalInfo + ) + + let voteUnlocksWithPriors = extendUnlocksForVotesWithPriors( + voteUnlocksByTrack, + priors: tracksVoting.votes.priorLocks + ) + + let unlocksFromVotesAndDelegatings = extendUnlocksWithDelegatingPriors( + voteUnlocksWithPriors, + delegations: tracksVoting.votes.delegatings + ) + + return extendUnlocksWithFreeTracksLocks(tracksVoting, unlocks: unlocksFromVotesAndDelegatings) + } + + private func flattenUnlocksByBlockNumber( + from unlocks: [TrackIdLocal: [GovernanceUnlockSchedule.Item]] + ) -> [GovernanceUnlockSchedule.Item] { + let initial = [BlockNumber: GovernanceUnlockSchedule.Item]() + + let unlocksByBlockNumber = unlocks.reduce(into: initial) { accum, keyValue in + let trackUnlocks = keyValue.value + + for unlock in trackUnlocks { + if let prevUnlock = accum[unlock.unlockAt] { + accum[unlock.unlockAt] = .init( + amount: max(unlock.amount, prevUnlock.amount), + unlockAt: unlock.unlockAt, + actions: prevUnlock.actions.union(unlock.actions) + ) + } else { + accum[unlock.unlockAt] = unlock + } + } + } + + return Array(unlocksByBlockNumber.values) + } + + private func normalizeUnlocks(_ unlocks: [GovernanceUnlockSchedule.Item]) -> [GovernanceUnlockSchedule.Item] { + var sortedByBlockNumber = unlocks.sorted(by: { $0.unlockAt > $1.unlockAt }) + + var optMaxUnlock: (BigUInt, Int)? + for (index, unlock) in sortedByBlockNumber.enumerated() { + if let maxUnlock = optMaxUnlock { + let maxAmount = maxUnlock.0 + let maxIndex = maxUnlock.1 + + if unlock.amount > maxAmount { + /// new max unlock found + optMaxUnlock = (unlock.amount, index) + + /// only part of the amount can be unlocked + sortedByBlockNumber[index] = .init( + amount: unlock.amount - maxAmount, + unlockAt: unlock.unlockAt, + actions: unlock.actions + ) + } else { + /// this unlock can't happen so move actions to future unlock + let prevUnlock = sortedByBlockNumber[maxIndex] + sortedByBlockNumber[maxIndex] = .init( + amount: prevUnlock.amount, + unlockAt: prevUnlock.unlockAt, + actions: prevUnlock.actions.union(unlock.actions) + ) + + sortedByBlockNumber[index] = .init(amount: 0, unlockAt: unlock.unlockAt, actions: []) + } + + } else { + optMaxUnlock = (unlock.amount, index) + } + } + + return Array(sortedByBlockNumber.reversed().filter { !$0.isEmpty }) + } + + private func createSchedule( + from unlocks: [TrackIdLocal: [GovernanceUnlockSchedule.Item]] + ) -> GovernanceUnlockSchedule { + let flattenedByBlockNumber = flattenUnlocksByBlockNumber(from: unlocks) + let items = normalizeUnlocks(flattenedByBlockNumber) + + return .init(items: items) + } +} + +extension GovUnlocksCalculator: GovernanceUnlockCalculatorProtocol { + func createUnlocksSchedule( + for tracksVoting: ReferendumTracksVotingDistribution, + referendums: [ReferendumIdLocal: GovUnlockReferendumProtocol], + additionalInfo: GovUnlockCalculationInfo + ) -> GovernanceUnlockSchedule { + let unlocks = createVotingUnlocks( + for: tracksVoting, + referendums: referendums, + additionalInfo: additionalInfo + ) + + return createSchedule(from: unlocks) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Locks/GovernanceLockStateFactory.swift b/novawallet/Modules/Vote/Governance/Operation/Locks/GovernanceLockStateFactory.swift new file mode 100644 index 0000000000..dffff42abe --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Locks/GovernanceLockStateFactory.swift @@ -0,0 +1,240 @@ +import Foundation +import RobinHood +import SubstrateSdk +import BigInt + +/** + * Class that calculates: + * Locked amount diff - maximum amount of tokens locked before vote is applied and after + * Locked period diff - period of time needed to unlock all the tokens before vote is applied and after. + * + * Locked amount calculation assumes that no unlocks can happen during + * voting (event if voting for the same referendum). So the diff may not decrease. + * + * Locked period is calculated first by maximizing estimation for unlock block of votes (only nonzero amount). + * And then maximizing result between maximum period for votes and prior locks + * (taking into account both casting votes and delegations). + * + * Note that locked period calculation uses an estimation that takes maximum time when voting for particular referendum + * may end. + */ + +class GovernanceLockStateFactory { + let requestFactory: StorageRequestFactoryProtocol + let unlocksCalculator: GovernanceUnlockCalculatorProtocol + + init(requestFactory: StorageRequestFactoryProtocol, unlocksCalculator: GovernanceUnlockCalculatorProtocol) { + self.requestFactory = requestFactory + self.unlocksCalculator = unlocksCalculator + } + + func createReferendumsWrapper( + for _: Set, + connection _: JSONRPCEngine, + codingFactoryOperation _: BaseOperation, + blockHash _: Data? + ) -> CompoundOperationWrapper<[ReferendumIdLocal: GovUnlockReferendumProtocol]> { + fatalError("Child class must implement this method") + } + + func createAdditionalInfoWrapper( + dependingOn _: BaseOperation + ) -> CompoundOperationWrapper { + fatalError("Child class must implement this method") + } + + func calculatePriorLockMax(from trackVotes: ReferendumTracksVotingDistribution) -> BlockNumber? { + let optCastingMax = trackVotes.votes.priorLocks.values + .filter { $0.exists } + .map(\.unlockAt) + .max() + + let optDelegatingMax = trackVotes.votes.delegatings.values + .compactMap { $0.prior.exists ? $0.prior.unlockAt : nil } + .max() + + if let castingMax = optCastingMax, let delegatingMax = optDelegatingMax { + return max(castingMax, delegatingMax) + } else if let castingMax = optCastingMax { + return castingMax + } else { + return optDelegatingMax + } + } + + func calculateMaxLock( + for referendums: [ReferendumIdLocal: GovUnlockReferendumProtocol], + trackVotes: ReferendumTracksVotingDistribution, + additions: GovUnlockCalculationInfo + ) -> BlockNumber? { + let optVotesMax: Moment? = referendums.compactMap { referendumKeyValue in + let referendumIndex = referendumKeyValue.key + let referendum = referendumKeyValue.value + + let accountVoting = trackVotes.votes + guard let vote = accountVoting.votes[referendumIndex] else { + return nil + } + + return try? referendum.estimateVoteLockingPeriod( + for: vote, + additionalInfo: additions + ) + }.max() + + let optPriorMax = calculatePriorLockMax(from: trackVotes) + + if let votesMax = optVotesMax, let priorMax = optPriorMax { + return max(votesMax, priorMax) + } else if let votesMax = optVotesMax { + return votesMax + } else { + return optPriorMax + } + } + + func createStateDiffOperation( + for trackVotes: ReferendumTracksVotingDistribution, + newVote: ReferendumNewVote?, + referendumsOperation: BaseOperation<[ReferendumIdLocal: GovUnlockReferendumProtocol]>, + additionalInfoOperation: BaseOperation + ) -> BaseOperation { + ClosureOperation { + let referendums = try referendumsOperation.extractNoCancellableResultData() + let additions = try additionalInfoOperation.extractNoCancellableResultData() + + let oldAmount = trackVotes.trackLocks.map(\.amount).max() ?? 0 + + let oldPeriod: Moment? = self.calculateMaxLock( + for: referendums, + trackVotes: trackVotes, + additions: additions + ) + + let oldState = GovernanceLockState(maxLockedAmount: oldAmount, lockedUntil: oldPeriod) + + let newState: GovernanceLockState? + + if let newVote = newVote { + let newAmount = max(oldAmount, newVote.voteAction.amount) + + // as we replacing the vote we can immediately claim previos one so don't take into account + let filteredReferendums = referendums.filter { $0.key != newVote.index } + + let periodWithoutReferendum = self.calculateMaxLock( + for: filteredReferendums, + trackVotes: trackVotes, + additions: additions + ) + + let newPeriod: Moment? + + if + let referendum = referendums[newVote.index], + let periodWithNewVote = try? referendum.estimateVoteLockingPeriod( + for: newVote.toAccountVote(), + additionalInfo: additions + ) { + newPeriod = periodWithoutReferendum.flatMap { max(periodWithNewVote, $0) } ?? periodWithNewVote + } else { + newPeriod = periodWithoutReferendum + } + + newState = GovernanceLockState(maxLockedAmount: newAmount, lockedUntil: newPeriod) + } else { + newState = nil + } + + return GovernanceLockStateDiff(before: oldState, vote: newVote, after: newState) + } + } +} + +extension GovernanceLockStateFactory: GovernanceLockStateFactoryProtocol { + func calculateLockStateDiff( + for trackVotes: ReferendumTracksVotingDistribution, + newVote: ReferendumNewVote?, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let accountVoting = trackVotes.votes + var allReferendumIds = Set(accountVoting.votes.keys) + + if let newVoteIndex = newVote?.index { + allReferendumIds.insert(newVoteIndex) + } + + let referendumsWrapper = createReferendumsWrapper( + for: allReferendumIds, + connection: connection, + codingFactoryOperation: codingFactoryOperation, + blockHash: blockHash + ) + + let additionalInfoWrapper = createAdditionalInfoWrapper(dependingOn: codingFactoryOperation) + + referendumsWrapper.addDependency(operations: [codingFactoryOperation]) + additionalInfoWrapper.addDependency(operations: [codingFactoryOperation]) + + let calculationOperation = createStateDiffOperation( + for: trackVotes, + newVote: newVote, + referendumsOperation: referendumsWrapper.targetOperation, + additionalInfoOperation: additionalInfoWrapper.targetOperation + ) + + calculationOperation.addDependency(referendumsWrapper.targetOperation) + calculationOperation.addDependency(additionalInfoWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + referendumsWrapper.allOperations + + additionalInfoWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: calculationOperation, dependencies: dependencies) + } + + func buildUnlockScheduleWrapper( + for tracksVoting: ReferendumTracksVotingDistribution, + from connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) -> CompoundOperationWrapper { + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let accountVoting = tracksVoting.votes + let allReferendumIds = Set(accountVoting.votes.keys) + + let referendumsWrapper = createReferendumsWrapper( + for: allReferendumIds, + connection: connection, + codingFactoryOperation: codingFactoryOperation, + blockHash: blockHash + ) + + let additionalInfoWrapper = createAdditionalInfoWrapper(dependingOn: codingFactoryOperation) + + referendumsWrapper.addDependency(operations: [codingFactoryOperation]) + additionalInfoWrapper.addDependency(operations: [codingFactoryOperation]) + + let scheduleOperation = ClosureOperation { + let referendums = try referendumsWrapper.targetOperation.extractNoCancellableResultData() + let additions = try additionalInfoWrapper.targetOperation.extractNoCancellableResultData() + + return self.unlocksCalculator.createUnlocksSchedule( + for: tracksVoting, + referendums: referendums, + additionalInfo: additions + ) + } + + scheduleOperation.addDependency(referendumsWrapper.targetOperation) + scheduleOperation.addDependency(additionalInfoWrapper.targetOperation) + + let dependencies = [codingFactoryOperation] + referendumsWrapper.allOperations + + additionalInfoWrapper.allOperations + + return CompoundOperationWrapper(targetOperation: scheduleOperation, dependencies: dependencies) + } +} diff --git a/novawallet/Modules/Vote/Governance/Operation/Locks/GovernanceUnlocksCalculator.swift b/novawallet/Modules/Vote/Governance/Operation/Locks/GovernanceUnlocksCalculator.swift new file mode 100644 index 0000000000..224828de57 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Operation/Locks/GovernanceUnlocksCalculator.swift @@ -0,0 +1,22 @@ +import Foundation + +struct GovUnlockCalculationInfo { + let decisionPeriods: [Referenda.TrackId: Moment] + let undecidingTimeout: Moment + let voteLockingPeriod: Moment +} + +protocol GovUnlockReferendumProtocol { + func estimateVoteLockingPeriod( + for accountVote: ReferendumAccountVoteLocal, + additionalInfo: GovUnlockCalculationInfo + ) throws -> BlockNumber? +} + +protocol GovernanceUnlockCalculatorProtocol { + func createUnlocksSchedule( + for tracksVoting: ReferendumTracksVotingDistribution, + referendums: [ReferendumIdLocal: GovUnlockReferendumProtocol], + additionalInfo: GovUnlockCalculationInfo + ) -> GovernanceUnlockSchedule +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/Model/ReferendumDetailsInitData.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/Model/ReferendumDetailsInitData.swift new file mode 100644 index 0000000000..a4ce738202 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/Model/ReferendumDetailsInitData.swift @@ -0,0 +1,13 @@ +import Foundation + +struct ReferendumDetailsInitData { + let referendum: ReferendumLocal + let votesResult: CallbackStorageSubscriptionResult? + let blockNumber: BlockNumber? + let blockTime: BlockTime? + let metadata: ReferendumMetadataLocal? + + var accountVotes: ReferendumAccountVoteLocal? { + votesResult?.value?.votes.votes[referendum.index] + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/Model/ReferendumDetailsInteractorError.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/Model/ReferendumDetailsInteractorError.swift new file mode 100644 index 0000000000..20f09d1778 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/Model/ReferendumDetailsInteractorError.swift @@ -0,0 +1,13 @@ +import Foundation + +enum ReferendumDetailsInteractorError: Error { + case referendumFailed(_ internalError: Error) + case actionDetailsFailed(_ internalError: Error) + case accountVotesFailed(_ internalError: Error) + case metadataFailed(_ internalError: Error) + case identitiesFailed(_ internalError: Error) + case priceFailed(_ internalError: Error) + case blockNumberFailed(_ internalError: Error) + case blockTimeFailed(_ internalError: Error) + case dAppsFailed(_ internalError: Error) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsInteractor.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsInteractor.swift new file mode 100644 index 0000000000..5530fe18b2 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsInteractor.swift @@ -0,0 +1,386 @@ +import UIKit +import SubstrateSdk +import RobinHood + +final class ReferendumDetailsInteractor: AnyCancellableCleaning { + weak var presenter: ReferendumDetailsInteractorOutputProtocol? + + private(set) var referendum: ReferendumLocal + private(set) var actionDetails: ReferendumActionLocal? + + let selectedAccount: ChainAccountResponse? + let option: GovernanceSelectedOption + let actionDetailsOperationFactory: ReferendumActionOperationFactoryProtocol + let connection: JSONRPCEngine + let runtimeProvider: RuntimeProviderProtocol + let identityOperationFactory: IdentityOperationFactoryProtocol + let blockTimeService: BlockTimeEstimationServiceProtocol + let blockTimeFactory: BlockTimeOperationFactoryProtocol + let priceLocalSubscriptionFactory: PriceProviderFactoryProtocol + let generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol + let referendumsSubscriptionFactory: GovernanceSubscriptionFactoryProtocol + let govMetadataLocalSubscriptionFactory: GovMetadataLocalSubscriptionFactoryProtocol + let dAppsProvider: AnySingleValueProvider + let operationQueue: OperationQueue + + private var priceProvider: AnySingleValueProvider? + private var metadataProvider: StreamableProvider? + private var blockNumberSubscription: AnyDataProvider? + + private var identitiesCancellable: CancellableCall? + private var actionDetailsCancellable: CancellableCall? + private var blockTimeCancellable: CancellableCall? + private var dAppsCancellable: CancellableCall? + + var chain: ChainModel { + option.chain + } + + init( + referendum: ReferendumLocal, + selectedAccount: ChainAccountResponse?, + option: GovernanceSelectedOption, + actionDetailsOperationFactory: ReferendumActionOperationFactoryProtocol, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockTimeService: BlockTimeEstimationServiceProtocol, + blockTimeFactory: BlockTimeOperationFactoryProtocol, + identityOperationFactory: IdentityOperationFactoryProtocol, + priceLocalSubscriptionFactory: PriceProviderFactoryProtocol, + generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol, + govMetadataLocalSubscriptionFactory: GovMetadataLocalSubscriptionFactoryProtocol, + referendumsSubscriptionFactory: GovernanceSubscriptionFactoryProtocol, + dAppsProvider: AnySingleValueProvider, + currencyManager: CurrencyManagerProtocol, + operationQueue: OperationQueue + ) { + self.referendum = referendum + self.selectedAccount = selectedAccount + self.option = option + self.actionDetailsOperationFactory = actionDetailsOperationFactory + self.connection = connection + self.runtimeProvider = runtimeProvider + self.identityOperationFactory = identityOperationFactory + self.priceLocalSubscriptionFactory = priceLocalSubscriptionFactory + self.generalLocalSubscriptionFactory = generalLocalSubscriptionFactory + self.blockTimeService = blockTimeService + self.blockTimeFactory = blockTimeFactory + self.govMetadataLocalSubscriptionFactory = govMetadataLocalSubscriptionFactory + self.referendumsSubscriptionFactory = referendumsSubscriptionFactory + self.dAppsProvider = dAppsProvider + self.operationQueue = operationQueue + self.currencyManager = currencyManager + } + + deinit { + clear(cancellable: &identitiesCancellable) + clear(cancellable: &actionDetailsCancellable) + clear(cancellable: &blockTimeCancellable) + clear(cancellable: &dAppsCancellable) + + referendumsSubscriptionFactory.unsubscribeFromReferendum(self, referendumIndex: referendum.index) + + if let accountId = selectedAccount?.accountId { + referendumsSubscriptionFactory.unsubscribeFromAccountVotes(self, accountId: accountId) + } + } + + private func subscribeReferendum() { + referendumsSubscriptionFactory.unsubscribeFromReferendum(self, referendumIndex: referendum.index) + + referendumsSubscriptionFactory.subscribeToReferendum( + self, + referendumIndex: referendum.index + ) { [weak self] result in + switch result { + case let .success(referendumResult): + if let referendum = referendumResult.value { + self?.referendum = referendum + self?.presenter?.didReceiveReferendum(referendum) + } + case let .failure(error): + self?.presenter?.didReceiveError(.referendumFailed(error)) + case .none: + break + } + } + } + + private func subscribeAccountVotes() { + guard let accountId = selectedAccount?.accountId else { + presenter?.didReceiveAccountVotes(nil, votingDistribution: nil) + return + } + + referendumsSubscriptionFactory.unsubscribeFromAccountVotes(self, accountId: accountId) + + referendumsSubscriptionFactory.subscribeToAccountVotes( + self, + accountId: accountId + ) { [weak self] result in + switch result { + case let .success(votesResult): + if let votes = votesResult.value?.votes.votes, let referendumId = self?.referendum.index { + self?.presenter?.didReceiveAccountVotes( + votes[referendumId], + votingDistribution: votesResult + ) + } + case let .failure(error): + self?.presenter?.didReceiveError(.accountVotesFailed(error)) + case .none: + break + } + } + } + + private func handleDAppsUpdate(_ updatedDApps: GovernanceDAppList) { + let dApps = updatedDApps.first(where: { $0.chainId == chain.chainId })?.dapps ?? [] + presenter?.didReceiveDApps(dApps) + } + + private func subscribeDApps() { + dAppsProvider.removeObserver(self) + + let options = DataProviderObserverOptions( + alwaysNotifyOnRefresh: false, + waitsInProgressSyncOnAdd: false + ) + + let updateClosure: ([DataProviderChange]) -> Void = { [weak self] changes in + if let result = changes.reduceToLastChange() { + self?.handleDAppsUpdate(result) + } else { + self?.presenter?.didReceiveDApps([]) + } + } + + let failureClosure: (Error) -> Void = { [weak self] error in + self?.presenter?.didReceiveError(.dAppsFailed(error)) + } + + dAppsProvider.addObserver( + self, + deliverOn: .main, + executing: updateClosure, + failing: failureClosure, + options: options + ) + } + + private func provideIdentities(for accountIds: Set) { + clear(cancellable: &identitiesCancellable) + + guard !accountIds.isEmpty else { + presenter?.didReceiveIdentities([:]) + return + } + + let accountIdsClosure: () throws -> [AccountId] = { Array(accountIds) } + + let wrapper = identityOperationFactory.createIdentityWrapper( + for: accountIdsClosure, + engine: connection, + runtimeService: runtimeProvider, + chainFormat: chain.chainFormat + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.identitiesCancellable else { + return + } + + self?.identitiesCancellable = nil + + do { + let identities = try wrapper.targetOperation.extractNoCancellableResultData() + self?.presenter?.didReceiveIdentities(identities) + } catch { + self?.presenter?.didReceiveError(.identitiesFailed(error)) + } + } + } + + identitiesCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + private func provideBlockTime() { + guard blockTimeCancellable == nil else { + return + } + + let wrapper = blockTimeFactory.createBlockTimeOperation( + from: runtimeProvider, + blockTimeEstimationService: blockTimeService + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.blockTimeCancellable else { + return + } + + self?.blockTimeCancellable = nil + + do { + let blockTimeModel = try wrapper.targetOperation.extractNoCancellableResultData() + self?.presenter?.didReceiveBlockTime(blockTimeModel) + } catch { + self?.presenter?.didReceiveError(.blockTimeFailed(error)) + } + } + } + + blockTimeCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + private func updateActionDetails() { + guard actionDetailsCancellable == nil else { + return + } + + let wrapper = actionDetailsOperationFactory.fetchActionWrapper( + for: referendum, + connection: connection, + runtimeProvider: runtimeProvider + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.actionDetailsCancellable else { + return + } + + self?.actionDetailsCancellable = nil + + do { + let actionDetails = try wrapper.targetOperation.extractNoCancellableResultData() + self?.actionDetails = actionDetails + + self?.presenter?.didReceiveActionDetails(actionDetails) + } catch { + self?.presenter?.didReceiveError(.actionDetailsFailed(error)) + } + } + } + + actionDetailsCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + private func makeAccountBasedSubscriptions() { + subscribeAccountVotes() + } + + private func makeSubscriptions() { + if let priceId = chain.utilityAsset()?.priceId { + priceProvider = subscribeToPrice(for: priceId, currency: selectedCurrency) + } + + blockNumberSubscription = subscribeToBlockNumber(for: chain.chainId) + + subscribeReferendum() + + makeAccountBasedSubscriptions() + + metadataProvider = subscribeGovernanceMetadata(for: option, referendumId: referendum.index) + + if metadataProvider == nil { + presenter?.didReceiveMetadata(nil) + } else { + metadataProvider?.refresh() + } + } +} + +extension ReferendumDetailsInteractor: ReferendumDetailsInteractorInputProtocol { + func setup() { + makeSubscriptions() + updateActionDetails() + subscribeDApps() + } + + func remakeDAppsSubscription() { + subscribeDApps() + } + + func refreshBlockTime() { + provideBlockTime() + } + + func refreshActionDetails() { + updateActionDetails() + } + + func refreshIdentities(for accountIds: Set) { + provideIdentities(for: accountIds) + } + + func remakeSubscriptions() { + priceProvider?.removeObserver(self) + priceProvider = nil + + metadataProvider?.removeObserver(self) + metadataProvider = nil + + blockNumberSubscription?.removeObserver(self) + blockNumberSubscription = nil + + makeSubscriptions() + } +} + +extension ReferendumDetailsInteractor: GeneralLocalStorageSubscriber, GeneralLocalStorageHandler { + func handleBlockNumber(result: Result, chainId _: ChainModel.Id) { + switch result { + case let .success(blockNumber): + if let blockNumber = blockNumber { + presenter?.didReceiveBlockNumber(blockNumber) + } + case let .failure(error): + presenter?.didReceiveError(.blockNumberFailed(error)) + } + } +} + +extension ReferendumDetailsInteractor: PriceLocalSubscriptionHandler, PriceLocalStorageSubscriber { + func handlePrice(result: Result, priceId _: AssetModel.PriceId) { + switch result { + case let .success(price): + presenter?.didReceivePrice(price) + case let .failure(error): + presenter?.didReceiveError(.priceFailed(error)) + } + } +} + +extension ReferendumDetailsInteractor: GovMetadataLocalStorageSubscriber, GovMetadataLocalStorageHandler { + func handleGovernanceMetadataDetails( + result: Result, + option _: GovernanceSelectedOption, + referendumId _: ReferendumIdLocal + ) { + switch result { + case let .success(metadata): + presenter?.didReceiveMetadata(metadata) + case let .failure(error): + presenter?.didReceiveError(.metadataFailed(error)) + } + } +} + +extension ReferendumDetailsInteractor: SelectedCurrencyDepending { + func applyCurrency() { + if presenter != nil { + if let priceId = chain.utilityAsset()?.priceId { + priceProvider = subscribeToPrice(for: priceId, currency: selectedCurrency) + } + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsPresenter.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsPresenter.swift new file mode 100644 index 0000000000..d6dfbcb1f8 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsPresenter.swift @@ -0,0 +1,585 @@ +import Foundation +import SoraFoundation +import SubstrateSdk + +final class ReferendumDetailsPresenter { + weak var view: ReferendumDetailsViewProtocol? + let wireframe: ReferendumDetailsWireframeProtocol + let interactor: ReferendumDetailsInteractorInputProtocol + let balanceViewModelFactory: BalanceViewModelFactoryProtocol + let referendumFormatter: LocalizableResource + let referendumViewModelFactory: ReferendumsModelFactoryProtocol + let referendumStringsFactory: ReferendumDisplayStringFactoryProtocol + let referendumTimelineViewModelFactory: ReferendumTimelineViewModelFactoryProtocol + let referendumMetadataViewModelFactory: ReferendumMetadataViewModelFactoryProtocol + let displayAddressViewModelFactory: DisplayAddressViewModelFactoryProtocol + let statusViewModelFactory: ReferendumStatusViewModelFactoryProtocol + let accountManagementFilter: AccountManagementFilterProtocol + let wallet: MetaAccountModel + + let chain: ChainModel + let logger: LoggerProtocol + + private var referendum: ReferendumLocal + private var actionDetails: ReferendumActionLocal? + private var accountVotes: ReferendumAccountVoteLocal? + private var votingDistribution: CallbackStorageSubscriptionResult? + private var referendumMetadata: ReferendumMetadataLocal? + private var identities: [AccountAddress: AccountIdentity]? + private var price: PriceData? + private var blockNumber: BlockNumber? + private var blockTime: BlockTime? + private var dApps: [GovernanceDApps.DApp]? + + private lazy var iconGenerator = PolkadotIconGenerator() + + private var maxStatusTimeInterval: TimeInterval? + private var countdownTimer: CountdownTimer? + private var statusViewModel: StatusTimeViewModel? + + init( + chain: ChainModel, + wallet: MetaAccountModel, + accountManagementFilter: AccountManagementFilterProtocol, + initData: ReferendumDetailsInitData, + interactor: ReferendumDetailsInteractorInputProtocol, + wireframe: ReferendumDetailsWireframeProtocol, + referendumViewModelFactory: ReferendumsModelFactoryProtocol, + balanceViewModelFactory: BalanceViewModelFactoryProtocol, + referendumFormatter: LocalizableResource, + referendumStringsFactory: ReferendumDisplayStringFactoryProtocol, + referendumTimelineViewModelFactory: ReferendumTimelineViewModelFactoryProtocol, + referendumMetadataViewModelFactory: ReferendumMetadataViewModelFactoryProtocol, + statusViewModelFactory: ReferendumStatusViewModelFactoryProtocol, + displayAddressViewModelFactory: DisplayAddressViewModelFactoryProtocol, + localizationManager: LocalizationManagerProtocol, + logger: LoggerProtocol + ) { + self.interactor = interactor + self.wireframe = wireframe + self.wallet = wallet + self.accountManagementFilter = accountManagementFilter + self.referendumViewModelFactory = referendumViewModelFactory + self.referendumStringsFactory = referendumStringsFactory + self.balanceViewModelFactory = balanceViewModelFactory + self.referendumFormatter = referendumFormatter + self.referendumTimelineViewModelFactory = referendumTimelineViewModelFactory + self.referendumMetadataViewModelFactory = referendumMetadataViewModelFactory + self.statusViewModelFactory = statusViewModelFactory + self.displayAddressViewModelFactory = displayAddressViewModelFactory + referendum = initData.referendum + accountVotes = initData.accountVotes + votingDistribution = initData.votesResult + blockNumber = initData.blockNumber + blockTime = initData.blockTime + referendumMetadata = initData.metadata + self.chain = chain + self.logger = logger + self.localizationManager = localizationManager + } + + deinit { + invalidateTimer() + } + + private func provideReferendumInfoViewModel() { + let referendumIndex = referendumFormatter.value(for: selectedLocale).string( + from: referendum.index as NSNumber + ) + + // display track name only if there is more than 1 track in the network + let trackViewModel: ReferendumInfoView.Track? + if let track = referendum.track, track.totalTracksCount > 1 { + trackViewModel = ReferendumTrackType.createViewModel( + from: track.name, + chain: chain, + locale: selectedLocale + ) + } else { + trackViewModel = nil + } + + let viewModel = TrackTagsView.Model(titleIcon: trackViewModel, referendumNumber: referendumIndex) + view?.didReceive(trackTagsModel: viewModel) + } + + private func provideTitleViewModel() { + let accountViewModel: DisplayAddressViewModel? + + let optProposer = referendum.proposer ?? referendumMetadata?.proposerAccountId(for: chain.chainFormat) + + if + let proposer = optProposer, + let identities = identities, + let address = try? proposer.toAddress(using: chain.chainFormat) { + let displayAddress = DisplayAddress(address: address, username: identities[address]?.displayName ?? "") + accountViewModel = displayAddressViewModelFactory.createViewModel(from: displayAddress) + } else { + accountViewModel = nil + } + + let detailsViewModel = referendumMetadataViewModelFactory.createDetailsViewModel( + for: referendum, + metadata: referendumMetadata, + locale: selectedLocale + ) + + let viewModel = ReferendumDetailsTitleView.Model(account: accountViewModel, details: detailsViewModel) + + view?.didReceive(titleModel: viewModel) + } + + private func provideRequestedAmount() { + guard + let requestedAmount = actionDetails?.amountSpendDetails?.amount, + let precision = chain.utilityAssetDisplayInfo()?.assetPrecision, + let decimalAmount = Decimal.fromSubstrateAmount(requestedAmount, precision: precision) else { + view?.didReceive(requestedAmount: nil) + return + } + + let balanceViewModel = balanceViewModelFactory.balanceFromPrice(decimalAmount, priceData: price).value( + for: selectedLocale + ) + + let viewModel: RequestedAmountRow.Model = .init( + title: R.string.localizable.commonRequestedAmount(preferredLanguages: selectedLocale.rLanguages), + amount: .init( + topValue: balanceViewModel.amount, + bottomValue: balanceViewModel.price + ) + ) + + view?.didReceive(requestedAmount: viewModel) + } + + private func provideYourVote() { + if let accountVotes = accountVotes { + let viewModel = referendumStringsFactory.createYourVotesViewModel( + from: accountVotes, + chain: chain, + locale: selectedLocale + ) + + view?.didReceive(yourVoteModel: viewModel) + } else { + view?.didReceive(yourVoteModel: nil) + } + } + + private func provideVotingDetails() { + guard + let blockNumber = blockNumber, + let blockTime = blockTime else { + return + } + + let chainInfo = ReferendumsModelFactoryInput.ChainInformation( + chain: chain, + currentBlock: blockNumber, + blockDuration: blockTime + ) + + let referendumViewModel = referendumViewModelFactory.createViewModel( + from: referendum, + metadata: referendumMetadata, + vote: accountVotes, + chainInfo: chainInfo, + selectedLocale: selectedLocale + ) + + let votingProgress = referendumViewModel.progress + let status: ReferendumVotingStatusView.Model = .init( + status: .init( + name: referendumViewModel.referendumInfo.status.name, + kind: .init(infoKind: referendumViewModel.referendumInfo.status.kind) + ), + time: referendumViewModel.referendumInfo.time.map { .init(titleIcon: $0.titleIcon, isUrgent: $0.isUrgent) }, + title: R.string.localizable.govDetailsVotingStatus(preferredLanguages: selectedLocale.rLanguages) + ) + + let button: String? + + if referendum.canVote { + if accountVotes != nil { + button = R.string.localizable.govRevote(preferredLanguages: selectedLocale.rLanguages) + } else { + button = R.string.localizable.govVote(preferredLanguages: selectedLocale.rLanguages) + } + } else { + button = nil + } + + let votes = referendumStringsFactory.createReferendumVotes( + from: referendum, + chain: chain, + locale: selectedLocale + ) + + let viewModel = ReferendumVotingStatusDetailsView.Model( + status: status, + votingProgress: votingProgress, + aye: votes?.ayes, + nay: votes?.nays, + buttonText: button + ) + + view?.didReceive(votingDetails: viewModel) + } + + private func provideDAppViewModel() { + guard let dApps = dApps else { + view?.didReceive(dAppModels: nil) + return + } + + let viewModels = dApps.map { + ReferendumDAppView.Model( + icon: RemoteImageViewModel(url: $0.icon), + title: $0.title, + subtitle: $0.details + ) + } + + view?.didReceive(dAppModels: viewModels) + } + + private func provideTimelineViewModel() { + guard + let blockNumber = blockNumber, + let blockTime = blockTime else { + view?.didReceive(timelineModel: nil) + return + } + + let timeline = referendumTimelineViewModelFactory.createTimelineViewModel( + for: referendum, + metadata: referendumMetadata, + currentBlock: blockNumber, + blockDuration: blockTime, + locale: selectedLocale + ) + + view?.didReceive(timelineModel: timeline) + } + + private func provideFullDetailsViewModel() { + let shouldHide = actionDetails == nil || referendum.state.completed + view?.didReceive(shouldHideFullDetails: shouldHide) + } + + private func updateView() { + provideReferendumInfoViewModel() + provideTitleViewModel() + provideRequestedAmount() + provideYourVote() + provideVotingDetails() + provideDAppViewModel() + provideTimelineViewModel() + provideFullDetailsViewModel() + } + + private func invalidateTimer() { + countdownTimer?.delegate = nil + countdownTimer?.stop() + countdownTimer = nil + } + + private func updateTimerIfNeeded() { + guard + let blockTime = blockTime, + let blockNumber = blockNumber else { + return + } + + let activeTimeModel = statusViewModelFactory.createTimeViewModel( + for: referendum, + currentBlock: blockNumber, + blockDuration: blockTime, + locale: selectedLocale + ) + + guard let timeInterval = activeTimeModel?.timeInterval else { + invalidateTimer() + view?.didReceive(activeTimeViewModel: activeTimeModel?.viewModel) + return + } + + maxStatusTimeInterval = timeInterval + statusViewModel = activeTimeModel + + countdownTimer = CountdownTimer() + countdownTimer?.delegate = self + countdownTimer?.start(with: timeInterval) + } + + private func updateTimerDisplay() { + guard + let remainedTimeInterval = countdownTimer?.remainedInterval, + let statusViewModel = statusViewModel, + let updatedViewModel = statusViewModel.updateModelClosure(remainedTimeInterval) else { + return + } + + view?.didReceive(activeTimeViewModel: updatedViewModel) + } + + private func refreshIdentities() { + var accountIds: Set = [] + + if let proposer = referendum.proposer { + accountIds.insert(proposer) + } + + if let beneficiary = actionDetails?.amountSpendDetails?.beneficiary.accountId { + accountIds.insert(beneficiary) + } + + if let proposer = referendumMetadata?.proposerAccountId(for: chain.chainFormat) { + accountIds.insert(proposer) + } + + interactor.refreshIdentities(for: accountIds) + } +} + +extension ReferendumDetailsPresenter: ReferendumDetailsPresenterProtocol { + func setup() { + updateView() + + interactor.setup() + } + + func vote() { + guard let view = view else { + return + } + + if wallet.fetch(for: chain.accountRequest()) != nil { + let initData = ReferendumVotingInitData( + votesResult: nil, + blockNumber: blockNumber, + blockTime: blockTime, + referendum: referendum, + lockDiff: nil + ) + + wireframe.showVote(from: view, referendum: referendum, initData: initData) + } else if accountManagementFilter.canAddAccount(to: wallet, chain: chain) { + let message = R.string.localizable.commonChainCrowdloanAccountMissingMessage( + chain.name, + preferredLanguages: selectedLocale.rLanguages + ) + + wireframe.presentAddAccount( + from: view, + chainName: chain.name, + message: message, + locale: selectedLocale + ) { [weak self] in + guard let wallet = self?.wallet else { + return + } + + self?.wireframe.showWalletDetails(from: self?.view, wallet: wallet) + } + } else { + wireframe.presentNoAccountSupport( + from: view, + walletType: wallet.type, + chainName: chain.name, + locale: selectedLocale + ) + } + } + + func showProposerDetails() { + let referendumProposer = try? referendum.proposer?.toAddress(using: chain.chainFormat) + let optAddress = referendumProposer ?? referendumMetadata?.proposer + + guard + let address = optAddress, + let view = view else { + return + } + + wireframe.presentAccountOptions(from: view, address: address, chain: chain, locale: selectedLocale) + } + + func showAyeVoters() { + wireframe.showVoters(from: view, referendum: referendum, type: .ayes) + } + + func showNayVoters() { + wireframe.showVoters(from: view, referendum: referendum, type: .nays) + } + + func opeDApp(at index: Int) { + guard + let dApp = dApps?[index], + let url = try? dApp.extractFullUrl(for: referendum.index) else { + return + } + + wireframe.showDApp(from: view, url: url) + } + + func readFullDescription() { + let viewModel = referendumMetadataViewModelFactory.createDetailsViewModel( + for: referendum, + metadata: referendumMetadata, + locale: selectedLocale + ) + + wireframe.showFullDescription(from: view, title: viewModel.title, description: viewModel.description) + } + + func openFullDetails() { + guard let actionDetails = actionDetails else { + return + } + + wireframe.showFullDetails( + from: view, + referendum: referendum, + actionDetails: actionDetails, + metadata: referendumMetadata, + identities: identities ?? [:] + ) + } + + func openURL(_ url: URL) { + guard let view = view else { + return + } + + wireframe.showWeb(url: url, from: view, style: .automatic) + } +} + +extension ReferendumDetailsPresenter: ReferendumDetailsInteractorOutputProtocol { + func didReceiveReferendum(_ referendum: ReferendumLocal) { + self.referendum = referendum + + provideReferendumInfoViewModel() + provideVotingDetails() + provideTitleViewModel() + updateTimerIfNeeded() + + refreshIdentities() + } + + func didReceiveActionDetails(_ actionDetails: ReferendumActionLocal) { + self.actionDetails = actionDetails + + provideTitleViewModel() + provideRequestedAmount() + provideFullDetailsViewModel() + + refreshIdentities() + } + + func didReceiveAccountVotes( + _ votes: ReferendumAccountVoteLocal?, + votingDistribution: CallbackStorageSubscriptionResult? + ) { + accountVotes = votes + self.votingDistribution = votingDistribution + + provideYourVote() + } + + func didReceiveMetadata(_ referendumMetadata: ReferendumMetadataLocal?) { + self.referendumMetadata = referendumMetadata + + provideTitleViewModel() + provideTimelineViewModel() + provideFullDetailsViewModel() + + refreshIdentities() + } + + func didReceiveIdentities(_ identities: [AccountAddress: AccountIdentity]) { + self.identities = identities + + provideTitleViewModel() + } + + func didReceivePrice(_ price: PriceData?) { + self.price = price + + provideRequestedAmount() + } + + func didReceiveBlockNumber(_ blockNumber: BlockNumber) { + self.blockNumber = blockNumber + + interactor.refreshBlockTime() + + provideVotingDetails() + provideTimelineViewModel() + } + + func didReceiveBlockTime(_ blockTime: BlockTime) { + self.blockTime = blockTime + + provideVotingDetails() + provideTimelineViewModel() + updateTimerIfNeeded() + } + + func didReceiveDApps(_ dApps: [GovernanceDApps.DApp]) { + self.dApps = dApps + + provideDAppViewModel() + } + + func didReceiveError(_ error: ReferendumDetailsInteractorError) { + logger.error("Did receive error: \(error)") + + switch error { + case .referendumFailed, .accountVotesFailed, .priceFailed, .blockNumberFailed, .metadataFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case .actionDetailsFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.refreshActionDetails() + } + case .identitiesFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshIdentities() + } + case .blockTimeFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.refreshBlockTime() + } + case .dAppsFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeDAppsSubscription() + } + } + } +} + +extension ReferendumDetailsPresenter: CountdownTimerDelegate { + func didStart(with _: TimeInterval) { + updateTimerDisplay() + } + + func didCountdown(remainedInterval _: TimeInterval) { + updateTimerDisplay() + } + + func didStop(with _: TimeInterval) { + updateTimerDisplay() + } +} + +extension ReferendumDetailsPresenter: Localizable { + func applyLocalization() { + if let view = view, view.isSetup { + updateView() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsProtocols.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsProtocols.swift new file mode 100644 index 0000000000..e55b4d6a47 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsProtocols.swift @@ -0,0 +1,83 @@ +import Foundation + +protocol ReferendumDetailsViewProtocol: ControllerBackedProtocol { + func didReceive(votingDetails: ReferendumVotingStatusDetailsView.Model) + func didReceive(dAppModels: [ReferendumDAppView.Model]?) + func didReceive(timelineModel: [ReferendumTimelineView.Model]?) + func didReceive(titleModel: ReferendumDetailsTitleView.Model) + func didReceive(yourVoteModel: YourVoteRow.Model?) + func didReceive(requestedAmount: RequestedAmountRow.Model?) + func didReceive(trackTagsModel: TrackTagsView.Model?) + func didReceive(activeTimeViewModel: ReferendumInfoView.Time?) + func didReceive(shouldHideFullDetails: Bool) +} + +protocol ReferendumDetailsPresenterProtocol: AnyObject { + func setup() + func showProposerDetails() + func readFullDescription() + func showAyeVoters() + func showNayVoters() + func opeDApp(at index: Int) + func openFullDetails() + func vote() + func openURL(_ url: URL) +} + +protocol ReferendumDetailsInteractorInputProtocol: AnyObject { + func setup() + func refreshBlockTime() + func refreshActionDetails() + func refreshIdentities(for accountIds: Set) + func remakeDAppsSubscription() + func remakeSubscriptions() +} + +protocol ReferendumDetailsInteractorOutputProtocol: AnyObject { + func didReceiveReferendum(_ referendum: ReferendumLocal) + func didReceiveActionDetails(_ actionDetails: ReferendumActionLocal) + func didReceiveAccountVotes( + _ votes: ReferendumAccountVoteLocal?, + votingDistribution: CallbackStorageSubscriptionResult? + ) + func didReceiveMetadata(_ referendumMetadata: ReferendumMetadataLocal?) + func didReceiveIdentities(_ identities: [AccountAddress: AccountIdentity]) + func didReceivePrice(_ price: PriceData?) + func didReceiveBlockNumber(_ blockNumber: BlockNumber) + func didReceiveBlockTime(_ blockTime: BlockTime) + func didReceiveDApps(_ dApps: [GovernanceDApps.DApp]) + func didReceiveError(_ error: ReferendumDetailsInteractorError) +} + +protocol ReferendumDetailsWireframeProtocol: AlertPresentable, ErrorPresentable, CommonRetryable, + AddressOptionsPresentable, WebPresentable, NoAccountSupportPresentable { + func showFullDetails( + from view: ReferendumDetailsViewProtocol?, + referendum: ReferendumLocal, + actionDetails: ReferendumActionLocal, + metadata: ReferendumMetadataLocal?, + identities: [AccountAddress: AccountIdentity] + ) + + func showVote( + from view: ReferendumDetailsViewProtocol?, + referendum: ReferendumLocal, + initData: ReferendumVotingInitData + ) + + func showVoters( + from view: ReferendumDetailsViewProtocol?, + referendum: ReferendumLocal, + type: ReferendumVotersType + ) + + func showFullDescription( + from view: ReferendumDetailsViewProtocol?, + title: String, + description: String + ) + + func showDApp(from view: ReferendumDetailsViewProtocol?, url: URL) + + func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewController.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewController.swift new file mode 100644 index 0000000000..16d72d1456 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewController.swift @@ -0,0 +1,168 @@ +import UIKit +import SubstrateSdk +import SoraFoundation + +final class ReferendumDetailsViewController: UIViewController, ViewHolder { + typealias RootViewType = ReferendumDetailsViewLayout + + let presenter: ReferendumDetailsPresenterProtocol + let localizationManager: LocalizationManagerProtocol + + private var dAppCells: [ReferendumDAppCellView]? + + init( + presenter: ReferendumDetailsPresenterProtocol, + localizationManager: LocalizationManagerProtocol + ) { + self.presenter = presenter + self.localizationManager = localizationManager + + super.init(nibName: nil, bundle: nil) + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = ReferendumDetailsViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupHandlers() + + presenter.setup() + } + + private func setupHandlers() { + rootView.votingDetailsRow.voteButton.addTarget( + self, + action: #selector(actionVote), + for: .touchUpInside + ) + + rootView.titleView.accountContainerView.addTarget( + self, + action: #selector(actionProposer), + for: .touchUpInside + ) + + rootView.titleView.moreButton.addTarget( + self, + action: #selector(actionFullDescription), + for: .touchUpInside + ) + + rootView.votingDetailsRow.ayeVotesView.addTarget( + self, + action: #selector(actionAyeVotes), + for: .touchUpInside + ) + + rootView.votingDetailsRow.nayVotesView.addTarget( + self, + action: #selector(actionNayVotes), + for: .touchUpInside + ) + + rootView.fullDetailsView.addTarget( + self, + action: #selector(actionFullDetails), + for: .touchUpInside + ) + + rootView.titleView.descriptionView.delegate = self + } + + @objc private func actionVote() { + presenter.vote() + } + + @objc private func actionProposer() { + presenter.showProposerDetails() + } + + @objc private func actionFullDescription() { + presenter.readFullDescription() + } + + @objc private func actionAyeVotes() { + presenter.showAyeVoters() + } + + @objc private func actionNayVotes() { + presenter.showNayVoters() + } + + @objc private func actionDApp(_ sender: UIControl) { + guard + let cell = sender as? ReferendumDAppCellView, + let index = dAppCells?.firstIndex(of: cell) else { + return + } + + presenter.opeDApp(at: index) + } + + @objc private func actionFullDetails() { + presenter.openFullDetails() + } +} + +extension ReferendumDetailsViewController: ReferendumDetailsViewProtocol { + func didReceive(votingDetails: ReferendumVotingStatusDetailsView.Model) { + rootView.votingDetailsRow.bind(viewModel: votingDetails) + } + + func didReceive(dAppModels: [ReferendumDAppView.Model]?) { + let cells = rootView.setDApps(models: dAppModels, locale: localizationManager.selectedLocale) + dAppCells = cells + + cells.forEach { $0.addTarget(self, action: #selector(actionDApp(_:)), for: .touchUpInside) } + } + + func didReceive(timelineModel: [ReferendumTimelineView.Model]?) { + rootView.setTimeline(model: timelineModel, locale: localizationManager.selectedLocale) + } + + func didReceive(titleModel: ReferendumDetailsTitleView.Model) { + rootView.titleView.bind(viewModel: titleModel, locale: localizationManager.selectedLocale) + + rootView.setNeedsLayout() + } + + func didReceive(yourVoteModel: YourVoteRow.Model?) { + rootView.setYourVote(model: yourVoteModel) + } + + func didReceive(requestedAmount: RequestedAmountRow.Model?) { + rootView.setRequestedAmount(model: requestedAmount) + } + + func didReceive(trackTagsModel: TrackTagsView.Model?) { + let barButtonItem: UIBarButtonItem? = trackTagsModel.map { + let trackTagsView = TrackTagsView() + trackTagsView.bind(viewModel: $0) + return .init(customView: trackTagsView) + } + navigationItem.setRightBarButton(barButtonItem, animated: true) + } + + func didReceive(shouldHideFullDetails: Bool) { + rootView.setFullDetails(hidden: shouldHideFullDetails, locale: localizationManager.selectedLocale) + } + + func didReceive(activeTimeViewModel: ReferendumInfoView.Time?) { + rootView.votingDetailsRow.statusView.bind(timeModel: activeTimeViewModel) + rootView.timelineView.bind(activeTimeViewModel: activeTimeViewModel) + } +} + +extension ReferendumDetailsViewController: MarkdownViewContainerDelegate { + func markdownView(_: MarkdownViewContainer, asksHandle url: URL) { + presenter.openURL(url) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewFactory.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewFactory.swift new file mode 100644 index 0000000000..096dc8164e --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewFactory.swift @@ -0,0 +1,164 @@ +import Foundation +import SubstrateSdk +import RobinHood +import SoraFoundation + +struct ReferendumDetailsViewFactory { + static func createView( + for state: GovernanceSharedState, + initData: ReferendumDetailsInitData + ) -> ReferendumDetailsViewProtocol? { + guard + let currencyManager = CurrencyManager.shared, + let interactor = createInteractor( + for: initData.referendum, + currencyManager: currencyManager, + state: state + ) else { + return nil + } + + let wireframe = ReferendumDetailsWireframe(state: state) + + guard + let presenter = createPresenter( + interactor: interactor, + wireframe: wireframe, + currencyManager: currencyManager, + state: state, + initData: initData + ) else { + return nil + } + + let view = ReferendumDetailsViewController( + presenter: presenter, + localizationManager: LocalizationManager.shared + ) + + presenter.view = view + interactor.presenter = presenter + + return view + } + + private static func createPresenter( + interactor: ReferendumDetailsInteractor, + wireframe: ReferendumDetailsWireframe, + currencyManager: CurrencyManagerProtocol, + state: GovernanceSharedState, + initData: ReferendumDetailsInitData + ) -> ReferendumDetailsPresenter? { + guard + let chain = state.settings.value?.chain, + let assetInfo = chain.utilityAssetDisplayInfo(), + let wallet = SelectedWalletSettings.shared.value else { + return nil + } + + let balanceViewModelFactory = BalanceViewModelFactory( + targetAssetInfo: assetInfo, + priceAssetInfoFactory: PriceAssetInfoFactory(currencyManager: currencyManager) + ) + + let statusViewModelFactory = ReferendumStatusViewModelFactory() + + let indexFormatter = NumberFormatter.index.localizableResource() + let referendumViewModelFactory = ReferendumsModelFactory( + referendumMetadataViewModelFactory: ReferendumMetadataViewModelFactory(indexFormatter: indexFormatter), + statusViewModelFactory: statusViewModelFactory, + assetBalanceFormatterFactory: AssetBalanceFormatterFactory(), + percentFormatter: NumberFormatter.referendumPercent.localizableResource(), + indexFormatter: indexFormatter, + quantityFormatter: NumberFormatter.quantity.localizableResource() + ) + + let referendumStringFactory = ReferendumDisplayStringFactory() + let timelineViewModelFactory = ReferendumTimelineViewModelFactory( + statusViewModelFactory: statusViewModelFactory, + timeFormatter: DateFormatter.shortDateAndTime + ) + + let metadataViewModelFactory = ReferendumMetadataViewModelFactory(indexFormatter: indexFormatter) + + return ReferendumDetailsPresenter( + chain: chain, + wallet: wallet, + accountManagementFilter: AccountManagementFilter(), + initData: initData, + interactor: interactor, + wireframe: wireframe, + referendumViewModelFactory: referendumViewModelFactory, + balanceViewModelFactory: balanceViewModelFactory, + referendumFormatter: indexFormatter, + referendumStringsFactory: referendumStringFactory, + referendumTimelineViewModelFactory: timelineViewModelFactory, + referendumMetadataViewModelFactory: metadataViewModelFactory, + statusViewModelFactory: statusViewModelFactory, + displayAddressViewModelFactory: DisplayAddressViewModelFactory(), + localizationManager: LocalizationManager.shared, + logger: Logger.shared + ) + } + + private static func createInteractor( + for referendum: ReferendumLocal, + currencyManager: CurrencyManagerProtocol, + state: GovernanceSharedState + ) -> ReferendumDetailsInteractor? { + guard let option = state.settings.value else { + return nil + } + + let chain = option.chain + + let selectedAccount = SelectedWalletSettings.shared.value?.fetch(for: chain.accountRequest()) + + let chainRegistry = state.chainRegistry + + guard + let connection = chainRegistry.getConnection(for: chain.chainId), + let runtimeProvider = chainRegistry.getRuntimeProvider(for: chain.chainId), + let blockTimeService = state.blockTimeService, + let blockTimeFactory = state.createBlockTimeOperationFactory(), + let subscriptionFactory = state.subscriptionFactory else { + return nil + } + + let actionDetailsFactory = state.createActionsDetailsFactory(for: option) + + let operationQueue = OperationManagerFacade.sharedDefaultQueue + let requestFactory = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: OperationManager(operationQueue: operationQueue) + ) + + let identityOperationFactory = IdentityOperationFactory( + requestFactory: requestFactory, + emptyIdentitiesWhenNoStorage: true + ) + + let dAppsUrl = ApplicationConfig.shared.governanceDAppsListURL + let dAppsProvider: AnySingleValueProvider = + JsonDataProviderFactory.shared.getJson(for: dAppsUrl) + + return ReferendumDetailsInteractor( + referendum: referendum, + selectedAccount: selectedAccount, + option: option, + actionDetailsOperationFactory: actionDetailsFactory, + connection: connection, + runtimeProvider: runtimeProvider, + blockTimeService: blockTimeService, + blockTimeFactory: blockTimeFactory, + identityOperationFactory: identityOperationFactory, + priceLocalSubscriptionFactory: PriceProviderFactory.shared, + generalLocalSubscriptionFactory: state.generalLocalSubscriptionFactory, + govMetadataLocalSubscriptionFactory: state.govMetadataLocalSubscriptionFactory, + referendumsSubscriptionFactory: subscriptionFactory, + dAppsProvider: dAppsProvider, + currencyManager: currencyManager, + operationQueue: OperationManagerFacade.sharedDefaultQueue + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewLayout.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewLayout.swift new file mode 100644 index 0000000000..23c496480d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsViewLayout.swift @@ -0,0 +1,144 @@ +import UIKit + +final class ReferendumDetailsViewLayout: UIView { + let containerView: ScrollableContainerView = { + let view = ScrollableContainerView(axis: .vertical, respectsSafeArea: true) + view.stackView.layoutMargins = UIEdgeInsets(top: 6.0, left: 16, bottom: 24, right: 16) + view.stackView.isLayoutMarginsRelativeArrangement = true + view.stackView.alignment = .fill + return view + }() + + let titleView = ReferendumDetailsTitleView() + let votingDetailsRow = ReferendumVotingStatusDetailsView() + let dAppsTableView: StackTableView = .create { + $0.cellHeight = 64.0 + $0.hasSeparators = false + $0.contentInsets = UIEdgeInsets(top: 8.0, left: 16.0, bottom: 8.0, right: 16.0) + } + + var timelineView = TimelineRow() + + var yourVoteRow: YourVoteRow? + var requestedAmountRow: RequestedAmountRow? + + let fullDetailsView = FullDetailsRow(frame: .zero) + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = R.color.colorBlack() + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + addSubview(containerView) + containerView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + + containerView.stackView.spacing = 12 + containerView.stackView.addArrangedSubview(titleView) + containerView.stackView.setCustomSpacing(16, after: titleView) + + containerView.stackView.addArrangedSubview(votingDetailsRow) + containerView.stackView.addArrangedSubview(dAppsTableView) + containerView.stackView.addArrangedSubview(timelineView) + containerView.stackView.addArrangedSubview(fullDetailsView) + + dAppsTableView.apply(style: .cellWithoutHighlighting) + } + + func setTimeline(model: [ReferendumTimelineView.Model]?, locale: Locale) { + let title = R.string.localizable.govReferendumDetailsTimelineTitle( + preferredLanguages: locale.rLanguages + ) + + timelineView.titleLabel.text = title + + timelineView.bindOrHide(viewModel: model) + } + + func setDApps(models: [ReferendumDAppView.Model]?, locale: Locale) -> [ReferendumDAppCellView] { + dAppsTableView.clear() + + if let models = models, !models.isEmpty { + dAppsTableView.isHidden = false + + let title = R.string.localizable.commonUseDapp( + preferredLanguages: locale.rLanguages + ) + + let headerView = createHeader(with: title) + dAppsTableView.setCustomHeight(32, at: 0) + dAppsTableView.addArrangedSubview(headerView) + + let cells: [ReferendumDAppCellView] = models.map { model in + let dAppView = ReferendumDAppCellView() + dAppView.rowContentView.bind(viewModel: model) + return dAppView + } + + cells.forEach { + dAppsTableView.addArrangedSubview($0) + } + + return cells + } else { + dAppsTableView.isHidden = true + + return [] + } + } + + func setYourVote(model: YourVoteRow.Model?) { + guard let yourVoteViewModel = model else { + yourVoteRow?.removeFromSuperview() + yourVoteRow = nil + return + } + + if yourVoteRow == nil { + let yourVoteView = YourVoteRow(frame: .zero) + containerView.stackView.insertArranged(view: yourVoteView, before: votingDetailsRow) + yourVoteRow = yourVoteView + } + + yourVoteRow?.bind(viewModel: yourVoteViewModel) + } + + func setRequestedAmount(model: RequestedAmountRow.Model?) { + guard let requestedAmountViewModel = model else { + requestedAmountRow?.removeFromSuperview() + requestedAmountRow = nil + return + } + + if requestedAmountRow == nil { + let requestedAmountView = RequestedAmountRow(frame: .zero) + containerView.stackView.insertArranged(view: requestedAmountView, after: titleView) + requestedAmountRow = requestedAmountView + } + + requestedAmountRow?.bind(viewModel: requestedAmountViewModel) + } + + func setFullDetails(hidden: Bool, locale: Locale) { + fullDetailsView.isHidden = hidden + + fullDetailsView.bind(title: R.string.localizable.govFullDetails(preferredLanguages: locale.rLanguages)) + } + + private func createHeader(with text: String) -> StackTableHeaderCell { + let headerView = StackTableHeaderCell() + headerView.titleLabel.apply(style: .footnoteWhite64) + headerView.titleLabel.text = text + return headerView + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsWireframe.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsWireframe.swift new file mode 100644 index 0000000000..bed9efe667 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/ReferendumDetailsWireframe.swift @@ -0,0 +1,109 @@ +import Foundation + +final class ReferendumDetailsWireframe: ReferendumDetailsWireframeProtocol { + let state: GovernanceSharedState + + init(state: GovernanceSharedState) { + self.state = state + } + + func showFullDetails( + from view: ReferendumDetailsViewProtocol?, + referendum: ReferendumLocal, + actionDetails: ReferendumActionLocal, + metadata: ReferendumMetadataLocal?, + identities: [AccountAddress: AccountIdentity] + ) { + guard + let fullDetailsView = ReferendumFullDetailsViewFactory.createView( + state: state, + referendum: referendum, + actionDetails: actionDetails, + metadata: metadata, + identities: identities + ) else { + return + } + + let navigationController = FearlessNavigationController(rootViewController: fullDetailsView.controller) + + view?.controller.present(navigationController, animated: true) + } + + func showVote( + from view: ReferendumDetailsViewProtocol?, + referendum: ReferendumLocal, + initData: ReferendumVotingInitData + ) { + guard + let voteSetupView = ReferendumVoteSetupViewFactory.createView( + for: state, + referendum: referendum.index, + initData: initData + ) else { + return + } + + let navigationController = ImportantFlowViewFactory.createNavigation(from: voteSetupView.controller) + + view?.controller.present(navigationController, animated: true) + } + + func showVoters( + from view: ReferendumDetailsViewProtocol?, + referendum: ReferendumLocal, + type: ReferendumVotersType + ) { + guard + let votersView = ReferendumVotersViewFactory.createView( + state: state, + referendum: referendum, + type: type + ) else { + return + } + + let navigationController = FearlessNavigationController(rootViewController: votersView.controller) + + view?.controller.present(navigationController, animated: true) + } + + func showFullDescription( + from view: ReferendumDetailsViewProtocol?, + title: String, + description: String + ) { + guard + let fullDescriptionView = ReferendumFullDescriptionViewFactory.createView( + for: title, + description: description + ) else { + return + } + + let navigationController = FearlessNavigationController( + rootViewController: fullDescriptionView.controller + ) + + view?.controller.present(navigationController, animated: true) + } + + func showDApp(from view: ReferendumDetailsViewProtocol?, url: URL) { + guard + let browser = DAppBrowserViewFactory.createView( + for: .query(string: url.absoluteString) + ) else { + return + } + + view?.controller.navigationController?.pushViewController(browser.controller, animated: true) + } + + func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { + guard let accountManagementView = AccountManagementViewFactory.createView(for: wallet.identifier) else { + return + } + + view?.controller.navigationController?.pushViewController(accountManagementView.controller, animated: true) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/BindableView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/BindableView.swift new file mode 100644 index 0000000000..6da0810523 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/BindableView.swift @@ -0,0 +1,25 @@ +import UIKit + +protocol BindableView: UIView { + associatedtype TModel + func bind(viewModel: TModel) +} + +extension BindableView { + func bindOrHide(viewModel: TModel?) { + if let viewModel = viewModel { + isHidden = false + bind(viewModel: viewModel) + } else { + isHidden = true + } + } +} + +extension RowView: BindableView where T: BindableView { + typealias TModel = T.TModel + + func bind(viewModel: TModel) { + rowContentView.bind(viewModel: viewModel) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/BlurredView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/BlurredView.swift new file mode 100644 index 0000000000..efee5287b8 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/BlurredView.swift @@ -0,0 +1,51 @@ +import UIKit + +class BlurredView: UIView where TContentView: UIView { + let view: TContentView = .init() + let backgroundBlurView = TriangularedBlurView() + + var contentInsets: UIEdgeInsets = .init(top: 0, left: 16, bottom: 0, right: 16) { + didSet { + updateLayout() + } + } + + var innerInsets: UIEdgeInsets = .zero { + didSet { + updateLayout() + } + } + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = .clear + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + addSubview(backgroundBlurView) + backgroundBlurView.snp.makeConstraints { + $0.edges.equalToSuperview().inset(contentInsets) + } + + backgroundBlurView.addSubview(view) + view.snp.makeConstraints { + $0.edges.equalToSuperview().inset(innerInsets) + } + } + + private func updateLayout() { + backgroundBlurView.snp.updateConstraints { + $0.edges.equalToSuperview().inset(contentInsets) + } + view.snp.updateConstraints { + $0.edges.equalToSuperview().inset(innerInsets) + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumDAppView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumDAppView.swift new file mode 100644 index 0000000000..d8a1af27ac --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumDAppView.swift @@ -0,0 +1,97 @@ +import UIKit + +final class ReferendumDAppView: UIView { + let iconImageView: DAppIconView = .create { + $0.contentInsets = Constants.iconInsets + $0.backgroundView.cornerRadius = 12 + $0.backgroundView.strokeWidth = 0.5 + $0.backgroundView.strokeColor = R.color.colorWhite16()! + $0.backgroundView.highlightedStrokeColor = R.color.colorWhite16()! + $0.backgroundView.fillColor = R.color.colorWhite8()! + $0.backgroundView.highlightedFillColor = R.color.colorWhite8()! + } + + let titleView = MultiValueView() + let arrowView = UIImageView(image: R.image.iconChevronRight()) + private var model: Model? + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let content = UIView.hStack( + alignment: .center, + spacing: Constants.horizontalSpace, + [ + iconImageView, + titleView, + UIView(), + arrowView + ] + ) + + arrowView.snp.makeConstraints { + $0.width.height.equalTo(Constants.arrowSize) + } + + iconImageView.snp.makeConstraints { + $0.width.height.equalTo(Constants.iconWidth) + } + + titleView.stackView.alignment = .leading + + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } +} + +// MARK: - Model + +extension ReferendumDAppView { + struct Model { + let icon: ImageViewModelProtocol? + let title: String + let subtitle: String + } + + func bind(viewModel: Model) { + model?.icon?.cancel(on: iconImageView.imageView) + iconImageView.imageView.image = nil + + model = viewModel + + titleView.valueTop.text = viewModel.title + titleView.valueBottom.text = viewModel.subtitle + + viewModel.icon?.loadImage( + on: iconImageView.imageView, + targetSize: .init(width: Constants.iconWidth, height: Constants.iconWidth), + animated: true + ) + } + + func clear() { + model?.icon?.cancel(on: iconImageView.imageView) + } +} + +// MARK: - Constants + +extension ReferendumDAppView { + enum Constants { + static let arrowSize = CGSize(width: 16, height: 16) + static let horizontalSpace: CGFloat = 12 + static let iconWidth: CGFloat = 48 + static let iconInsets = UIEdgeInsets(top: 6, left: 6, bottom: 6, right: 6) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumDetailsTitleView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumDetailsTitleView.swift new file mode 100644 index 0000000000..7f5bd5b48c --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumDetailsTitleView.swift @@ -0,0 +1,146 @@ +import UIKit +import SoraUI +import CDMarkdownKit + +final class ReferendumDetailsTitleView: UIView { + var accountIconSize: CGSize { + let size = accountContainerView.rowContentView.detailsView.iconWidth + return CGSize(width: size, height: size) + } + + var accountLabel: UILabel { accountContainerView.rowContentView.detailsView.detailsLabel } + var accountImageView: UIImageView { accountContainerView.rowContentView.detailsView.imageView } + + let accountContainerView: RowView> = .create { view in + view.roundedBackgroundView.highlightedFillColor = .clear + view.changesContentOpacityWhenHighlighted = true + view.borderView.borderType = .none + + view.preferredHeight = 36.0 + view.rowContentView.mode = .detailsIcon + view.rowContentView.iconWidth = 16.0 + view.rowContentView.spacing = 6 + view.contentInsets = UIEdgeInsets(top: 9, left: 0, bottom: 9, right: 0) + view.rowContentView.imageView.image = R.image.iconInfoFilled()?.tinted(with: R.color.colorWhite48()!) + + let addressView = view.rowContentView.detailsView + addressView.spacing = 7 + addressView.detailsLabel.numberOfLines = 1 + addressView.detailsLabel.textColor = R.color.colorTransparentText() + addressView.detailsLabel.font = .regularFootnote + addressView.iconWidth = 18.0 + } + + private var addressImageViewModel: ImageViewModelProtocol? + + let titleLabel: UILabel = .create { + $0.textColor = R.color.colorWhite() + $0.font = .boldTitle1 + $0.numberOfLines = 0 + } + + let descriptionView = MarkdownViewContainer( + preferredWidth: UIScreen.main.bounds.width - 2 * UIConstants.horizontalInset, + maxTextLength: MarkdownText.readMoreThreshold + ) + + let moreButton: RoundedButton = .create { button in + button.applyIconStyle() + + let color = R.color.colorAccent()! + button.imageWithTitleView?.titleColor = color + button.imageWithTitleView?.titleFont = .regularFootnote + + button.imageWithTitleView?.iconImage = R.image.iconLinkChevron()?.tinted(with: color) + button.imageWithTitleView?.layoutType = .horizontalLabelFirst + button.contentInsets = .zero + + button.imageWithTitleView?.spacingBetweenLabelAndIcon = 4.0 + } + + override init(frame: CGRect) { + super.init(frame: frame) + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let content = UIView.vStack( + alignment: .leading, + spacing: 8, + [ + accountContainerView, + titleLabel, + descriptionView, + moreButton + ] + ) + content.setCustomSpacing(0, after: accountContainerView) + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } +} + +extension ReferendumDetailsTitleView { + struct Model { + let account: DisplayAddressViewModel? + let details: Details? + } + + struct Details { + let title: String + let description: String + } + + func bind(viewModel: Model, locale: Locale) { + addressImageViewModel?.cancel(on: accountImageView) + addressImageViewModel = viewModel.account?.imageViewModel + + if let account = viewModel.account { + accountContainerView.isHidden = false + + accountLabel.text = account.name ?? account.address.truncated + + account.imageViewModel?.loadImage( + on: accountImageView, + targetSize: accountIconSize, + animated: true + ) + + } else { + accountContainerView.isHidden = true + } + + bind(details: viewModel.details, locale: locale) + } + + private func bind(details: Details?, locale: Locale) { + guard let details = details else { + titleLabel.isHidden = true + descriptionView.isHidden = true + moreButton.isHidden = true + return + } + titleLabel.isHidden = false + titleLabel.text = details.title + + moreButton.isHidden = true + + descriptionView.isHidden = false + descriptionView.load(from: details.description) { [weak self] (model: MarkdownText?) in + if let shouldReadMore = model?.isFull { + self?.moreButton.isHidden = shouldReadMore + } + } + + moreButton.imageWithTitleView?.title = R.string.localizable.commonReadMore( + preferredLanguages: locale.rLanguages + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumVotingStatusDetailsView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumVotingStatusDetailsView.swift new file mode 100644 index 0000000000..25d3a214b3 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumVotingStatusDetailsView.swift @@ -0,0 +1,109 @@ +import UIKit +import SoraUI + +final class ReferendumVotingStatusDetailsView: RoundedView { + let statusView = ReferendumVotingStatusView() + let votingProgressView = VotingProgressView() + let ayeVotesView: VoteRowView = .create { + $0.apply(style: .init( + color: R.color.colorGreen15CF37()!, + accessoryImage: (R.image.iconInfoFilled()?.tinted(with: R.color.colorWhite48()!))! + )) + } + + let nayVotesView: VoteRowView = .create { + $0.apply(style: .init( + color: R.color.colorRedFF3A69()!, + accessoryImage: (R.image.iconInfoFilled()?.tinted(with: R.color.colorWhite48()!))! + )) + } + + let voteButton: TriangularedButton = .create { + $0.applyDefaultStyle() + } + + override init(frame: CGRect) { + super.init(frame: frame) + + applyFilledBackgroundStyle() + + fillColor = R.color.colorWhite8()! + cornerRadius = 12.0 + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let votesContainerView = UIView.vStack( + [ + ayeVotesView, + nayVotesView + ] + ) + + let content = UIView.vStack( + [ + statusView, + votingProgressView, + votesContainerView, + voteButton + ] + ) + + content.setCustomSpacing(16.0, after: votingProgressView) + content.setCustomSpacing(16.0, after: votesContainerView) + + content.alignment = .center + + addSubview(content) + content.snp.makeConstraints { + $0.top.bottom.equalToSuperview().inset(16) + $0.leading.trailing.equalToSuperview() + } + + voteButton.snp.makeConstraints { make in + make.height.equalTo(44.0) + } + + votesContainerView.snp.makeConstraints { make in + make.width.equalTo(self) + } + + content.arrangedSubviews + .filter { $0 !== votesContainerView } + .forEach { + $0.snp.makeConstraints { make in + make.width.equalTo(self).offset(-32) + } + } + } +} + +extension ReferendumVotingStatusDetailsView: BindableView { + struct Model { + let status: ReferendumVotingStatusView.Model + let votingProgress: VotingProgressView.Model? + let aye: VoteRowView.Model? + let nay: VoteRowView.Model? + let buttonText: String? + } + + func bind(viewModel: Model) { + statusView.bind(viewModel: viewModel.status) + votingProgressView.bindOrHide(viewModel: viewModel.votingProgress) + ayeVotesView.bindOrHide(viewModel: viewModel.aye) + nayVotesView.bindOrHide(viewModel: viewModel.nay) + if let buttonText = viewModel.buttonText { + voteButton.isHidden = false + voteButton.imageWithTitleView?.title = buttonText + voteButton.invalidateLayout() + } else { + voteButton.isHidden = true + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumVotingStatusView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumVotingStatusView.swift new file mode 100644 index 0000000000..a0808d2b92 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/ReferendumVotingStatusView.swift @@ -0,0 +1,113 @@ +import UIKit + +final class ReferendumVotingStatusView: UIView { + let titleLabel: UILabel = .init(style: .title) + let statusLabel: UILabel = .init(style: .positiveStatusLabel) + + let timeView: IconDetailsView = .create { + $0.mode = .detailsIcon + $0.detailsLabel.numberOfLines = 1 + $0.spacing = 5 + $0.iconWidth = 14.0 + $0.apply(style: .timeView) + } + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let content = UIView.vStack( + spacing: 8, + [ + UIView.hStack([ + titleLabel, + UIView(), + timeView + ]), + statusLabel + ] + ) + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } +} + +extension ReferendumVotingStatusView { + struct Model { + let status: Status + let time: ReferendumInfoView.Time? + let title: String? + } + + struct Status { + let name: String + let kind: StatusKind + } + + enum StatusKind { + case positive + case negative + case neutral + + init(infoKind: ReferendumInfoView.StatusKind) { + switch infoKind { + case .positive: + self = .positive + case .negative: + self = .negative + case .neutral: + self = .neutral + } + } + } + + func bind(viewModel: Model) { + titleLabel.text = viewModel.title + statusLabel.text = viewModel.status.name + bind(timeModel: viewModel.time) + + switch viewModel.status.kind { + case .positive: + statusLabel.apply(style: .positiveStatusLabel) + case .negative: + statusLabel.apply(style: .negativeStatusLabel) + case .neutral: + statusLabel.apply(style: .neutralStatusLabel) + } + } + + func bind(timeModel: ReferendumInfoView.Time?) { + if let time = timeModel { + timeView.bind(viewModel: time.titleIcon) + timeView.apply(style: time.isUrgent ? .activeTimeView : .timeView) + } else { + timeView.bind(viewModel: nil) + } + } +} + +private extension UILabel.Style { + static let positiveStatusLabel = UILabel.Style( + textColor: R.color.colorGreen15CF37(), + font: .boldTitle2 + ) + static let negativeStatusLabel = UILabel.Style( + textColor: R.color.colorRedFF3A69(), + font: .boldTitle2 + ) + static let neutralStatusLabel = UILabel.Style( + textColor: R.color.colorWhite64(), + font: .boldTitle2 + ) + static let title = UILabel.Style.footnoteWhite64 +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/FullDetailsRow.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/FullDetailsRow.swift new file mode 100644 index 0000000000..ecdee91ca7 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/FullDetailsRow.swift @@ -0,0 +1,20 @@ +import UIKit +import SoraUI + +final class FullDetailsRow: RowView> { + override init(frame: CGRect) { + super.init(frame: frame) + + rowContentView.titleView.apply(style: .rowLink) + rowContentView.titleView.textAlignment = .left + rowContentView.valueView.image = R.image.iconChevronRight() + roundedBackgroundView.apply(style: .roundedLightCell) + preferredHeight = 52 + contentInsets = .init(top: 14, left: 16, bottom: 14, right: 16) + borderView.borderType = .none + } + + func bind(title: String) { + rowContentView.titleView.text = title + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/MultiValueView+Styles.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/MultiValueView+Styles.swift new file mode 100644 index 0000000000..f87a0b93a3 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/MultiValueView+Styles.swift @@ -0,0 +1,37 @@ +import UIKit + +extension MultiValueView { + struct Style { + let topLabel: UILabel.Style + let bottomLabel: UILabel.Style + } + + func apply(style: Style) { + valueTop.apply(style: style.topLabel) + valueBottom.apply(style: style.bottomLabel) + } +} + +extension MultiValueView.Style { + static let rowContrasted = MultiValueView.Style( + topLabel: .init( + textColor: R.color.colorWhite(), + font: .regularFootnote + ), + bottomLabel: .init( + textColor: R.color.colorWhite64(), + font: .caption1 + ) + ) + + static let accentAmount = MultiValueView.Style( + topLabel: .init( + textColor: R.color.colorWhite(), + font: .boldTitle1 + ), + bottomLabel: .init( + textColor: R.color.colorWhite64(), + font: .regularBody + ) + ) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/ReferendumDAppCellView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/ReferendumDAppCellView.swift new file mode 100644 index 0000000000..d6405973e5 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/ReferendumDAppCellView.swift @@ -0,0 +1,3 @@ +import UIKit + +final class ReferendumDAppCellView: RowView, StackTableViewCellProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/RequestedAmountRow.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/RequestedAmountRow.swift new file mode 100644 index 0000000000..1e8124e794 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/RequestedAmountRow.swift @@ -0,0 +1,29 @@ +import UIKit + +final class RequestedAmountRow: RowView> { + struct Model { + let title: String + let amount: MultiValueView.Model + } + + override init(frame: CGRect) { + super.init(frame: frame) + + preferredHeight = 102 + rowContentView.valueTop.apply(style: .footnoteWhite64) + rowContentView.valueTop.textAlignment = .left + rowContentView.valueBottom.apply(style: .accentAmount) + rowContentView.valueBottom.valueTop.textAlignment = .left + rowContentView.valueBottom.valueBottom.textAlignment = .left + roundedBackgroundView.apply(style: .cellWithoutHighlighting) + contentInsets = .init(top: 16, left: 16, bottom: 16, right: 16) + backgroundColor = .clear + isUserInteractionEnabled = false + borderView.borderType = .none + } + + func bind(viewModel: Model) { + rowContentView.valueTop.text = viewModel.title + rowContentView.valueBottom.bind(viewModel: viewModel.amount) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/RoundedView+Styles.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/RoundedView+Styles.swift new file mode 100644 index 0000000000..428cb5b0a3 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/RoundedView+Styles.swift @@ -0,0 +1,23 @@ +import UIKit +import SoraUI + +extension RoundedView.Style { + static let roundedLightCell = RoundedView.Style( + shadowOpacity: 0, + strokeWidth: 0, + strokeColor: .clear, + highlightedStrokeColor: .clear, + fillColor: R.color.colorWhite8()!, + highlightedFillColor: R.color.colorAccentSelected()!, + rounding: .init(radius: 12, corners: .allCorners) + ) + static let cellWithoutHighlighting = RoundedView.Style( + shadowOpacity: 0, + strokeWidth: 0, + strokeColor: .clear, + highlightedStrokeColor: .clear, + fillColor: R.color.colorWhite8()!, + highlightedFillColor: R.color.colorWhite8()!, + rounding: .init(radius: 12, corners: .allCorners) + ) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/TimelineRow.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/TimelineRow.swift new file mode 100644 index 0000000000..195871586c --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/TimelineRow.swift @@ -0,0 +1,52 @@ +import UIKit +import SoraUI + +final class TimelineRow: RoundedView, BindableView { + typealias TModel = [ReferendumTimelineView.Model] + + let titleLabel: UILabel = .create { + $0.textColor = R.color.colorTransparentText() + $0.font = .regularFootnote + } + + let contentView = ReferendumTimelineView() + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = .clear + + applyCellBackgroundStyle() + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func bind(viewModel: [ReferendumTimelineView.Model]) { + contentView.bind(viewModel: viewModel) + } + + func bind(activeTimeViewModel: ReferendumInfoView.Time?) { + contentView.bind(activeTimeViewModel: activeTimeViewModel) + } + + private func setupLayout() { + let content = UIView.vStack( + spacing: 16, + [ + titleLabel, + contentView + ] + ) + + addSubview(content) + content.snp.makeConstraints { make in + make.top.leading.trailing.equalToSuperview().inset(16) + make.bottom.equalToSuperview() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/VotingDetailsRow.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/VotingDetailsRow.swift new file mode 100644 index 0000000000..d004302afe --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/VotingDetailsRow.swift @@ -0,0 +1,11 @@ +import UIKit + +final class VotingDetailsRow: RowView { + override init(frame: CGRect) { + super.init(frame: frame) + + contentInsets = .zero + roundedBackgroundView.apply(style: .cellWithoutHighlighting) + backgroundColor = .clear + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/YourVoteRow.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/YourVoteRow.swift new file mode 100644 index 0000000000..27f9ada266 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Rows/YourVoteRow.swift @@ -0,0 +1,29 @@ +import UIKit + +final class YourVoteRow: RowView> { + struct Model { + let vote: YourVoteView.Model + let amount: MultiValueView.Model + } + + convenience init() { + self.init(frame: .zero) + } + + override init(frame: CGRect) { + super.init(frame: frame) + + borderView.borderType = .none + rowContentView.titleView.apply(style: .ayeInverse) + rowContentView.valueView.apply(style: .rowContrasted) + roundedBackgroundView.apply(style: .cellWithoutHighlighting) + contentInsets = .init(top: 9, left: 16, bottom: 9, right: 16) + isUserInteractionEnabled = false + preferredHeight = 52 + } + + func bind(viewModel: Model) { + rowContentView.titleView.bind(viewModel: viewModel.vote) + rowContentView.valueView.bind(viewModel: viewModel.amount) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/BaselinedView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/BaselinedView.swift new file mode 100644 index 0000000000..ba3c8e6eae --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/BaselinedView.swift @@ -0,0 +1,17 @@ +import UIKit + +protocol BaselinedView: UIView { + var firstBaseline: UIView { get } +} + +extension GenericMultiValueView: BaselinedView { + var firstBaseline: UIView { + valueTop + } +} + +extension UILabel: BaselinedView { + var firstBaseline: UIView { + self + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/DotsView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/DotsView.swift new file mode 100644 index 0000000000..8deec936f6 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/DotsView.swift @@ -0,0 +1,130 @@ +import UIKit + +final class DotsView: UIView { + struct Model { + let isFinite: Bool + } + + var points: [Model] = [] { + didSet { + invalidateIntrinsicContentSize() + setNeedsDisplay() + } + } + + private var style: Style = .defaultStyle + + var contentInsets = UIEdgeInsets(top: 1, left: 1, bottom: 1, right: 1) + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = .clear + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func draw(_ rect: CGRect) { + super.draw(rect) + drawDots() + } + + override var intrinsicContentSize: CGSize { + let height = CGFloat(points.count) * (2 * style.dotRadius + style.pointSpacing) + style.lastExtraSpace + + return CGSize( + width: 2 * style.dotRadius + contentInsets.left + contentInsets.right, + height: height + contentInsets.top + contentInsets.bottom + ) + } + + private func drawDots() { + guard let context = UIGraphicsGetCurrentContext() else { + return + } + + setup(context: context) + let dotX = bounds.midX + + for index in 0 ..< points.count { + let dotY = bounds.minY + contentInsets.top + CGFloat(index) * (2 * style.dotRadius + style.pointSpacing) + + style.dotRadius + let firstDot = createCircle(with: .init(x: dotX, y: dotY)) + + if index == points.count - 1 { + firstDot.stroke() + firstDot.fill() + + if !points[index].isFinite { + let dottedLinePath = UIBezierPath() + let lineStart = dotY + style.dotRadius + style.lineSpacing + let lineEnd = dotY + style.dotRadius + style.pointSpacing + style.lastExtraSpace + dottedLinePath.move(to: .init(x: dotX, y: lineStart)) + dottedLinePath.setLineDash(style.pattern, count: style.pattern.count, phase: 0) + dottedLinePath.addLine(to: .init(x: dotX, y: lineEnd)) + + context.setStrokeColor(style.dashedColor.cgColor) + dottedLinePath.stroke() + } + } else { + let lineStart = dotY + style.dotRadius + style.lineSpacing + let lineEnd = dotY + style.dotRadius + style.pointSpacing - style.lineSpacing + firstDot.move(to: .init(x: dotX, y: lineStart)) + firstDot.addLine(to: .init(x: dotX, y: lineEnd)) + firstDot.stroke() + firstDot.fill() + } + } + } + + private func createCircle(with center: CGPoint) -> UIBezierPath { + UIBezierPath( + arcCenter: center, + radius: style.dotRadius, + startAngle: 0, + endAngle: 2 * .pi, + clockwise: true + ) + } + + private func setup(context: CGContext) { + context.setStrokeColor(style.connectingColor.cgColor) + context.setFillColor(style.connectingColor.cgColor) + context.setLineWidth(style.lineWidth) + } +} + +extension DotsView { + struct Style { + let lineWidth: CGFloat + let connectingColor: UIColor + let dashedColor: UIColor + let dotRadius: CGFloat + let pointSpacing: CGFloat + let lineSpacing: CGFloat + let pattern: [CGFloat] + let lastExtraSpace: CGFloat + } + + func apply(style: Style) { + self.style = style + invalidateIntrinsicContentSize() + setNeedsDisplay() + } +} + +extension DotsView.Style { + static let defaultStyle = DotsView.Style( + lineWidth: 1, + connectingColor: R.color.colorNovaBlue()!, + dashedColor: R.color.colorWhite24()!, + dotRadius: 6, + pointSpacing: 36, + lineSpacing: 6, + pattern: [2, 3], + lastExtraSpace: 4 + ) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/ReferendumTimelineView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/ReferendumTimelineView.swift new file mode 100644 index 0000000000..f2d169edf3 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/ReferendumTimelineView.swift @@ -0,0 +1,150 @@ +import UIKit +import SoraUI + +final class ReferendumTimelineView: UIView { + private enum Constants { + static let horizontalSpacing: CGFloat = 15 + static let verticalSpacing: CGFloat = 48 + static let alignmentOffset: CGFloat = -1 + static let titleSubtitleSpacing: CGFloat = 2 + } + + let dotsView = DotsView() + private var statusViews: [UIView] = [] + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + addSubview(dotsView) + + dotsView.snp.makeConstraints { + $0.top.bottom.leading.equalToSuperview() + } + } + + private func updateStatuses(model: [Model]) { + let statusViews = statusViews(from: model) + + self.statusViews.forEach { + $0.removeFromSuperview() + } + + self.statusViews = statusViews + + statusViews.enumerated().forEach { index, view in + addSubview(view) + + let topInset = CGFloat(index) * Constants.verticalSpacing + Constants.alignmentOffset + + view.snp.makeConstraints { make in + make.leading.equalTo(dotsView.snp.trailing).offset(Constants.horizontalSpacing) + make.top.equalToSuperview().inset(topInset) + } + } + + dotsView.points = model.map { + DotsView.Model(isFinite: $0.isLast) + } + } + + private func statusViews(from model: [Model]) -> [UIView] { + model.map { status in + switch status.subtitle { + case let .date(date): + let view = MultiValueView() + view.spacing = Constants.titleSubtitleSpacing + view.valueTop.text = status.title + view.valueTop.textAlignment = .left + view.valueTop.apply(style: UILabel.Style.timelineTitle) + view.valueBottom.apply(style: UILabel.Style.timelineNeutralSubtitle) + view.valueBottom.textAlignment = .left + view.valueBottom.text = date + return view + case let .interval(model): + let view = GenericMultiValueView() + view.spacing = Constants.titleSubtitleSpacing + view.valueTop.text = status.title + view.valueTop.textAlignment = .left + view.valueTop.apply(style: UILabel.Style.timelineTitle) + view.valueBottom.detailsLabel.numberOfLines = 1 + + if model.isUrgent { + view.valueBottom.detailsLabel.apply(style: UILabel.Style.timelineUrgentSubtitle) + } else { + view.valueBottom.detailsLabel.apply(style: UILabel.Style.timelineNeutralSubtitle) + } + + view.valueBottom.spacing = 5 + view.valueBottom.iconWidth = 14 + view.valueBottom.bind(viewModel: model.titleIcon) + return view + case .none: + let label = UILabel() + label.text = status.title + label.apply(style: UILabel.Style.rowTitle) + return label + } + } + } +} + +extension ReferendumTimelineView: BindableView { + struct Model { + let title: String + let subtitle: StatusSubtitle? + let isLast: Bool + } + + enum StatusSubtitle { + case date(String) + case interval(ReferendumInfoView.Time) + } + + func bind(viewModel: [Model]) { + updateStatuses(model: viewModel) + setNeedsLayout() + } + + func bind(activeTimeViewModel: ReferendumInfoView.Time?) { + guard let activeView = statusViews.last as? GenericMultiValueView else { + return + } + + if let activeTimeViewModel = activeTimeViewModel { + if activeTimeViewModel.isUrgent { + activeView.valueBottom.detailsLabel.apply(style: UILabel.Style.timelineUrgentSubtitle) + } else { + activeView.valueBottom.detailsLabel.apply(style: UILabel.Style.timelineNeutralSubtitle) + } + + activeView.valueBottom.bind(viewModel: activeTimeViewModel.titleIcon) + } else { + activeView.valueBottom.bind(viewModel: nil) + } + + setNeedsLayout() + } +} + +private extension UILabel.Style { + static var timelineTitle: UILabel.Style { + .init(textColor: R.color.colorWhite()!, font: .regularFootnote) + } + + static var timelineNeutralSubtitle: UILabel.Style { + .init(textColor: R.color.colorTransparentText()!, font: .caption1) + } + + static var timelineUrgentSubtitle: UILabel.Style { + .init(textColor: R.color.colorDarkYellow()!, font: .caption1) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/UIView+frame.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/UIView+frame.swift new file mode 100644 index 0000000000..ed1826e030 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/Timeline/UIView+frame.swift @@ -0,0 +1,18 @@ +import UIKit + +extension UIView { + func frame(in targetView: UIView) -> CGRect { + var view = self + var rect = view.frame + + while let superview = view.superview { + if superview == targetView { + return rect + } + rect = view.convert(rect, to: superview) + view = superview + } + + return rect + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/TrackTagsView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/TrackTagsView.swift new file mode 100644 index 0000000000..1a9f1bb703 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/TrackTagsView.swift @@ -0,0 +1,80 @@ +import UIKit + +final class TrackTagsView: UIView { + let trackNameView: BorderedIconLabelView = .create { + $0.iconDetailsView.spacing = 6 + $0.contentInsets = .init(top: 4, left: 6, bottom: 4, right: 8) + $0.iconDetailsView.detailsLabel.apply(style: .track) + $0.backgroundView.apply(style: .referendum) + $0.iconDetailsView.detailsLabel.numberOfLines = 1 + $0.backgroundView.cornerRadius = 7.0 + } + + let numberLabel: BorderedLabelView = .create { + $0.titleLabel.apply(style: .track) + $0.contentInsets = .init(top: 4, left: 8, bottom: 4, right: 8) + $0.backgroundView.apply(style: .referendum) + $0.titleLabel.numberOfLines = 1 + $0.backgroundView.cornerRadius = 7.0 + } + + private(set) var trackIconViewModel: ImageViewModelProtocol? + + override init(frame: CGRect) { + super.init(frame: frame) + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let content = UIView.hStack( + spacing: 6, + [ + trackNameView, + numberLabel + ] + ) + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } +} + +extension TrackTagsView: BindableView { + struct Model { + let titleIcon: ReferendumInfoView.Track? + let referendumNumber: String? + } + + func bind(viewModel: Model) { + if let referendumNumber = viewModel.referendumNumber { + numberLabel.isHidden = false + numberLabel.titleLabel.text = referendumNumber + } else { + numberLabel.isHidden = true + } + + trackIconViewModel?.cancel(on: trackNameView.iconDetailsView.imageView) + trackIconViewModel = nil + + if let titleIcon = viewModel.titleIcon { + trackNameView.isHidden = false + trackNameView.iconDetailsView.detailsLabel.text = titleIcon.title + + trackIconViewModel = titleIcon.icon + let size = trackNameView.iconDetailsView.iconWidth + trackIconViewModel?.loadImage( + on: trackNameView.iconDetailsView.imageView, + targetSize: CGSize(width: size, height: size), + animated: true + ) + } else { + trackNameView.isHidden = true + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumDetails/View/VoteRowView.swift b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/VoteRowView.swift new file mode 100644 index 0000000000..e253980391 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumDetails/View/VoteRowView.swift @@ -0,0 +1,93 @@ +import UIKit +import SoraUI + +final class VoteRowIndicatorView: RoundedView { + var preferredSize = CGSize(width: 4.0, height: 16.0) { + didSet { + invalidateIntrinsicContentSize() + } + } + + override var intrinsicContentSize: CGSize { + preferredSize + } +} + +final class VoteRowView: RowView< + GenericTitleValueView, IconDetailsView> +> { + var titleLabel: UILabel { rowContentView.titleView.sView } + + var detailsLabel: UILabel { rowContentView.valueView.detailsLabel } + + var indicatorView: RoundedView { rowContentView.titleView.fView } + + var trailingImageView: UIImageView { rowContentView.valueView.imageView } + + override init(frame: CGRect) { + super.init(frame: frame) + + configureStyle() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func configureStyle() { + preferredHeight = 44.0 + roundedBackgroundView.highlightedFillColor = R.color.colorHighlightedAccent()! + borderView.borderType = .none + + rowContentView.titleView.setHorizontalAndSpacing(16.0) + rowContentView.valueView.spacing = 8.0 + rowContentView.valueView.mode = .detailsIcon + + indicatorView.cornerRadius = 2.0 + + rowContentView.valueView.iconWidth = 16.0 + + titleLabel.apply(style: UILabel.Style.rowTitle) + detailsLabel.apply(style: UILabel.Style.rowTitle) + } +} + +extension VoteRowView { + struct Style { + var color: UIColor + var accessoryImage: UIImage + } + + func apply(style: Style) { + indicatorView.fillColor = style.color + trailingImageView.image = style.accessoryImage + + setNeedsLayout() + } +} + +extension VoteRowView { + struct Model { + let title: String + let votes: String + } + + func bind(viewModel: Model) { + titleLabel.text = viewModel.title + detailsLabel.text = viewModel.votes + } + + func bindOrHide(viewModel: Model?) { + if let viewModel = viewModel { + isHidden = false + bind(viewModel: viewModel) + } else { + isHidden = true + } + } +} + +extension UILabel.Style { + static let rowTitle = UILabel.Style(textColor: R.color.colorWhite(), font: .regularFootnote) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionInteractor.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionInteractor.swift new file mode 100644 index 0000000000..01bd422a9d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionInteractor.swift @@ -0,0 +1,7 @@ +import UIKit + +final class ReferendumFullDescriptionInteractor { + weak var presenter: ReferendumFullDescriptionInteractorOutputProtocol! +} + +extension ReferendumFullDescriptionInteractor: ReferendumFullDescriptionInteractorInputProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionPresenter.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionPresenter.swift new file mode 100644 index 0000000000..253b3fd4bf --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionPresenter.swift @@ -0,0 +1,42 @@ +import Foundation + +final class ReferendumFullDescriptionPresenter { + weak var view: ReferendumFullDescriptionViewProtocol? + let wireframe: ReferendumFullDescriptionWireframeProtocol + let interactor: ReferendumFullDescriptionInteractorInputProtocol + + let title: String + let description: String + + init( + title: String, + description: String, + interactor: ReferendumFullDescriptionInteractorInputProtocol, + wireframe: ReferendumFullDescriptionWireframeProtocol + ) { + self.title = title + self.description = description + self.interactor = interactor + self.wireframe = wireframe + } +} + +extension ReferendumFullDescriptionPresenter: ReferendumFullDescriptionPresenterProtocol { + func setup() { + view?.didReceive(title: title, description: description) + } + + func open(url: URL) { + guard let view = view else { + return + } + + wireframe.showWeb( + url: url, + from: view, + style: .modal + ) + } +} + +extension ReferendumFullDescriptionPresenter: ReferendumFullDescriptionInteractorOutputProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionProtocols.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionProtocols.swift new file mode 100644 index 0000000000..d5e0b2b8a4 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionProtocols.swift @@ -0,0 +1,16 @@ +import Foundation + +protocol ReferendumFullDescriptionViewProtocol: ControllerBackedProtocol { + func didReceive(title: String, description: String) +} + +protocol ReferendumFullDescriptionPresenterProtocol: AnyObject { + func setup() + func open(url: URL) +} + +protocol ReferendumFullDescriptionInteractorInputProtocol: AnyObject {} + +protocol ReferendumFullDescriptionInteractorOutputProtocol: AnyObject {} + +protocol ReferendumFullDescriptionWireframeProtocol: WebPresentable {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewController.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewController.swift new file mode 100644 index 0000000000..b965316cd7 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewController.swift @@ -0,0 +1,45 @@ +import UIKit + +final class ReferendumFullDescriptionViewController: UIViewController, ViewHolder { + typealias RootViewType = ReferendumFullDescriptionViewLayout + + let presenter: ReferendumFullDescriptionPresenterProtocol + + init(presenter: ReferendumFullDescriptionPresenterProtocol) { + self.presenter = presenter + super.init(nibName: nil, bundle: nil) + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = ReferendumFullDescriptionViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupHandlers() + presenter.setup() + } + + private func setupHandlers() { + rootView.markdownView.delegate = self + } +} + +extension ReferendumFullDescriptionViewController: ReferendumFullDescriptionViewProtocol { + func didReceive(title: String, description: String) { + rootView.set(title: title) + rootView.set(markdownText: description) + } +} + +extension ReferendumFullDescriptionViewController: MarkdownViewContainerDelegate { + func markdownView(_: MarkdownViewContainer, asksHandle url: URL) { + presenter.open(url: url) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewFactory.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewFactory.swift new file mode 100644 index 0000000000..5f770e2b3d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewFactory.swift @@ -0,0 +1,25 @@ +import Foundation + +struct ReferendumFullDescriptionViewFactory { + static func createView( + for title: String, + description: String + ) -> ReferendumFullDescriptionViewProtocol? { + let interactor = ReferendumFullDescriptionInteractor() + let wireframe = ReferendumFullDescriptionWireframe() + + let presenter = ReferendumFullDescriptionPresenter( + title: title, + description: description, + interactor: interactor, + wireframe: wireframe + ) + + let view = ReferendumFullDescriptionViewController(presenter: presenter) + + presenter.view = view + interactor.presenter = presenter + + return view + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewLayout.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewLayout.swift new file mode 100644 index 0000000000..5b5811c95c --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionViewLayout.swift @@ -0,0 +1,69 @@ +import UIKit +import CDMarkdownKit + +final class ReferendumFullDescriptionViewLayout: UIView { + let containerView: ScrollableContainerView = { + let view = ScrollableContainerView(axis: .vertical, respectsSafeArea: true) + view.stackView.layoutMargins = UIEdgeInsets(top: 12, left: 16, bottom: 24, right: 16) + view.stackView.isLayoutMarginsRelativeArrangement = true + view.stackView.alignment = .fill + return view + }() + + let titleLabel: UILabel = .create { + $0.textColor = R.color.colorWhite() + $0.font = .boldTitle1 + $0.numberOfLines = 0 + } + + let markdownView = MarkdownViewContainer( + preferredWidth: UIScreen.main.bounds.width - 2 * UIConstants.horizontalInset + ) + + let activityIndicator: UIActivityIndicatorView = .create { + $0.hidesWhenStopped = true + } + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = R.color.colorBlack() + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func set(markdownText: String) { + activityIndicator.startAnimating() + + markdownView.load(from: markdownText) { [weak self] model in + if model != nil { + self?.activityIndicator.stopAnimating() + } + } + } + + func set(title: String) { + titleLabel.text = title + } + + private func setupLayout() { + addSubview(containerView) + containerView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + + containerView.stackView.addArrangedSubview(titleLabel) + containerView.stackView.addArrangedSubview(markdownView) + containerView.stackView.setCustomSpacing(16, after: titleLabel) + + addSubview(activityIndicator) + activityIndicator.snp.makeConstraints { make in + make.center.equalToSuperview() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionWireframe.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionWireframe.swift new file mode 100644 index 0000000000..4be86a54cc --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDescription/ReferendumFullDescriptionWireframe.swift @@ -0,0 +1,3 @@ +import Foundation + +final class ReferendumFullDescriptionWireframe: ReferendumFullDescriptionWireframeProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsInteractor.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsInteractor.swift new file mode 100644 index 0000000000..3113c62394 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsInteractor.swift @@ -0,0 +1,106 @@ +import UIKit +import SubstrateSdk + +final class ReferendumFullDetailsInteractor { + weak var presenter: ReferendumFullDetailsInteractorOutputProtocol? + let chain: ChainModel + let priceLocalSubscriptionFactory: PriceProviderFactoryProtocol + let operationQueue: OperationQueue + let processingOperationFactory: PrettyPrintedJSONOperationFactoryProtocol + let referendumAction: ReferendumActionLocal + + private var priceProvider: AnySingleValueProvider? + + init( + chain: ChainModel, + priceLocalSubscriptionFactory: PriceProviderFactoryProtocol, + currencyManager: CurrencyManagerProtocol, + processingOperationFactory: PrettyPrintedJSONOperationFactoryProtocol, + referendumAction: ReferendumActionLocal, + operationQueue: OperationQueue + ) { + self.processingOperationFactory = processingOperationFactory + self.chain = chain + self.referendumAction = referendumAction + self.priceLocalSubscriptionFactory = priceLocalSubscriptionFactory + self.operationQueue = operationQueue + self.currencyManager = currencyManager + } + + private func makeSubscriptions() { + priceProvider?.removeObserver(self) + priceProvider = nil + + guard let priceId = chain.utilityAsset()?.priceId else { + return + } + + priceProvider = subscribeToPrice(for: priceId, currency: selectedCurrency) + } + + private func formatJSON() { + guard let wrappedCall = referendumAction.call else { + presenter?.didReceive(call: nil) + return + } + + do { + guard let json = try wrappedCall.value?.toScaleCompatibleJSON() else { + presenter?.didReceive(call: .tooLong) + return + } + + let processingOperation = processingOperationFactory.createProcessingOperation(for: json) + processingOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + do { + let result = try processingOperation.extractNoCancellableResultData() + self?.presenter?.didReceive(call: .concrete(result)) + } catch { + self?.presenter?.didReceive(error: .processingJSON(error)) + } + } + } + + operationQueue.addOperation(processingOperation) + } catch { + presenter?.didReceive(error: .processingJSON(error)) + } + } +} + +extension ReferendumFullDetailsInteractor: ReferendumFullDetailsInteractorInputProtocol { + func setup() { + makeSubscriptions() + formatJSON() + } + + func remakeSubscriptions() { + makeSubscriptions() + } + + func refreshCall() { + formatJSON() + } +} + +extension ReferendumFullDetailsInteractor: PriceLocalSubscriptionHandler, PriceLocalStorageSubscriber { + func handlePrice(result: Result, priceId _: AssetModel.PriceId) { + switch result { + case let .success(price): + presenter?.didReceive(price: price) + case let .failure(error): + presenter?.didReceive(error: .priceFailed(error)) + } + } +} + +extension ReferendumFullDetailsInteractor: SelectedCurrencyDepending { + func applyCurrency() { + if presenter != nil { + if let priceId = chain.utilityAsset()?.priceId { + priceProvider = subscribeToPrice(for: priceId, currency: selectedCurrency) + } + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsPresenter.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsPresenter.swift new file mode 100644 index 0000000000..882cd2c139 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsPresenter.swift @@ -0,0 +1,229 @@ +import Foundation +import SubstrateSdk +import SoraFoundation +import BigInt + +final class ReferendumFullDetailsPresenter { + weak var view: ReferendumFullDetailsViewProtocol? + let wireframe: ReferendumFullDetailsWireframeProtocol + let interactor: ReferendumFullDetailsInteractorInputProtocol + let balanceViewModelFactory: BalanceViewModelFactoryProtocol + let addressViewModelFactory: DisplayAddressViewModelFactoryProtocol + let logger: LoggerProtocol + + let chain: ChainModel + let referendum: ReferendumLocal + let actionDetails: ReferendumActionLocal + let metadata: ReferendumMetadataLocal? + let identities: [AccountAddress: AccountIdentity] + + private var price: PriceData? + private var call: ReferendumActionLocal.Call? + + init( + interactor: ReferendumFullDetailsInteractorInputProtocol, + wireframe: ReferendumFullDetailsWireframeProtocol, + chain: ChainModel, + referendum: ReferendumLocal, + actionDetails: ReferendumActionLocal, + metadata: ReferendumMetadataLocal?, + identities: [AccountAddress: AccountIdentity], + balanceViewModelFactory: BalanceViewModelFactoryProtocol, + addressViewModelFactory: DisplayAddressViewModelFactoryProtocol, + localizationManager: LocalizationManagerProtocol, + logger: LoggerProtocol + ) { + self.interactor = interactor + self.wireframe = wireframe + self.chain = chain + self.referendum = referendum + self.metadata = metadata + self.actionDetails = actionDetails + self.identities = identities + self.logger = logger + self.balanceViewModelFactory = balanceViewModelFactory + self.addressViewModelFactory = addressViewModelFactory + self.localizationManager = localizationManager + } + + private func getAccountViewModel(_ accountId: AccountId?) -> DisplayAddressViewModel? { + guard let accountId = accountId, + let address = try? accountId.toAddress(using: chain.chainFormat) else { + return nil + } + + let displayAddress = DisplayAddress( + address: address, + username: identities[address]?.displayName ?? "" + ) + + return addressViewModelFactory.createViewModel(from: displayAddress) + } + + private func getBalanceViewModel(_ amount: BigUInt?, locale: Locale) -> BalanceViewModelProtocol? { + guard + let amount = amount, + let assetInfo = chain.utilityAsset()?.displayInfo, + let amountDecimal = Decimal.fromSubstrateAmount(amount, precision: assetInfo.assetPrecision) else { + return nil + } + + return balanceViewModelFactory.balanceFromPrice( + amountDecimal, + priceData: price + ).value(for: locale) + } + + private func provideProposerViewModel() { + let optProposerId = referendum.proposer ?? metadata?.proposerAccountId(for: chain.chainFormat) + guard let proposer = getAccountViewModel(optProposerId) else { + view?.didReceive(proposer: nil) + return + } + + let deposit = getBalanceViewModel(referendum.deposit, locale: selectedLocale) + view?.didReceive(proposer: .init(proposer: proposer, deposit: deposit)) + } + + private func provideBeneficiaryViewModel() { + guard + let beneficiary = getAccountViewModel( + actionDetails.amountSpendDetails?.beneficiary.accountId + ), + let amount = getBalanceViewModel( + actionDetails.amountSpendDetails?.amount, + locale: selectedLocale + ) else { + view?.didReceive(beneficiary: nil) + return + } + + view?.didReceive(beneficiary: .init(account: beneficiary, amount: amount)) + } + + private func provideCurveAndHashViewModel() { + guard + let functionInfo = referendum.state.functionInfo(locale: selectedLocale), + let turnout = referendum.state.turnout, + let electorate = referendum.state.electorate, + let turnoutBalance = getBalanceViewModel(turnout, locale: selectedLocale), + let electorateBalance = getBalanceViewModel(electorate, locale: selectedLocale) else { + return + } + + let callHash = referendum.state.callHash + + let model = ReferendumFullDetailsViewModel.Voting( + functionInfo: functionInfo, + turnout: turnoutBalance, + electorate: electorateBalance, + callHash: callHash + ) + + view?.didReceive(params: model) + } + + private func provideJson() { + switch call { + case let .concrete(json): + view?.didReceive(json: json) + case .tooLong: + view?.didReceiveTooLongJson() + case .none: + view?.didReceive(json: nil) + } + } + + private func updateView() { + provideProposerViewModel() + provideBeneficiaryViewModel() + provideCurveAndHashViewModel() + provideJson() + } + + private func presentDetails(for address: AccountAddress) { + guard let view = view else { + return + } + + wireframe.presentAccountOptions( + from: view, + address: address, + chain: chain, + locale: selectedLocale + ) + } +} + +extension ReferendumFullDetailsPresenter: ReferendumFullDetailsPresenterProtocol { + func setup() { + interactor.setup() + updateView() + } + + func presentProposer() { + let optAccountId = referendum.proposer ?? metadata?.proposerAccountId(for: chain.chainFormat) + guard let address = try? optAccountId?.toAddress(using: chain.chainFormat) else { + return + } + + presentDetails(for: address) + } + + func presentBeneficiary() { + guard + let address = try? actionDetails.amountSpendDetails?.beneficiary.accountId?.toAddress( + using: chain.chainFormat + ) else { + return + } + + presentDetails(for: address) + } + + func presentCallHash() { + guard let view = view, let callHash = referendum.state.callHash else { + return + } + + wireframe.presentCopy(from: view, value: callHash, locale: selectedLocale) + } +} + +extension ReferendumFullDetailsPresenter: ReferendumFullDetailsInteractorOutputProtocol { + func didReceive(price: PriceData?) { + self.price = price + + provideProposerViewModel() + provideBeneficiaryViewModel() + provideCurveAndHashViewModel() + } + + func didReceive(call: ReferendumActionLocal.Call?) { + self.call = call + provideJson() + } + + func didReceive(error: ReferendumFullDetailsError) { + logger.error("Did receiver error: \(error)") + + switch error { + case .priceFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case .processingJSON: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.refreshCall() + } + } + } +} + +extension ReferendumFullDetailsPresenter: Localizable { + func applyLocalization() { + if view?.isSetup == true { + updateView() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsProtocols.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsProtocols.swift new file mode 100644 index 0000000000..6f0654fb3b --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsProtocols.swift @@ -0,0 +1,34 @@ +protocol ReferendumFullDetailsViewProtocol: ControllerBackedProtocol { + func didReceive(proposer: ReferendumFullDetailsViewModel.Proposer?) + func didReceive(beneficiary: ReferendumFullDetailsViewModel.Beneficiary?) + func didReceive(params: ReferendumFullDetailsViewModel.Voting?) + func didReceive(json: String?) + func didReceiveTooLongJson() +} + +protocol ReferendumFullDetailsPresenterProtocol: AnyObject { + func setup() + func presentProposer() + func presentBeneficiary() + func presentCallHash() +} + +protocol ReferendumFullDetailsInteractorInputProtocol: AnyObject { + func setup() + func remakeSubscriptions() + func refreshCall() +} + +protocol ReferendumFullDetailsInteractorOutputProtocol: AnyObject { + func didReceive(price: PriceData?) + func didReceive(call: ReferendumActionLocal.Call?) + func didReceive(error: ReferendumFullDetailsError) +} + +protocol ReferendumFullDetailsWireframeProtocol: ErrorPresentable, AlertPresentable, AddressOptionsPresentable, + CommonRetryable, CopyPresentable {} + +enum ReferendumFullDetailsError: Error { + case priceFailed(Error) + case processingJSON(Error) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewController.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewController.swift new file mode 100644 index 0000000000..f007483cc2 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewController.swift @@ -0,0 +1,96 @@ +import UIKit +import SoraFoundation + +final class ReferendumFullDetailsViewController: UIViewController, ViewHolder { + typealias RootViewType = ReferendumFullDetailsViewLayout + + let presenter: ReferendumFullDetailsPresenterProtocol + + init(presenter: ReferendumFullDetailsPresenterProtocol, localizationManager: LocalizationManagerProtocol) { + self.presenter = presenter + super.init(nibName: nil, bundle: nil) + + self.localizationManager = localizationManager + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = ReferendumFullDetailsViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupLocalization() + + presenter.setup() + } + + private func setupLocalization() { + title = R.string.localizable.govFullDetails(preferredLanguages: selectedLocale.rLanguages) + } + + @objc private func actionProposer() { + presenter.presentProposer() + } + + @objc private func actionBeneficiary() { + presenter.presentBeneficiary() + } + + @objc private func actionCallHash() { + presenter.presentCallHash() + } +} + +extension ReferendumFullDetailsViewController: ReferendumFullDetailsViewProtocol { + func didReceive(proposer: ReferendumFullDetailsViewModel.Proposer?) { + rootView.setProposer(viewModel: proposer, locale: selectedLocale) + + rootView.proposerCell?.addTarget( + self, + action: #selector(actionProposer), + for: .touchUpInside + ) + } + + func didReceive(beneficiary: ReferendumFullDetailsViewModel.Beneficiary?) { + rootView.setBeneficiary(viewModel: beneficiary, locale: selectedLocale) + + rootView.beneficiaryCell?.addTarget( + self, + action: #selector(actionBeneficiary), + for: .touchUpInside + ) + } + + func didReceive(params: ReferendumFullDetailsViewModel.Voting?) { + rootView.setVoting(viewModel: params, locale: selectedLocale) + + rootView.callHashCell?.addTarget( + self, + action: #selector(actionCallHash), + for: .touchUpInside + ) + } + + func didReceive(json: String?) { + rootView.setJson(viewModel: json, locale: selectedLocale) + } + + func didReceiveTooLongJson() { + rootView.setTooLongJson(for: selectedLocale) + } +} + +extension ReferendumFullDetailsViewController: Localizable { + func applyLocalization() { + if isViewLoaded { + setupLocalization() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewFactory.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewFactory.swift new file mode 100644 index 0000000000..5417df494d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewFactory.swift @@ -0,0 +1,64 @@ +import Foundation +import SubstrateSdk +import SoraFoundation + +struct ReferendumFullDetailsViewFactory { + static func createView( + state: GovernanceSharedState, + referendum: ReferendumLocal, + actionDetails: ReferendumActionLocal, + metadata: ReferendumMetadataLocal?, + identities: [AccountAddress: AccountIdentity] + ) -> ReferendumFullDetailsViewProtocol? { + guard + let chain = state.settings.value?.chain, + let currencyManager = CurrencyManager.shared, + let assetInfo = chain.utilityAssetDisplayInfo() else { + return nil + } + + let wireframe = ReferendumFullDetailsWireframe() + let processingOperationFactory = PrettyPrintedJSONOperationFactory(preprocessor: ExtrinsicJSONProcessor()) + + let interactor = ReferendumFullDetailsInteractor( + chain: chain, + priceLocalSubscriptionFactory: PriceProviderFactory.shared, + currencyManager: currencyManager, + processingOperationFactory: processingOperationFactory, + referendumAction: actionDetails, + operationQueue: OperationManagerFacade.sharedDefaultQueue + ) + + let localizationManager = LocalizationManager.shared + + let balanceViewModelFactory = BalanceViewModelFactory( + targetAssetInfo: assetInfo, + priceAssetInfoFactory: PriceAssetInfoFactory(currencyManager: currencyManager) + ) + + let presenter = ReferendumFullDetailsPresenter( + interactor: interactor, + wireframe: wireframe, + chain: chain, + referendum: referendum, + actionDetails: actionDetails, + metadata: metadata, + identities: identities, + balanceViewModelFactory: balanceViewModelFactory, + addressViewModelFactory: DisplayAddressViewModelFactory(), + localizationManager: localizationManager, + logger: Logger.shared + ) + + interactor.presenter = presenter + + let view = ReferendumFullDetailsViewController( + presenter: presenter, + localizationManager: localizationManager + ) + + presenter.view = view + + return view + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewLayout.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewLayout.swift new file mode 100644 index 0000000000..d3fb3eee86 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsViewLayout.swift @@ -0,0 +1,293 @@ +import UIKit +import SoraUI + +final class ReferendumFullDetailsViewLayout: UIView { + let containerView: ScrollableContainerView = { + let view = ScrollableContainerView(axis: .vertical, respectsSafeArea: true) + view.stackView.layoutMargins = UIEdgeInsets(top: 16, left: 16, bottom: 24, right: 16) + view.stackView.isLayoutMarginsRelativeArrangement = true + view.stackView.alignment = .fill + return view + }() + + private(set) var proposerTableView: StackTableView? + private(set) var beneficiaryTableView: StackTableView? + private(set) var curveAndHashTableView: StackTableView? + + private(set) var proposerCell: StackInfoTableCell? + private(set) var beneficiaryCell: StackInfoTableCell? + private(set) var callHashCell: StackInfoTableCell? + + private(set) var jsonView: UIView? + + override init(frame: CGRect) { + super.init(frame: frame) + + setup() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setup() { + addSubview(containerView) + containerView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } + + func setProposer(viewModel: ReferendumFullDetailsViewModel.Proposer?, locale: Locale) { + proposerTableView?.clear() + proposerCell = nil + + if let viewModel = viewModel { + if proposerTableView == nil { + let tableView = StackTableView() + containerView.stackView.insertArrangedSubview(tableView, at: 0) + proposerTableView = tableView + } + + let proposerCell = createAccountCell( + with: R.string.localizable.govProposer(preferredLanguages: locale.rLanguages), + viewModel: viewModel.proposer + ) + + self.proposerCell = proposerCell + + proposerTableView?.addArrangedSubview(proposerCell) + + if let deposit = viewModel.deposit { + let depositCell = createBalanceCell( + with: R.string.localizable.govDeposit(preferredLanguages: locale.rLanguages), + viewModel: deposit + ) + proposerTableView?.addArrangedSubview(depositCell) + } + } else { + proposerTableView?.removeFromSuperview() + proposerTableView = nil + } + + updateLayout() + } + + func setBeneficiary(viewModel: ReferendumFullDetailsViewModel.Beneficiary?, locale: Locale) { + beneficiaryTableView?.clear() + beneficiaryCell = nil + + if let viewModel = viewModel { + if beneficiaryTableView == nil { + let tableView = StackTableView() + insertView(tableView, afterOneOf: [proposerTableView]) + beneficiaryTableView = tableView + } + + let beneficiaryCell = createAccountCell( + with: R.string.localizable.govBeneficiary(preferredLanguages: locale.rLanguages), + viewModel: viewModel.account + ) + + self.beneficiaryCell = beneficiaryCell + + beneficiaryTableView?.addArrangedSubview(beneficiaryCell) + + if let amount = viewModel.amount { + let amountCell = createBalanceCell( + with: R.string.localizable.commonRequestedAmount(preferredLanguages: locale.rLanguages), + viewModel: amount + ) + + beneficiaryTableView?.addArrangedSubview(amountCell) + } + } else { + beneficiaryTableView?.removeFromSuperview() + beneficiaryTableView = nil + } + + updateLayout() + } + + func setVoting(viewModel: ReferendumFullDetailsViewModel.Voting?, locale: Locale) { + curveAndHashTableView?.clear() + callHashCell = nil + + if let viewModel = viewModel { + if curveAndHashTableView == nil { + let tableView = StackTableView() + insertView(tableView, afterOneOf: [beneficiaryTableView, proposerTableView]) + curveAndHashTableView = tableView + } + createVotingCells(viewModel: viewModel.functionInfo, locale: locale).forEach { + curveAndHashTableView?.addArrangedSubview($0) + } + let turnoutCell = createBalanceCell( + with: R.string.localizable.govTurnout(preferredLanguages: locale.rLanguages), + viewModel: viewModel.turnout + ) + let elecorateCell = createBalanceCell( + with: R.string.localizable.govElectorate(preferredLanguages: locale.rLanguages), + viewModel: viewModel.electorate + ) + curveAndHashTableView?.addArrangedSubview(turnoutCell) + curveAndHashTableView?.addArrangedSubview(elecorateCell) + if let callHash = viewModel.callHash { + let callHashCell = createInfoCell( + with: R.string.localizable.govCallHash(preferredLanguages: locale.rLanguages), + value: callHash + ) + + callHashCell.detailsLabel.lineBreakMode = .byTruncatingMiddle + + curveAndHashTableView?.addArrangedSubview(callHashCell) + self.callHashCell = callHashCell + } + } else { + curveAndHashTableView?.removeFromSuperview() + curveAndHashTableView = nil + } + + updateLayout() + } + + func setJson(viewModel: String?, locale: Locale) { + jsonView?.removeFromSuperview() + jsonView = nil + + if let viewModel = viewModel { + let jsonView: GenericMultiValueView> = .create { + $0.valueTop.apply(style: .caption1White64) + $0.valueTop.textAlignment = .left + $0.spacing = 12.0 + + let textView = $0.valueBottom.view + textView.isEditable = false + textView.textContainerInset = .zero + textView.textContainer.lineFragmentPadding = 0 + textView.isScrollEnabled = false + textView.backgroundColor = .clear + textView.textAlignment = .left + + $0.valueBottom.contentInsets = .zero + $0.valueBottom.innerInsets = UIEdgeInsets(top: 12, left: 12, bottom: 12, right: 12) + } + + jsonView.valueTop.text = R.string.localizable.govParametersJson(preferredLanguages: locale.rLanguages) + + jsonView.valueBottom.view.text = viewModel + containerView.stackView.addArrangedSubview(jsonView) + + self.jsonView = jsonView + } + } + + func setTooLongJson(for locale: Locale) { + jsonView?.removeFromSuperview() + + let jsonView: GenericMultiValueView> = .create { + $0.valueTop.apply(style: .caption1White64) + $0.valueTop.textAlignment = .left + $0.spacing = 12.0 + + let emptyStateView = $0.valueBottom.view + emptyStateView.layoutType = .verticalImageFirst + emptyStateView.iconImage = R.image.iconEmptySearch()! + emptyStateView.titleFont = .regularFootnote + emptyStateView.titleColor = R.color.colorWhite64()! + emptyStateView.spacingBetweenLabelAndIcon = 0 + + $0.valueBottom.contentInsets = .zero + $0.valueBottom.innerInsets = UIEdgeInsets(top: 12, left: 12, bottom: 24, right: 12) + } + + jsonView.valueTop.text = R.string.localizable.govParametersJson(preferredLanguages: locale.rLanguages) + + jsonView.valueBottom.view.title = R.string.localizable.commonTooLongPreview( + preferredLanguages: locale.rLanguages + ) + + containerView.stackView.addArrangedSubview(jsonView) + + self.jsonView = jsonView + } + + private func createVotingCells( + viewModel: ReferendumFullDetailsViewModel.FunctionInfo, + locale: Locale + ) -> [StackTableViewCellProtocol] { + switch viewModel { + case let .supportAndVotes(approveCurve, supportCurve): + let approveCurveCell = createTitleValueCell( + with: R.string.localizable.govApproveCurve(preferredLanguages: locale.rLanguages), + value: approveCurve + ) + let supportCurveCell = createTitleValueCell( + with: R.string.localizable.govSupportCurve(preferredLanguages: locale.rLanguages), + value: supportCurve + ) + return [approveCurveCell, supportCurveCell] + case let .threshold(function): + let thresholdFunctionCell = createTitleValueCell( + with: R.string.localizable.govVoteThreshold(preferredLanguages: locale.rLanguages), + value: function + ) + return [thresholdFunctionCell] + } + } + + private func insertView(_ view: UIView, afterOneOf subviews: [UIView?]) { + if let optSubview = subviews.first(where: { $0 != nil }), let subview = optSubview { + containerView.stackView.insertArranged(view: view, after: subview) + } else { + containerView.stackView.insertArrangedSubview(view, at: 0) + } + } + + private func createAccountCell(with title: String, viewModel: DisplayAddressViewModel) -> StackInfoTableCell { + let cell = StackInfoTableCell() + cell.titleLabel.text = title + cell.detailsLabel.lineBreakMode = viewModel.lineBreakMode + cell.bind(viewModel: viewModel.cellViewModel) + return cell + } + + private func createBalanceCell( + with title: String, + viewModel: BalanceViewModelProtocol + ) -> StackTitleMultiValueCell { + let cell = StackTitleMultiValueCell() + cell.canSelect = false + cell.titleLabel.text = title + cell.rowContentView.valueView.bind(topValue: viewModel.amount, bottomValue: viewModel.price) + cell.rowContentView.titleView.hidesIcon = true + return cell + } + + private func createTitleValueCell(with title: String, value: String) -> StackTableCell { + let cell = StackTableCell() + cell.titleLabel.text = title + cell.bind(details: value) + return cell + } + + private func createInfoCell(with title: String, value: String) -> StackInfoTableCell { + let cell = StackInfoTableCell() + cell.titleLabel.text = title + cell.bind(details: value) + return cell + } + + private func updateLayout() { + let views: [UIView?] = [proposerTableView, beneficiaryTableView, curveAndHashTableView] + views.forEach { + if let view = $0 { + containerView.stackView.setCustomSpacing(8.0, after: view) + } + } + + if let optView = views.reversed().first(where: { $0 != nil }), let lastView = optView { + containerView.stackView.setCustomSpacing(24.0, after: lastView) + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsWireframe.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsWireframe.swift new file mode 100644 index 0000000000..d6a6aed886 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumFullDetailsWireframe.swift @@ -0,0 +1,3 @@ +import Foundation + +final class ReferendumFullDetailsWireframe: ReferendumFullDetailsWireframeProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumStateLocal+Presenter.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumStateLocal+Presenter.swift new file mode 100644 index 0000000000..300c5c0caf --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ReferendumStateLocal+Presenter.swift @@ -0,0 +1,105 @@ +import Foundation +import BigInt + +extension ReferendumStateLocal { + func functionInfo(locale: Locale) -> ReferendumFullDetailsViewModel.FunctionInfo? { + switch voting { + case let .supportAndVotes(model): + guard let supportCurve = model.supportFunction?.curve, + let approvalCurve = model.approvalFunction?.curve else { + return nil + } + return .supportAndVotes( + approveCurve: approvalCurve.displayName(for: locale), + supportCurve: supportCurve.displayName(for: locale) + ) + case let .threshold(model): + let thresholdTypeName = model.thresholdFunction.thresholdType.displayName(for: locale) + return .threshold(function: thresholdTypeName) + case .none: + return nil + } + } + + var electorate: BigUInt? { + switch voting { + case let .supportAndVotes(model): + return model.totalIssuance + case let .threshold(model): + return model.electorate + case .none: + return nil + } + } + + var turnout: BigUInt? { + switch voting { + case let .supportAndVotes(model): + return model.support + case let .threshold(model): + return model.turnout + case .none: + return nil + } + } + + var callHash: String? { + switch proposal { + case let .lookup(lookup): + return lookup.hash.toHex(includePrefix: true) + case let .legacy(hash): + return hash.toHex(includePrefix: true) + case .inline, .unknown, .none: + return nil + } + } + + var voting: Voting? { + switch self { + case let .preparing(model): + return model.voting + case let .deciding(model): + return model.voting + case .approved, + .rejected, + .cancelled, + .timedOut, + .killed, + .executed: + return nil + } + } +} + +extension Referenda.Curve { + func displayName(for locale: Locale) -> String { + switch self { + case .linearDecreasing: + return R.string.localizable.govLinearDecreasing(preferredLanguages: locale.rLanguages) + case .reciprocal: + return R.string.localizable.govReciprocal(preferredLanguages: locale.rLanguages) + case .steppedDecreasing: + return R.string.localizable.govSteppedDecreasing(preferredLanguages: locale.rLanguages) + case .unknown: + return R.string.localizable.commonUnknown(preferredLanguages: locale.rLanguages) + } + } +} + +extension Democracy.VoteThreshold { + func displayName(for locale: Locale) -> String { + switch self { + case .simpleMajority: + return R.string.localizable.govVoteTresholdFunctionSimpleMajority(preferredLanguages: locale.rLanguages) + case .superMajorityAgainst: + return R.string.localizable.govVoteTresholdFunctionSuperMajorityAgainst( + preferredLanguages: locale.rLanguages) + case .superMajorityApprove: + return R.string.localizable.govVoteTresholdFunctionSuperMajorityApprove( + preferredLanguages: locale.rLanguages) + case .unknown: + return R.string.localizable.commonUnknown( + preferredLanguages: locale.rLanguages) + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ViewModel/ReferendumFullDetailsViewModel.swift b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ViewModel/ReferendumFullDetailsViewModel.swift new file mode 100644 index 0000000000..f24054b289 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumFullDetails/ViewModel/ReferendumFullDetailsViewModel.swift @@ -0,0 +1,25 @@ +import Foundation + +enum ReferendumFullDetailsViewModel { + struct Proposer { + let proposer: DisplayAddressViewModel + let deposit: BalanceViewModelProtocol? + } + + struct Beneficiary { + let account: DisplayAddressViewModel + let amount: BalanceViewModelProtocol? + } + + struct Voting { + let functionInfo: FunctionInfo + let turnout: BalanceViewModelProtocol + let electorate: BalanceViewModelProtocol + let callHash: String? + } + + enum FunctionInfo { + case supportAndVotes(approveCurve: String, supportCurve: String) + case threshold(function: String) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteInteractor.swift b/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteInteractor.swift new file mode 100644 index 0000000000..df422392c4 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteInteractor.swift @@ -0,0 +1,332 @@ +import Foundation +import RobinHood +import BigInt +import SubstrateSdk + +class ReferendumVoteInteractor: AnyCancellableCleaning { + weak var basePresenter: ReferendumVoteInteractorOutputProtocol? + + let referendumIndex: ReferendumIdLocal + let selectedAccount: MetaChainAccountResponse + let chain: ChainModel + let referendumsSubscriptionFactory: GovernanceSubscriptionFactoryProtocol + let walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol + let priceLocalSubscriptionFactory: PriceProviderFactoryProtocol + let extrinsicService: ExtrinsicServiceProtocol + let feeProxy: ExtrinsicFeeProxyProtocol + let extrinsicFactory: GovernanceExtrinsicFactoryProtocol + let generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol + let blockTimeService: BlockTimeEstimationServiceProtocol + let blockTimeFactory: BlockTimeOperationFactoryProtocol + let lockStateFactory: GovernanceLockStateFactoryProtocol + let connection: JSONRPCEngine + let runtimeProvider: RuntimeProviderProtocol + let operationQueue: OperationQueue + + private var priceProvider: AnySingleValueProvider? + private var assetBalanceProvider: StreamableProvider? + private var blockNumberProvider: AnyDataProvider? + + private var blockTimeCancellable: CancellableCall? + private var lockDiffCancellable: CancellableCall? + + init( + referendumIndex: ReferendumIdLocal, + selectedAccount: MetaChainAccountResponse, + chain: ChainModel, + generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol, + referendumsSubscriptionFactory: GovernanceSubscriptionFactoryProtocol, + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol, + priceLocalSubscriptionFactory: PriceProviderFactoryProtocol, + blockTimeService: BlockTimeEstimationServiceProtocol, + blockTimeFactory: BlockTimeOperationFactoryProtocol, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + currencyManager: CurrencyManagerProtocol, + extrinsicFactory: GovernanceExtrinsicFactoryProtocol, + extrinsicService: ExtrinsicServiceProtocol, + feeProxy: ExtrinsicFeeProxyProtocol, + lockStateFactory: GovernanceLockStateFactoryProtocol, + operationQueue: OperationQueue + ) { + self.referendumIndex = referendumIndex + self.selectedAccount = selectedAccount + self.chain = chain + self.generalLocalSubscriptionFactory = generalLocalSubscriptionFactory + self.blockTimeService = blockTimeService + self.blockTimeFactory = blockTimeFactory + self.connection = connection + self.runtimeProvider = runtimeProvider + self.referendumsSubscriptionFactory = referendumsSubscriptionFactory + self.walletLocalSubscriptionFactory = walletLocalSubscriptionFactory + self.priceLocalSubscriptionFactory = priceLocalSubscriptionFactory + self.extrinsicFactory = extrinsicFactory + self.extrinsicService = extrinsicService + self.feeProxy = feeProxy + self.lockStateFactory = lockStateFactory + self.operationQueue = operationQueue + self.currencyManager = currencyManager + } + + deinit { + clearReferendumSubscriptions() + clearCancellable() + } + + private func clearCancellable() { + clear(cancellable: &blockTimeCancellable) + clear(cancellable: &lockDiffCancellable) + } + + private func clearReferendumSubscriptions() { + referendumsSubscriptionFactory.unsubscribeFromReferendum(self, referendumIndex: referendumIndex) + + referendumsSubscriptionFactory.unsubscribeFromAccountVotes( + self, + accountId: selectedAccount.chainAccount.accountId + ) + } + + private func provideBlockTime() { + guard blockTimeCancellable == nil else { + return + } + + let wrapper = blockTimeFactory.createBlockTimeOperation( + from: runtimeProvider, + blockTimeEstimationService: blockTimeService + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.blockTimeCancellable else { + return + } + + self?.blockTimeCancellable = nil + + do { + let blockTimeModel = try wrapper.targetOperation.extractNoCancellableResultData() + self?.basePresenter?.didReceiveBlockTime(blockTimeModel) + } catch { + self?.basePresenter?.didReceiveBaseError(.blockTimeFailed(error)) + } + } + } + + blockTimeCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + private func subscribeAccountVotes() { + referendumsSubscriptionFactory.subscribeToAccountVotes( + self, + accountId: selectedAccount.chainAccount.accountId + ) { [weak self] result in + switch result { + case let .success(storageResult): + self?.basePresenter?.didReceiveAccountVotes(storageResult) + case let .failure(error): + self?.basePresenter?.didReceiveBaseError(.accountVotesFailed(error)) + case .none: + self?.basePresenter?.didReceiveAccountVotes(.init(value: nil, blockHash: nil)) + } + } + } + + private func clearAndSubscribeBlockNumber() { + blockNumberProvider?.removeObserver(self) + blockNumberProvider = nil + + blockNumberProvider = subscribeToBlockNumber(for: chain.chainId) + } + + private func clearAndSubscribeBalance() { + assetBalanceProvider?.removeObserver(self) + assetBalanceProvider = nil + + if let asset = chain.utilityAsset() { + assetBalanceProvider = subscribeToAssetBalanceProvider( + for: selectedAccount.chainAccount.accountId, + chainId: chain.chainId, + assetId: asset.assetId + ) + } + } + + private func clearAndSubscribePrice() { + priceProvider?.removeObserver(self) + priceProvider = nil + + if let priceId = chain.utilityAsset()?.priceId { + priceProvider = subscribeToPrice(for: priceId, currency: selectedCurrency) + } + } + + private func subscribeReferendum() { + referendumsSubscriptionFactory.subscribeToReferendum( + self, referendumIndex: referendumIndex + ) { [weak self] result in + switch result { + case let .success(storageResult): + if let referendum = storageResult.value { + self?.basePresenter?.didReceiveVotingReferendum(referendum) + } + case let .failure(error): + self?.basePresenter?.didReceiveBaseError(.votingReferendumFailed(error)) + case .none: + break + } + } + } + + private func makeSubscriptions() { + clearAndSubscribeBalance() + clearAndSubscribePrice() + clearAndSubscribeBlockNumber() + + clearReferendumSubscriptions() + subscribeReferendum() + subscribeAccountVotes() + } + + func setup() { + feeProxy.delegate = self + + makeSubscriptions() + } + + func remakeSubscriptions() { + makeSubscriptions() + } + + func handleAccountLocks( + result _: Result<[DataProviderChange], Error>, + accountId _: AccountId, + chainId _: ChainModel.Id, + assetId _: AssetModel.Id + ) {} +} + +extension ReferendumVoteInteractor: ReferendumVoteInteractorInputProtocol { + func estimateFee(for vote: ReferendumVoteAction) { + let reuseIdentifier = "\(vote.hashValue)" + + feeProxy.estimateFee(using: extrinsicService, reuseIdentifier: reuseIdentifier) { [weak self] builder in + guard let strongSelf = self else { + return builder + } + + return try strongSelf.extrinsicFactory.vote( + vote, + referendum: strongSelf.referendumIndex, + builder: builder + ) + } + } + + func refreshLockDiff( + for trackVoting: ReferendumTracksVotingDistribution, + newVote: ReferendumNewVote?, + blockHash: Data? + ) { + clear(cancellable: &lockDiffCancellable) + + let wrapper = lockStateFactory.calculateLockStateDiff( + for: trackVoting, + newVote: newVote, + from: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.lockDiffCancellable else { + return + } + + self?.lockDiffCancellable = nil + + do { + let stateDiff = try wrapper.targetOperation.extractNoCancellableResultData() + self?.basePresenter?.didReceiveLockStateDiff(stateDiff) + } catch { + self?.basePresenter?.didReceiveBaseError(.stateDiffFailed(error)) + } + } + } + + lockDiffCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + func refreshBlockTime() { + provideBlockTime() + } +} + +extension ReferendumVoteInteractor: WalletLocalSubscriptionHandler, WalletLocalStorageSubscriber { + func handleAssetBalance( + result: Result, + accountId _: AccountId, + chainId _: ChainModel.Id, + assetId _: AssetModel.Id + ) { + switch result { + case let .success(balance): + basePresenter?.didReceiveAssetBalance(balance) + case let .failure(error): + basePresenter?.didReceiveBaseError(.assetBalanceFailed(error)) + } + } +} + +extension ReferendumVoteInteractor: PriceLocalSubscriptionHandler, PriceLocalStorageSubscriber { + func handlePrice(result: Result, priceId _: AssetModel.PriceId) { + switch result { + case let .success(price): + basePresenter?.didReceivePrice(price) + case let .failure(error): + basePresenter?.didReceiveBaseError(.priceFailed(error)) + } + } +} + +extension ReferendumVoteInteractor: ExtrinsicFeeProxyDelegate { + func didReceiveFee(result: Result, for _: ExtrinsicFeeId) { + switch result { + case let .success(dispatchInfo): + if let fee = BigUInt(dispatchInfo.fee) { + basePresenter?.didReceiveFee(fee) + } + case let .failure(error): + basePresenter?.didReceiveBaseError(.feeFailed(error)) + } + } +} + +extension ReferendumVoteInteractor: GeneralLocalStorageSubscriber, GeneralLocalStorageHandler { + func handleBlockNumber(result: Result, chainId _: ChainModel.Id) { + switch result { + case let .success(blockNumber): + if let blockNumber = blockNumber { + basePresenter?.didReceiveBlockNumber(blockNumber) + } + case let .failure(error): + basePresenter?.didReceiveBaseError(.blockNumberSubscriptionFailed(error)) + } + } +} + +extension ReferendumVoteInteractor: SelectedCurrencyDepending { + func applyCurrency() { + guard basePresenter != nil else { + return + } + + clearAndSubscribePrice() + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteInteractorError.swift b/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteInteractorError.swift new file mode 100644 index 0000000000..32c89e1279 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteInteractorError.swift @@ -0,0 +1,12 @@ +import Foundation + +enum ReferendumVoteInteractorError: Error { + case assetBalanceFailed(_ internalError: Error) + case priceFailed(_ internalError: Error) + case votingReferendumFailed(_ internalError: Error) + case feeFailed(_ internalError: Error) + case accountVotesFailed(_ internalError: Error) + case blockNumberSubscriptionFailed(_ internalError: Error) + case blockTimeFailed(_ internalError: Error) + case stateDiffFailed(_ internalError: Error) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteProtocols.swift b/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteProtocols.swift new file mode 100644 index 0000000000..131e86fbeb --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVote/ReferendumVoteProtocols.swift @@ -0,0 +1,28 @@ +import Foundation +import BigInt + +protocol ReferendumVoteInteractorInputProtocol: AnyObject { + func setup() + func remakeSubscriptions() + func estimateFee(for vote: ReferendumVoteAction) + func refreshLockDiff( + for trackVoting: ReferendumTracksVotingDistribution, + newVote: ReferendumNewVote?, + blockHash: Data? + ) + func refreshBlockTime() +} + +protocol ReferendumVoteInteractorOutputProtocol: AnyObject { + func didReceiveAssetBalance(_ balance: AssetBalance?) + func didReceivePrice(_ price: PriceData?) + func didReceiveVotingReferendum(_ referendum: ReferendumLocal) + func didReceiveFee(_ fee: BigUInt) + func didReceiveLockStateDiff(_ stateDiff: GovernanceLockStateDiff) + func didReceiveAccountVotes( + _ votes: CallbackStorageSubscriptionResult + ) + func didReceiveBlockNumber(_ number: BlockNumber) + func didReceiveBlockTime(_ blockTime: BlockTime) + func didReceiveBaseError(_ error: ReferendumVoteInteractorError) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/Model/ReferendumVoteConfirmError.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/Model/ReferendumVoteConfirmError.swift new file mode 100644 index 0000000000..5e6b750d28 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/Model/ReferendumVoteConfirmError.swift @@ -0,0 +1,6 @@ +import Foundation + +enum ReferendumVoteConfirmError: Error { + case locksSubscriptionFailed(_ internalError: Error) + case submitVoteFailed(_ internalError: Error) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmInteractor.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmInteractor.swift new file mode 100644 index 0000000000..50663fb24f --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmInteractor.swift @@ -0,0 +1,129 @@ +import UIKit +import SubstrateSdk +import RobinHood + +final class ReferendumVoteConfirmInteractor: ReferendumVoteInteractor { + var presenter: ReferendumVoteConfirmInteractorOutputProtocol? { + get { + basePresenter as? ReferendumVoteConfirmInteractorOutputProtocol + } + + set { + basePresenter = newValue + } + } + + let signer: SigningWrapperProtocol + + private var locksSubscription: StreamableProvider? + + init( + referendumIndex: ReferendumIdLocal, + selectedAccount: MetaChainAccountResponse, + chain: ChainModel, + generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol, + referendumsSubscriptionFactory: GovernanceSubscriptionFactoryProtocol, + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol, + priceLocalSubscriptionFactory: PriceProviderFactoryProtocol, + blockTimeService: BlockTimeEstimationServiceProtocol, + blockTimeFactory: BlockTimeOperationFactoryProtocol, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + currencyManager: CurrencyManagerProtocol, + extrinsicFactory: GovernanceExtrinsicFactoryProtocol, + extrinsicService: ExtrinsicServiceProtocol, + signer: SigningWrapperProtocol, + feeProxy: ExtrinsicFeeProxyProtocol, + lockStateFactory: GovernanceLockStateFactoryProtocol, + operationQueue: OperationQueue + ) { + self.signer = signer + + super.init( + referendumIndex: referendumIndex, + selectedAccount: selectedAccount, + chain: chain, + generalLocalSubscriptionFactory: generalLocalSubscriptionFactory, + referendumsSubscriptionFactory: referendumsSubscriptionFactory, + walletLocalSubscriptionFactory: walletLocalSubscriptionFactory, + priceLocalSubscriptionFactory: priceLocalSubscriptionFactory, + blockTimeService: blockTimeService, + blockTimeFactory: blockTimeFactory, + connection: connection, + runtimeProvider: runtimeProvider, + currencyManager: currencyManager, + extrinsicFactory: extrinsicFactory, + extrinsicService: extrinsicService, + feeProxy: feeProxy, + lockStateFactory: lockStateFactory, + operationQueue: operationQueue + ) + } + + private func clearAndSubscribeLocks() { + locksSubscription?.removeObserver(self) + locksSubscription = nil + + guard let asset = chain.utilityAsset() else { + return + } + + locksSubscription = subscribeToLocksProvider( + for: selectedAccount.chainAccount.accountId, + chainId: chain.chainId, + assetId: asset.assetId + ) + } + + override func setup() { + super.setup() + + clearAndSubscribeLocks() + } + + override func remakeSubscriptions() { + super.remakeSubscriptions() + + clearAndSubscribeLocks() + } + + override func handleAccountLocks( + result: Result<[DataProviderChange], Error>, + accountId _: AccountId, + chainId _: ChainModel.Id, + assetId _: AssetModel.Id + ) { + switch result { + case let .success(changes): + let locks = changes.mergeToDict([:]).values + presenter?.didReceiveLocks(Array(locks)) + case let .failure(error): + presenter?.didReceiveError(.locksSubscriptionFailed(error)) + } + } +} + +extension ReferendumVoteConfirmInteractor: ReferendumVoteConfirmInteractorInputProtocol { + func submit(vote: ReferendumVoteAction) { + let closure: ExtrinsicBuilderClosure = { [weak self] builder in + guard let strongSelf = self else { + return builder + } + + return try strongSelf.extrinsicFactory.vote( + vote, + referendum: strongSelf.referendumIndex, + builder: builder + ) + } + + extrinsicService.submit(closure, signer: signer, runningIn: .main) { [weak self] result in + switch result { + case let .success(hash): + self?.presenter?.didReceiveVotingHash(hash) + case let .failure(error): + self?.presenter?.didReceiveError(.submitVoteFailed(error)) + } + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmPresenter.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmPresenter.swift new file mode 100644 index 0000000000..2a757438f8 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmPresenter.swift @@ -0,0 +1,408 @@ +import Foundation +import BigInt +import SoraFoundation + +final class ReferendumVoteConfirmPresenter { + weak var view: ReferendumVoteConfirmViewProtocol? + let wireframe: ReferendumVoteConfirmWireframeProtocol + let interactor: ReferendumVoteConfirmInteractorInputProtocol + + let chain: ChainModel + let selectedAccount: MetaChainAccountResponse + let vote: ReferendumNewVote + + let balanceViewModelFactory: BalanceViewModelFactoryProtocol + let referendumFormatter: LocalizableResource + let referendumStringsViewModelFactory: ReferendumDisplayStringFactoryProtocol + let lockChangeViewModelFactory: ReferendumLockChangeViewModelFactoryProtocol + let dataValidatingFactory: GovernanceValidatorFactoryProtocol + let logger: LoggerProtocol + + private var assetBalance: AssetBalance? + private var fee: BigUInt? + private var priceData: PriceData? + private var votesResult: CallbackStorageSubscriptionResult? + private var blockNumber: BlockNumber? + private var blockTime: BlockTime? + private var referendum: ReferendumLocal? + private var lockDiff: GovernanceLockStateDiff? + private var assetLocks: AssetLocks? + + private lazy var walletDisplayViewModelFactory = WalletAccountViewModelFactory() + private lazy var addressDisplayViewModelFactory = DisplayAddressViewModelFactory() + + init( + initData: ReferendumVotingInitData, + vote: ReferendumNewVote, + chain: ChainModel, + selectedAccount: MetaChainAccountResponse, + dataValidatingFactory: GovernanceValidatorFactoryProtocol, + balanceViewModelFactory: BalanceViewModelFactoryProtocol, + referendumFormatter: LocalizableResource, + referendumStringsViewModelFactory: ReferendumDisplayStringFactoryProtocol, + lockChangeViewModelFactory: ReferendumLockChangeViewModelFactoryProtocol, + interactor: ReferendumVoteConfirmInteractorInputProtocol, + wireframe: ReferendumVoteConfirmWireframeProtocol, + localizationManager: LocalizationManagerProtocol, + logger: LoggerProtocol + ) { + self.vote = vote + self.chain = chain + self.selectedAccount = selectedAccount + votesResult = initData.votesResult + blockNumber = initData.blockNumber + blockTime = initData.blockTime + referendum = initData.referendum + lockDiff = initData.lockDiff + self.dataValidatingFactory = dataValidatingFactory + self.balanceViewModelFactory = balanceViewModelFactory + self.referendumFormatter = referendumFormatter + self.referendumStringsViewModelFactory = referendumStringsViewModelFactory + self.lockChangeViewModelFactory = lockChangeViewModelFactory + self.interactor = interactor + self.wireframe = wireframe + self.logger = logger + self.localizationManager = localizationManager + } + + private func provideReferendumIndex() { + let referendumString = referendumFormatter.value(for: selectedLocale).string(from: vote.index as NSNumber) + view?.didReceive(referendumNumber: referendumString ?? "") + } + + private func provideAmountViewModel() { + guard + let precision = chain.utilityAsset()?.displayInfo.assetPrecision, + let decimalAmount = Decimal.fromSubstrateAmount( + vote.voteAction.amount, + precision: precision + ) else { + return + } + + let viewModel = balanceViewModelFactory.balanceFromPrice( + decimalAmount, + priceData: priceData + ).value(for: selectedLocale) + + view?.didReceiveAmount(viewModel: viewModel) + } + + private func provideWalletViewModel() { + guard let viewModel = try? walletDisplayViewModelFactory.createDisplayViewModel(from: selectedAccount) else { + return + } + + view?.didReceiveWallet(viewModel: viewModel.cellViewModel) + } + + private func provideAccountViewModel() { + guard let address = selectedAccount.chainAccount.toAddress() else { + return + } + + let viewModel = addressDisplayViewModelFactory.createViewModel(from: address) + view?.didReceiveAccount(viewModel: viewModel) + } + + private func provideFeeViewModel() { + if let fee = fee { + guard let precision = chain.utilityAsset()?.displayInfo.assetPrecision else { + return + } + + let feeDecimal = Decimal.fromSubstrateAmount( + fee, + precision: precision + ) ?? 0.0 + + let viewModel = balanceViewModelFactory.balanceFromPrice(feeDecimal, priceData: priceData) + .value(for: selectedLocale) + + view?.didReceiveFee(viewModel: viewModel) + } else { + view?.didReceiveFee(viewModel: nil) + } + } + + private func provideYourVoteViewModel() { + let votesString = referendumStringsViewModelFactory.createVotes( + from: vote.voteAction.conviction.votes(for: vote.voteAction.amount) ?? 0, + chain: chain, + locale: selectedLocale + ) + + let convictionString = referendumStringsViewModelFactory.createVotesDetails( + from: vote.voteAction.amount, + conviction: vote.voteAction.conviction.decimalValue, + chain: chain, + locale: selectedLocale + ) + + let voteSideString: String + let voteSideStyle: YourVoteView.Style + + if vote.voteAction.isAye { + voteSideString = R.string.localizable.governanceAye(preferredLanguages: selectedLocale.rLanguages) + voteSideStyle = .ayeInverse + } else { + voteSideString = R.string.localizable.governanceNay(preferredLanguages: selectedLocale.rLanguages) + voteSideStyle = .nayInverse + } + + let voteDescription = R.string.localizable.govYourVote(preferredLanguages: selectedLocale.rLanguages) + + let viewModel = YourVoteRow.Model( + vote: .init(title: voteSideString.uppercased(), description: voteDescription, style: voteSideStyle), + amount: .init(topValue: votesString ?? "", bottomValue: convictionString) + ) + + view?.didReceiveYourVote(viewModel: viewModel) + } + + private func provideTransferableAmountViewModel() { + guard + let assetBalance = assetBalance, + let assetLocks = assetLocks, + let lockDiff = lockDiff, + let viewModel = lockChangeViewModelFactory.createTransferableAmountViewModel( + from: lockDiff, + balance: assetBalance, + locks: assetLocks, + locale: selectedLocale + ) else { + return + } + + view?.didReceiveTransferableAmount(viewModel: viewModel) + } + + private func provideLockedAmountViewModel() { + guard + let lockDiff = lockDiff, + let viewModel = lockChangeViewModelFactory.createAmountViewModel( + from: lockDiff, + locale: selectedLocale + ) else { + return + } + + view?.didReceiveLockedAmount(viewModel: viewModel) + } + + private func provideLockedPeriodViewModel() { + guard + let lockDiff = lockDiff, + let blockNumber = blockNumber, + let blockTime = blockTime, + let viewModel = lockChangeViewModelFactory.createPeriodViewModel( + from: lockDiff, + blockNumber: blockNumber, + blockTime: blockTime, + locale: selectedLocale + ) else { + return + } + + view?.didReceiveLockedPeriod(viewModel: viewModel) + } + + private func refreshFee() { + interactor.estimateFee(for: vote.voteAction) + } + + private func refreshLockDiff() { + guard let trackVoting = votesResult?.value else { + return + } + + interactor.refreshLockDiff( + for: trackVoting, + newVote: vote, + blockHash: votesResult?.blockHash + ) + } + + private func updateView() { + provideReferendumIndex() + provideAmountViewModel() + provideWalletViewModel() + provideAccountViewModel() + provideFeeViewModel() + provideYourVoteViewModel() + provideTransferableAmountViewModel() + provideLockedAmountViewModel() + provideLockedPeriodViewModel() + } +} + +extension ReferendumVoteConfirmPresenter: ReferendumVoteConfirmPresenterProtocol { + func setup() { + updateView() + + interactor.setup() + + refreshFee() + } + + func confirm() { + guard let assetInfo = chain.utilityAssetDisplayInfo() else { + return + } + + let params = GovernanceVoteValidatingParams( + assetBalance: assetBalance, + referendum: referendum, + newVote: vote, + fee: fee, + votes: votesResult?.value?.votes, + assetInfo: assetInfo + ) + + DataValidationRunner.validateVote( + factory: dataValidatingFactory, + params: params, + selectedLocale: selectedLocale, + feeErrorClosure: { [weak self] in + self?.refreshFee() + }, successClosure: { [weak self] in + guard let strongSelf = self else { + return + } + + strongSelf.view?.didStartLoading() + + strongSelf.interactor.submit(vote: strongSelf.vote.voteAction) + } + ) + } + + func presentSenderDetails() { + guard + let address = try? selectedAccount.chainAccount.accountId.toAddress(using: chain.chainFormat), + let view = view else { + return + } + + wireframe.presentAccountOptions( + from: view, + address: address, + chain: chain, + locale: selectedLocale + ) + } +} + +extension ReferendumVoteConfirmPresenter: ReferendumVoteConfirmInteractorOutputProtocol { + func didReceiveAssetBalance(_ assetBalance: AssetBalance?) { + self.assetBalance = assetBalance + } + + func didReceivePrice(_ priceData: PriceData?) { + self.priceData = priceData + + provideAmountViewModel() + provideFeeViewModel() + } + + func didReceiveVotingReferendum(_ referendum: ReferendumLocal) { + self.referendum = referendum + } + + func didReceiveFee(_ fee: BigUInt) { + self.fee = fee + + provideFeeViewModel() + } + + func didReceiveLockStateDiff(_ diff: GovernanceLockStateDiff) { + lockDiff = diff + + provideTransferableAmountViewModel() + provideLockedAmountViewModel() + provideLockedPeriodViewModel() + } + + func didReceiveAccountVotes(_ votes: CallbackStorageSubscriptionResult) { + votesResult = votes + + refreshLockDiff() + } + + func didReceiveBlockNumber(_ blockNumber: BlockNumber) { + self.blockNumber = blockNumber + + interactor.refreshBlockTime() + + provideLockedPeriodViewModel() + } + + func didReceiveBlockTime(_ blockTime: BlockTime) { + self.blockTime = blockTime + + provideLockedPeriodViewModel() + } + + func didReceiveLocks(_ locks: AssetLocks) { + assetLocks = locks + + provideTransferableAmountViewModel() + } + + func didReceiveBaseError(_ error: ReferendumVoteInteractorError) { + logger.error("Did receive base error: \(error)") + + switch error { + case .assetBalanceFailed, .priceFailed, .votingReferendumFailed, .accountVotesFailed, + .blockNumberSubscriptionFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case .feeFailed: + wireframe.presentFeeStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshFee() + } + case .blockTimeFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.refreshBlockTime() + } + case .stateDiffFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshLockDiff() + } + } + } + + func didReceiveVotingHash(_: String) { + view?.didStopLoading() + + wireframe.presentExtrinsicSubmission(from: view, completionAction: .dismiss, locale: selectedLocale) + } + + func didReceiveError(_ error: ReferendumVoteConfirmError) { + logger.error("Did receive error: \(error)") + + switch error { + case .locksSubscriptionFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case let .submitVoteFailed(internalError): + view?.didStopLoading() + + if internalError.isWatchOnlySigning { + wireframe.presentDismissingNoSigningView(from: view) + } else { + _ = wireframe.present(error: internalError, from: view, locale: selectedLocale) + } + } + } +} + +extension ReferendumVoteConfirmPresenter: Localizable { + func applyLocalization() { + if let view = view, view.isSetup { + updateView() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmProtocols.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmProtocols.swift new file mode 100644 index 0000000000..a74bb81017 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmProtocols.swift @@ -0,0 +1,33 @@ +import Foundation + +protocol ReferendumVoteConfirmViewProtocol: ControllerBackedProtocol, LoadableViewProtocol { + func didReceive(referendumNumber: String) + func didReceiveAmount(viewModel: BalanceViewModelProtocol) + func didReceiveWallet(viewModel: StackCellViewModel) + func didReceiveAccount(viewModel: DisplayAddressViewModel) + func didReceiveFee(viewModel: BalanceViewModelProtocol?) + func didReceiveYourVote(viewModel: YourVoteRow.Model) + func didReceiveTransferableAmount(viewModel: ReferendumLockTransitionViewModel) + func didReceiveLockedAmount(viewModel: ReferendumLockTransitionViewModel) + func didReceiveLockedPeriod(viewModel: ReferendumLockTransitionViewModel) +} + +protocol ReferendumVoteConfirmPresenterProtocol: AnyObject { + func setup() + func confirm() + func presentSenderDetails() +} + +protocol ReferendumVoteConfirmInteractorInputProtocol: ReferendumVoteInteractorInputProtocol { + func submit(vote: ReferendumVoteAction) +} + +protocol ReferendumVoteConfirmInteractorOutputProtocol: ReferendumVoteInteractorOutputProtocol { + func didReceiveLocks(_ locks: AssetLocks) + func didReceiveVotingHash(_ hash: String) + func didReceiveError(_ error: ReferendumVoteConfirmError) +} + +protocol ReferendumVoteConfirmWireframeProtocol: AlertPresentable, ErrorPresentable, CommonRetryable, FeeRetryable, + MessageSheetPresentable, AddressOptionsPresentable, + ExtrinsicSubmissionPresenting, GovernanceErrorPresentable {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewController.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewController.swift new file mode 100644 index 0000000000..6d3ddb5436 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewController.swift @@ -0,0 +1,150 @@ +import UIKit +import SoraFoundation + +final class ReferendumVoteConfirmViewController: UIViewController, ViewHolder { + typealias RootViewType = ReferendumVoteConfirmViewLayout + + let presenter: ReferendumVoteConfirmPresenterProtocol + + private var referendumNumber: String? + + init(presenter: ReferendumVoteConfirmPresenterProtocol, localizationManager: LocalizationManagerProtocol) { + self.presenter = presenter + super.init(nibName: nil, bundle: nil) + + self.localizationManager = localizationManager + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = ReferendumVoteConfirmViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupHandlers() + setupLocalization() + + presenter.setup() + } + + private func setupHandlers() { + rootView.actionLoadableView.actionButton.addTarget( + self, + action: #selector(actionConfirm), + for: .touchUpInside + ) + + rootView.accountCell.addTarget( + self, + action: #selector(actionSender), + for: .touchUpInside + ) + } + + private func setupLocalization() { + let languages = selectedLocale.rLanguages + + applyReferendumNumber() + + rootView.walletCell.titleLabel.text = R.string.localizable.commonWallet(preferredLanguages: languages) + rootView.accountCell.titleLabel.text = R.string.localizable.commonAccount(preferredLanguages: languages) + + rootView.feeCell.rowContentView.locale = selectedLocale + + rootView.transferableTitleLabel.text = R.string.localizable.walletBalanceAvailable( + preferredLanguages: languages + ) + + rootView.lockAmountTitleLabel.text = R.string.localizable.commonGovLock(preferredLanguages: languages) + rootView.lockPeriodTitleLabel.text = R.string.localizable.commonLockingPeriod(preferredLanguages: languages) + + let hint = R.string.localizable.govVoteSetupHint(preferredLanguages: languages) + rootView.hintsView.bind(texts: [hint]) + + rootView.actionLoadableView.actionButton.imageWithTitleView?.title = R.string.localizable + .commonConfirm(preferredLanguages: selectedLocale.rLanguages) + } + + private func applyReferendumNumber() { + let languages = selectedLocale.rLanguages + + title = R.string.localizable.govVoteSetupTitleFormat( + referendumNumber ?? "", + preferredLanguages: languages + ) + } + + @objc private func actionConfirm() { + presenter.confirm() + } + + @objc private func actionSender() { + presenter.presentSenderDetails() + } +} + +extension ReferendumVoteConfirmViewController: ReferendumVoteConfirmViewProtocol { + func didReceive(referendumNumber: String) { + self.referendumNumber = referendumNumber + + applyReferendumNumber() + } + + func didReceiveAmount(viewModel: BalanceViewModelProtocol) { + rootView.amountView.bind(viewModel: viewModel) + } + + func didReceiveWallet(viewModel: StackCellViewModel) { + rootView.walletCell.bind(viewModel: viewModel) + } + + func didReceiveAccount(viewModel: DisplayAddressViewModel) { + rootView.accountCell.bind(viewModel: viewModel.cellViewModel) + } + + func didReceiveFee(viewModel: BalanceViewModelProtocol?) { + rootView.feeCell.rowContentView.bind(viewModel: viewModel) + } + + func didReceiveYourVote(viewModel: YourVoteRow.Model) { + rootView.yourVoteView.bind(viewModel: viewModel) + } + + func didReceiveTransferableAmount(viewModel: ReferendumLockTransitionViewModel) { + rootView.transferableCell.bind(viewModel: viewModel) + } + + func didReceiveLockedAmount(viewModel: ReferendumLockTransitionViewModel) { + rootView.lockedAmountCell.bind(viewModel: viewModel) + } + + func didReceiveLockedPeriod(viewModel: ReferendumLockTransitionViewModel) { + rootView.lockedPeriodCell.bind(viewModel: viewModel) + } +} + +extension ReferendumVoteConfirmViewController: LoadableViewProtocol { + func didStartLoading() { + rootView.actionLoadableView.startLoading() + } + + func didStopLoading() { + rootView.actionLoadableView.stopLoading() + } +} + +extension ReferendumVoteConfirmViewController: Localizable { + func applyLocalization() { + if isViewLoaded { + setupLocalization() + } + } +} + +extension ReferendumVoteConfirmViewController: ImportantViewProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewFactory.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewFactory.swift new file mode 100644 index 0000000000..210d08db0d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewFactory.swift @@ -0,0 +1,153 @@ +import Foundation +import RobinHood +import SubstrateSdk +import SoraFoundation + +struct ReferendumVoteConfirmViewFactory { + // swiftlint:disable:next function_body_length + static func createView( + for state: GovernanceSharedState, + newVote: ReferendumNewVote, + initData: ReferendumVotingInitData + ) -> ReferendumVoteConfirmViewProtocol? { + guard let option = state.settings.value else { + return nil + } + + let chain = option.chain + + guard + let currencyManager = CurrencyManager.shared, + let interactor = createInteractor( + for: state, + referendum: newVote.index, + currencyManager: currencyManager + ), + let assetDisplayInfo = chain.utilityAsset()?.displayInfo(with: chain.icon), + let selectedAccount = SelectedWalletSettings.shared.value?.fetchMetaChainAccount( + for: chain.accountRequest() + ) + else { + return nil + } + + let votingLockId = state.governanceId(for: option) + + let wireframe = ReferendumVoteConfirmWireframe() + + let localizationManager = LocalizationManager.shared + + let balanceViewModelFactory = BalanceViewModelFactory( + targetAssetInfo: assetDisplayInfo, + priceAssetInfoFactory: PriceAssetInfoFactory(currencyManager: currencyManager) + ) + + let lockChangeViewModelFactory = ReferendumLockChangeViewModelFactory( + assetDisplayInfo: assetDisplayInfo, + votingLockId: votingLockId + ) + + let referendumStringsViewModelFactory = ReferendumDisplayStringFactory() + + let dataValidatingFactory = GovernanceValidatorFactory( + presentable: wireframe, + assetBalanceFormatterFactory: AssetBalanceFormatterFactory(), + quantityFormatter: NumberFormatter.quantity.localizableResource() + ) + + let presenter = ReferendumVoteConfirmPresenter( + initData: initData, + vote: newVote, + chain: chain, + selectedAccount: selectedAccount, + dataValidatingFactory: dataValidatingFactory, + balanceViewModelFactory: balanceViewModelFactory, + referendumFormatter: NumberFormatter.index.localizableResource(), + referendumStringsViewModelFactory: referendumStringsViewModelFactory, + lockChangeViewModelFactory: lockChangeViewModelFactory, + interactor: interactor, + wireframe: wireframe, + localizationManager: localizationManager, + logger: Logger.shared + ) + + let view = ReferendumVoteConfirmViewController( + presenter: presenter, + localizationManager: localizationManager + ) + + presenter.view = view + dataValidatingFactory.view = view + interactor.presenter = presenter + + return view + } + + // swiftlint:disable:next function_body_length + private static func createInteractor( + for state: GovernanceSharedState, + referendum: ReferendumIdLocal, + currencyManager: CurrencyManagerProtocol + ) -> ReferendumVoteConfirmInteractor? { + let wallet: MetaAccountModel? = SelectedWalletSettings.shared.value + + guard let option = state.settings.value else { + return nil + } + + let chain = option.chain + + guard + let selectedAccount = wallet?.fetchMetaChainAccount(for: chain.accountRequest()), + let subscriptionFactory = state.subscriptionFactory, + let lockStateFactory = state.locksOperationFactory, + let blockTimeService = state.blockTimeService, + let blockTimeFactory = state.createBlockTimeOperationFactory() + else { + return nil + } + + let extrinsicFactory = state.createExtrinsicFactory(for: option) + + guard + let connection = state.chainRegistry.getConnection(for: chain.chainId), + let runtimeProvider = state.chainRegistry.getRuntimeProvider(for: chain.chainId) else { + return nil + } + + let operationQueue = OperationManagerFacade.sharedDefaultQueue + let operationManager = OperationManager(operationQueue: operationQueue) + + let extrinsicService = ExtrinsicServiceFactory( + runtimeRegistry: runtimeProvider, + engine: connection, + operationManager: operationManager + ).createService(account: selectedAccount.chainAccount, chain: chain) + + let signer = SigningWrapperFactory().createSigningWrapper( + for: selectedAccount.metaId, + accountResponse: selectedAccount.chainAccount + ) + + return ReferendumVoteConfirmInteractor( + referendumIndex: referendum, + selectedAccount: selectedAccount, + chain: chain, + generalLocalSubscriptionFactory: state.generalLocalSubscriptionFactory, + referendumsSubscriptionFactory: subscriptionFactory, + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactory.shared, + priceLocalSubscriptionFactory: PriceProviderFactory.shared, + blockTimeService: blockTimeService, + blockTimeFactory: blockTimeFactory, + connection: connection, + runtimeProvider: runtimeProvider, + currencyManager: currencyManager, + extrinsicFactory: extrinsicFactory, + extrinsicService: extrinsicService, + signer: signer, + feeProxy: ExtrinsicFeeProxy(), + lockStateFactory: lockStateFactory, + operationQueue: operationQueue + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewLayout.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewLayout.swift new file mode 100644 index 0000000000..94a90ac695 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmViewLayout.swift @@ -0,0 +1,108 @@ +import UIKit + +final class ReferendumVoteConfirmViewLayout: UIView { + let containerView: ScrollableContainerView = { + let view = ScrollableContainerView(axis: .vertical, respectsSafeArea: true) + view.stackView.layoutMargins = UIEdgeInsets(top: 0.0, left: 16.0, bottom: 0.0, right: 16.0) + view.stackView.isLayoutMarginsRelativeArrangement = true + view.stackView.alignment = .fill + return view + }() + + let amountView = MultilineBalanceView() + + let senderTableView = StackTableView() + + let walletCell = StackTableCell() + + let accountCell: StackInfoTableCell = { + let cell = StackInfoTableCell() + cell.detailsLabel.lineBreakMode = .byTruncatingMiddle + return cell + }() + + let feeCell = StackNetworkFeeCell() + + let yourVoteView = YourVoteRow() + + let changesTableView = StackTableView() + + var transferableTitleLabel: UILabel { + transferableCell.rowContentView.titleView.detailsLabel + } + + var transferableCell: StackTitleValueDiffCell = .create { cell in + cell.rowContentView.titleView.imageView.image = R.image.iconGovTransferable() + } + + var lockAmountTitleLabel: UILabel { + lockedAmountCell.rowContentView.titleView.detailsLabel + } + + let lockedAmountCell: StackTitleValueDiffCell = .create { cell in + cell.rowContentView.titleView.imageView.image = R.image.iconGovAmountLock() + } + + var lockPeriodTitleLabel: UILabel { + lockedPeriodCell.rowContentView.titleView.detailsLabel + } + + let lockedPeriodCell: StackTitleValueDiffCell = .create { cell in + cell.rowContentView.titleView.imageView.image = R.image.iconGovPeriodLock() + } + + let hintsView = HintListView() + + let actionLoadableView = LoadableActionView() + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = R.color.colorBlack() + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + addSubview(actionLoadableView) + actionLoadableView.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(UIConstants.horizontalInset) + make.bottom.equalTo(safeAreaLayoutGuide).inset(UIConstants.actionBottomInset) + make.height.equalTo(UIConstants.actionHeight) + } + + addSubview(containerView) + containerView.snp.makeConstraints { make in + make.top.leading.trailing.equalToSuperview() + make.bottom.equalTo(actionLoadableView.snp.top).offset(-8.0) + } + + containerView.stackView.addArrangedSubview(amountView) + containerView.stackView.setCustomSpacing(20.0, after: amountView) + + containerView.stackView.addArrangedSubview(senderTableView) + containerView.stackView.setCustomSpacing(12.0, after: senderTableView) + + senderTableView.addArrangedSubview(walletCell) + senderTableView.addArrangedSubview(accountCell) + senderTableView.addArrangedSubview(feeCell) + + containerView.stackView.addArrangedSubview(yourVoteView) + containerView.stackView.setCustomSpacing(12.0, after: yourVoteView) + + containerView.stackView.addArrangedSubview(changesTableView) + + changesTableView.addArrangedSubview(transferableCell) + changesTableView.addArrangedSubview(lockedAmountCell) + changesTableView.addArrangedSubview(lockedPeriodCell) + + containerView.stackView.setCustomSpacing(16.0, after: changesTableView) + + containerView.stackView.addArrangedSubview(hintsView) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmWireframe.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmWireframe.swift new file mode 100644 index 0000000000..4b1e48148d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteConfirm/ReferendumVoteConfirmWireframe.swift @@ -0,0 +1,3 @@ +import Foundation + +final class ReferendumVoteConfirmWireframe: ReferendumVoteConfirmWireframeProtocol, ModalAlertPresenting {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumReuseLockModel.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumReuseLockModel.swift new file mode 100644 index 0000000000..ceabf745e9 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumReuseLockModel.swift @@ -0,0 +1,6 @@ +import Foundation + +struct ReferendumReuseLockModel { + let governance: Decimal + let all: Decimal +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumVoteSetupInteractorError.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumVoteSetupInteractorError.swift new file mode 100644 index 0000000000..6c705cfc33 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumVoteSetupInteractorError.swift @@ -0,0 +1,8 @@ +import Foundation + +enum ReferendumVoteSetupInteractorError: Error { + case accountVotesFailed(_ internalError: Error) + case blockNumberSubscriptionFailed(_ internalError: Error) + case blockTimeFailed(_ internalError: Error) + case stateDiffFailed(_ internalError: Error) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumVotingInitData.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumVotingInitData.swift new file mode 100644 index 0000000000..b9080a1c9c --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/Model/ReferendumVotingInitData.swift @@ -0,0 +1,9 @@ +import Foundation + +struct ReferendumVotingInitData { + let votesResult: CallbackStorageSubscriptionResult? + let blockNumber: BlockNumber? + let blockTime: BlockTime? + let referendum: ReferendumLocal? + let lockDiff: GovernanceLockStateDiff? +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupInteractor.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupInteractor.swift new file mode 100644 index 0000000000..815395335a --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupInteractor.swift @@ -0,0 +1,17 @@ +import UIKit +import SubstrateSdk +import RobinHood + +final class ReferendumVoteSetupInteractor: ReferendumVoteInteractor { + weak var presenter: ReferendumVoteSetupInteractorOutputProtocol? { + get { + basePresenter as? ReferendumVoteSetupInteractorOutputProtocol + } + + set { + basePresenter = newValue + } + } +} + +extension ReferendumVoteSetupInteractor: ReferendumVoteSetupInteractorInputProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupPresenter.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupPresenter.swift new file mode 100644 index 0000000000..bc9f8283b7 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupPresenter.swift @@ -0,0 +1,503 @@ +import Foundation +import BigInt +import SoraFoundation + +final class ReferendumVoteSetupPresenter { + weak var view: ReferendumVoteSetupViewProtocol? + let wireframe: ReferendumVoteSetupWireframeProtocol + let interactor: ReferendumVoteSetupInteractorInputProtocol + + let chain: ChainModel + let referendumIndex: ReferendumIdLocal + + let balanceViewModelFactory: BalanceViewModelFactoryProtocol + let referendumFormatter: LocalizableResource + let chainAssetViewModelFactory: ChainAssetViewModelFactoryProtocol + let referendumStringsViewModelFactory: ReferendumDisplayStringFactoryProtocol + let lockChangeViewModelFactory: ReferendumLockChangeViewModelFactoryProtocol + let dataValidatingFactory: GovernanceValidatorFactoryProtocol + let logger: LoggerProtocol + + private var assetBalance: AssetBalance? + private var fee: BigUInt? + private var priceData: PriceData? + private var votesResult: CallbackStorageSubscriptionResult? + private var blockNumber: BlockNumber? + private var blockTime: BlockTime? + private var referendum: ReferendumLocal? + private var lockDiff: GovernanceLockStateDiff? + + private(set) var inputResult: AmountInputResult? + private(set) var conviction: ConvictionVoting.Conviction = .none + + init( + chain: ChainModel, + referendumIndex: ReferendumIdLocal, + initData: ReferendumVotingInitData, + dataValidatingFactory: GovernanceValidatorFactoryProtocol, + balanceViewModelFactory: BalanceViewModelFactoryProtocol, + referendumFormatter: LocalizableResource, + chainAssetViewModelFactory: ChainAssetViewModelFactoryProtocol, + referendumStringsViewModelFactory: ReferendumDisplayStringFactoryProtocol, + lockChangeViewModelFactory: ReferendumLockChangeViewModelFactoryProtocol, + interactor: ReferendumVoteSetupInteractorInputProtocol, + wireframe: ReferendumVoteSetupWireframeProtocol, + localizationManager: LocalizationManagerProtocol, + logger: LoggerProtocol + ) { + self.chain = chain + votesResult = initData.votesResult + blockNumber = initData.blockNumber + blockTime = initData.blockTime + referendum = initData.referendum + lockDiff = initData.lockDiff + self.referendumIndex = referendumIndex + self.dataValidatingFactory = dataValidatingFactory + self.balanceViewModelFactory = balanceViewModelFactory + self.chainAssetViewModelFactory = chainAssetViewModelFactory + self.referendumFormatter = referendumFormatter + self.referendumStringsViewModelFactory = referendumStringsViewModelFactory + self.lockChangeViewModelFactory = lockChangeViewModelFactory + self.interactor = interactor + self.wireframe = wireframe + self.logger = logger + + self.localizationManager = localizationManager + } + + private func balanceMinusFee() -> Decimal { + let balanceValue = assetBalance?.freeInPlank ?? 0 + let feeValue = fee ?? 0 + + guard + let precision = chain.utilityAsset()?.displayInfo.assetPrecision, + let balance = Decimal.fromSubstrateAmount(balanceValue, precision: precision), + let fee = Decimal.fromSubstrateAmount(feeValue, precision: precision) else { + return 0 + } + + return balance - fee + } + + private func updateAvailableBalanceView() { + let freeInPlank = assetBalance?.freeInPlank ?? 0 + + let precision = chain.utilityAsset()?.displayInfo.assetPrecision ?? 0 + let balanceDecimal = Decimal.fromSubstrateAmount( + freeInPlank, + precision: precision + ) ?? 0 + + let viewModel = balanceViewModelFactory.balanceFromPrice( + balanceDecimal, + priceData: nil + ).value(for: selectedLocale).amount + + view?.didReceiveBalance(viewModel: viewModel) + } + + private func updateChainAssetViewModel() { + guard let asset = chain.utilityAsset() else { + return + } + + let chainAsset = ChainAsset(chain: chain, asset: asset) + let viewModel = chainAssetViewModelFactory.createViewModel(from: chainAsset) + view?.didReceiveInputChainAsset(viewModel: viewModel) + } + + private func updateAmountPriceView() { + if chain.utilityAsset()?.priceId != nil { + let inputAmount = inputResult?.absoluteValue(from: balanceMinusFee()) ?? 0 + + let priceData = priceData ?? PriceData.zero() + + let price = balanceViewModelFactory.priceFromAmount( + inputAmount, + priceData: priceData + ).value(for: selectedLocale) + + view?.didReceiveAmountInputPrice(viewModel: price) + } else { + view?.didReceiveAmountInputPrice(viewModel: nil) + } + } + + private func provideReferendumIndex() { + let referendumString = referendumFormatter.value(for: selectedLocale).string(from: referendumIndex as NSNumber) + view?.didReceive(referendumNumber: referendumString ?? "") + } + + private func provideAmountInputViewModelIfRate() { + guard case .rate = inputResult else { + return + } + + provideAmountInputViewModel() + } + + private func provideAmountInputViewModel() { + let inputAmount = inputResult?.absoluteValue(from: balanceMinusFee()) + + let viewModel = balanceViewModelFactory.createBalanceInputViewModel( + inputAmount + ).value(for: selectedLocale) + + view?.didReceiveAmount(inputViewModel: viewModel) + } + + private func updateLockedAmountView() { + guard + let lockDiff = lockDiff, + let viewModel = lockChangeViewModelFactory.createAmountViewModel( + from: lockDiff, + locale: selectedLocale + ) else { + return + } + + view?.didReceiveLockedAmount(viewModel: viewModel) + } + + private func updateLockedPeriodView() { + guard + let lockDiff = lockDiff, + let blockNumber = blockNumber, + let blockTime = blockTime, + let viewModel = lockChangeViewModelFactory.createPeriodViewModel( + from: lockDiff, + blockNumber: blockNumber, + blockTime: blockTime, + locale: selectedLocale + ) else { + return + } + + view?.didReceiveLockedPeriod(viewModel: viewModel) + } + + private func updateVotesView() { + guard let vote = deriveNewVote() else { + return + } + + let voteValue = vote.voteAction.conviction.votes(for: vote.voteAction.amount) ?? 0 + + let voteString = referendumStringsViewModelFactory.createVotes( + from: voteValue, + chain: chain, + locale: selectedLocale + ) + + view?.didReceiveVotes(viewModel: voteString ?? "") + } + + private func provideConviction() { + view?.didReceiveConviction(viewModel: UInt(conviction.rawValue)) + } + + private func provideReuseLocksViewModel() { + guard let model = deriveReuseLocks() else { + return + } + + let governance: String? + + if model.governance > 0 { + governance = balanceViewModelFactory.amountFromValue(model.governance).value(for: selectedLocale) + } else { + governance = nil + } + + let all: String? + + if model.all > 0, model.all != model.governance { + all = balanceViewModelFactory.amountFromValue(model.all).value(for: selectedLocale) + } else { + all = nil + } + + let viewModel = ReferendumLockReuseViewModel(governance: governance, all: all) + view?.didReceiveLockReuse(viewModel: viewModel) + } + + private func updateView() { + provideReferendumIndex() + updateAvailableBalanceView() + provideAmountInputViewModel() + updateChainAssetViewModel() + updateAmountPriceView() + updateVotesView() + updateLockedAmountView() + updateLockedPeriodView() + provideReuseLocksViewModel() + } + + private func deriveNewVote(isAye: Bool = true) -> ReferendumNewVote? { + let amount = inputResult?.absoluteValue(from: balanceMinusFee()) ?? 0 + + guard + let precision = chain.utilityAsset()?.displayInfo.assetPrecision, + let amountInPlank = amount.toSubstrateAmount(precision: precision) else { + return nil + } + + let voteAction = ReferendumVoteAction( + amount: amountInPlank, + conviction: conviction, + isAye: isAye + ) + + return ReferendumNewVote(index: referendumIndex, voteAction: voteAction) + } + + private func deriveReuseLocks() -> ReferendumReuseLockModel? { + let governanceLocksInPlank = lockDiff?.before.maxLockedAmount ?? 0 + let allLocksInPlank = assetBalance?.frozenInPlank ?? 0 + + guard + let precision = chain.utilityAssetDisplayInfo()?.assetPrecision, + let governanceLockDecimal = Decimal.fromSubstrateAmount(governanceLocksInPlank, precision: precision), + let allLockDecimal = Decimal.fromSubstrateAmount(allLocksInPlank, precision: precision) else { + return nil + } + + return ReferendumReuseLockModel(governance: governanceLockDecimal, all: allLockDecimal) + } + + private func refreshFee() { + guard let newVote = deriveNewVote() else { + return + } + + interactor.estimateFee(for: newVote.voteAction) + } + + private func refreshLockDiff() { + guard let trackVoting = votesResult?.value, let newVote = deriveNewVote() else { + return + } + + interactor.refreshLockDiff( + for: trackVoting, + newVote: newVote, + blockHash: votesResult?.blockHash + ) + } + + private func performValidation( + for isAye: Bool, + notifying completionBlock: @escaping DataValidationRunnerCompletion + ) { + guard let assetInfo = chain.utilityAssetDisplayInfo() else { + return + } + + let newVote = deriveNewVote(isAye: isAye) + + let params = GovernanceVoteValidatingParams( + assetBalance: assetBalance, + referendum: referendum, + newVote: newVote, + fee: fee, + votes: votesResult?.value?.votes, + assetInfo: assetInfo + ) + + DataValidationRunner.validateVote( + factory: dataValidatingFactory, + params: params, + selectedLocale: selectedLocale, + feeErrorClosure: { [weak self] in + self?.refreshFee() + }, successClosure: completionBlock + ) + } + + private func proceed(isAye: Bool) { + performValidation(for: isAye) { [weak self] in + guard let newVote = self?.deriveNewVote(isAye: isAye) else { + return + } + + let initData = ReferendumVotingInitData( + votesResult: self?.votesResult, + blockNumber: self?.blockNumber, + blockTime: self?.blockTime, + referendum: self?.referendum, + lockDiff: self?.lockDiff + ) + + self?.wireframe.showConfirmation(from: self?.view, vote: newVote, initData: initData) + } + } + + private func updateAfterAmountChanged() { + refreshFee() + refreshLockDiff() + + updateVotesView() + updateAmountPriceView() + } +} + +extension ReferendumVoteSetupPresenter: ReferendumVoteSetupPresenterProtocol { + func setup() { + updateView() + + interactor.setup() + } + + func updateAmount(_ newValue: Decimal?) { + inputResult = newValue.map { .absolute($0) } + + updateAfterAmountChanged() + } + + func selectAmountPercentage(_ percentage: Float) { + inputResult = .rate(Decimal(Double(percentage))) + + provideAmountInputViewModel() + + updateAfterAmountChanged() + } + + func selectConvictionValue(_ value: UInt) { + guard let newConviction = ConvictionVoting.Conviction(rawValue: UInt8(value)) else { + return + } + + conviction = newConviction + + updateVotesView() + + refreshFee() + refreshLockDiff() + } + + func reuseGovernanceLock() { + guard let model = deriveReuseLocks() else { + return + } + + inputResult = .absolute(model.governance) + + provideAmountInputViewModel() + + updateAfterAmountChanged() + } + + func reuseAllLock() { + guard let model = deriveReuseLocks() else { + return + } + + inputResult = .absolute(model.all) + + provideAmountInputViewModel() + + updateAfterAmountChanged() + } + + func proceedNay() { + proceed(isAye: false) + } + + func proceedAye() { + proceed(isAye: true) + } +} + +extension ReferendumVoteSetupPresenter: ReferendumVoteSetupInteractorOutputProtocol { + func didReceiveLockStateDiff(_ diff: GovernanceLockStateDiff) { + lockDiff = diff + + updateLockedAmountView() + updateLockedPeriodView() + provideReuseLocksViewModel() + } + + func didReceiveAccountVotes( + _ votes: CallbackStorageSubscriptionResult + ) { + votesResult = votes + + refreshLockDiff() + } + + func didReceiveBlockNumber(_ blockNumber: BlockNumber) { + self.blockNumber = blockNumber + + interactor.refreshBlockTime() + + updateLockedAmountView() + updateLockedPeriodView() + } + + func didReceiveBlockTime(_ blockTime: BlockTime) { + self.blockTime = blockTime + + updateLockedAmountView() + updateLockedPeriodView() + } + + func didReceiveAssetBalance(_ assetBalance: AssetBalance?) { + self.assetBalance = assetBalance + + updateAvailableBalanceView() + updateAmountPriceView() + provideAmountInputViewModelIfRate() + provideReuseLocksViewModel() + + refreshFee() + } + + func didReceivePrice(_ price: PriceData?) { + priceData = price + + updateAmountPriceView() + } + + func didReceiveVotingReferendum(_ referendum: ReferendumLocal) { + self.referendum = referendum + } + + func didReceiveFee(_ fee: BigUInt) { + self.fee = fee + + updateAmountPriceView() + provideAmountInputViewModelIfRate() + } + + func didReceiveBaseError(_ error: ReferendumVoteInteractorError) { + logger.error("Did receive base error: \(error)") + + switch error { + case .assetBalanceFailed, .priceFailed, .votingReferendumFailed, .accountVotesFailed, + .blockNumberSubscriptionFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case .feeFailed: + wireframe.presentFeeStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshFee() + } + case .blockTimeFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.refreshBlockTime() + } + case .stateDiffFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshLockDiff() + } + } + } +} + +extension ReferendumVoteSetupPresenter: Localizable { + func applyLocalization() { + if let view = view, view.isSetup { + updateView() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupProtocols.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupProtocols.swift new file mode 100644 index 0000000000..5c44fa3592 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupProtocols.swift @@ -0,0 +1,39 @@ +import BigInt +import CommonWallet + +protocol ReferendumVoteSetupViewProtocol: ControllerBackedProtocol { + func didReceive(referendumNumber: String) + func didReceiveBalance(viewModel: String) + func didReceiveInputChainAsset(viewModel: ChainAssetViewModel) + func didReceiveAmount(inputViewModel: AmountInputViewModelProtocol) + func didReceiveAmountInputPrice(viewModel: String?) + func didReceiveVotes(viewModel: String) + func didReceiveConviction(viewModel: UInt) + func didReceiveLockedAmount(viewModel: ReferendumLockTransitionViewModel) + func didReceiveLockedPeriod(viewModel: ReferendumLockTransitionViewModel) + func didReceiveLockReuse(viewModel: ReferendumLockReuseViewModel) +} + +protocol ReferendumVoteSetupPresenterProtocol: AnyObject { + func setup() + func updateAmount(_ newValue: Decimal?) + func selectAmountPercentage(_ percentage: Float) + func selectConvictionValue(_ value: UInt) + func reuseGovernanceLock() + func reuseAllLock() + func proceedNay() + func proceedAye() +} + +protocol ReferendumVoteSetupInteractorInputProtocol: ReferendumVoteInteractorInputProtocol {} + +protocol ReferendumVoteSetupInteractorOutputProtocol: ReferendumVoteInteractorOutputProtocol {} + +protocol ReferendumVoteSetupWireframeProtocol: AlertPresentable, ErrorPresentable, CommonRetryable, FeeRetryable, + GovernanceErrorPresentable { + func showConfirmation( + from view: ReferendumVoteSetupViewProtocol?, + vote: ReferendumNewVote, + initData: ReferendumVotingInitData + ) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewController.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewController.swift new file mode 100644 index 0000000000..21214413a2 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewController.swift @@ -0,0 +1,214 @@ +import UIKit +import SoraFoundation +import CommonWallet + +final class ReferendumVoteSetupViewController: UIViewController, ViewHolder { + typealias RootViewType = ReferendumVoteSetupViewLayout + + let presenter: ReferendumVoteSetupPresenterProtocol + + private var referendumNumber: String? + + init( + presenter: ReferendumVoteSetupPresenterProtocol, + localizationManager: LocalizationManagerProtocol + ) { + self.presenter = presenter + super.init(nibName: nil, bundle: nil) + + self.localizationManager = localizationManager + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = ReferendumVoteSetupViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupHandlers() + setupLocalization() + + presenter.setup() + } + + private func setupHandlers() { + rootView.amountInputView.addTarget( + self, + action: #selector(actionAmountChange), + for: .editingChanged + ) + + rootView.nayButton.addTarget( + self, + action: #selector(actionVoteNay), + for: .touchUpInside + ) + + rootView.ayeButton.addTarget( + self, + action: #selector(actionVoteAye), + for: .touchUpInside + ) + + rootView.convictionView.slider.addTarget( + self, + action: #selector(actionConvictionChanged), + for: .valueChanged + ) + } + + private func setupLocalization() { + let languages = selectedLocale.rLanguages + + applyReferendumNumber() + + rootView.amountView.titleView.text = R.string.localizable.walletSendAmountTitle( + preferredLanguages: languages + ) + + rootView.amountView.detailsTitleLabel.text = R.string.localizable.commonAvailablePrefix( + preferredLanguages: languages + ) + + rootView.convictionView.titleLabel.text = R.string.localizable.govVoteConvictionTitle( + preferredLanguages: languages + ) + + rootView.lockAmountTitleLabel.text = R.string.localizable.commonGovLock(preferredLanguages: languages) + rootView.lockPeriodTitleLabel.text = R.string.localizable.commonLockingPeriod(preferredLanguages: languages) + + rootView.nayButton.imageWithTitleView?.title = R.string.localizable.governanceNay(preferredLanguages: languages) + rootView.ayeButton.imageWithTitleView?.title = R.string.localizable.governanceAye(preferredLanguages: languages) + + setupAmountInputAccessoryView(for: selectedLocale) + } + + private func applyReferendumNumber() { + let languages = selectedLocale.rLanguages + + rootView.titleLabel.text = R.string.localizable.govVoteSetupTitleFormat( + referendumNumber ?? "", + preferredLanguages: languages + ) + } + + private func setupAmountInputAccessoryView(for locale: Locale) { + let accessoryView = UIFactory.default.createAmountAccessoryView( + for: self, + locale: locale + ) + + rootView.amountInputView.textField.inputAccessoryView = accessoryView + } + + @objc private func actionVoteNay() { + presenter.proceedNay() + } + + @objc private func actionVoteAye() { + presenter.proceedAye() + } + + @objc private func actionConvictionChanged() { + presenter.selectConvictionValue(rootView.convictionView.slider.value) + } + + @objc func actionAmountChange() { + let amount = rootView.amountInputView.inputViewModel?.decimalAmount + presenter.updateAmount(amount) + } + + @objc func actionReuseGovernanceLock() { + presenter.reuseGovernanceLock() + } + + @objc func actionReuseAllLock() { + presenter.reuseAllLock() + } +} + +extension ReferendumVoteSetupViewController: ReferendumVoteSetupViewProtocol { + func didReceive(referendumNumber: String) { + self.referendumNumber = referendumNumber + + applyReferendumNumber() + } + + func didReceiveBalance(viewModel: String) { + rootView.amountView.detailsValueLabel.text = viewModel + } + + func didReceiveInputChainAsset(viewModel: ChainAssetViewModel) { + rootView.amountInputView.bind(assetViewModel: viewModel.assetViewModel) + } + + func didReceiveAmount(inputViewModel: AmountInputViewModelProtocol) { + rootView.amountInputView.bind(inputViewModel: inputViewModel) + } + + func didReceiveAmountInputPrice(viewModel: String?) { + rootView.amountInputView.bind(priceViewModel: viewModel) + } + + func didReceiveVotes(viewModel: String) { + rootView.convictionView.bind(votes: viewModel) + } + + func didReceiveConviction(viewModel: UInt) { + if viewModel < rootView.convictionView.slider.numberOfValues { + rootView.convictionView.slider.value = viewModel + } + } + + func didReceiveLockedAmount(viewModel: ReferendumLockTransitionViewModel) { + rootView.lockedAmountView.bind(viewModel: viewModel) + } + + func didReceiveLockedPeriod(viewModel: ReferendumLockTransitionViewModel) { + rootView.lockedPeriodView.bind(viewModel: viewModel) + } + + func didReceiveLockReuse(viewModel: ReferendumLockReuseViewModel) { + rootView.bindReuseLocks(viewModel: viewModel, locale: selectedLocale) + + rootView.govLocksReuseButton?.addTarget( + self, + action: #selector(actionReuseGovernanceLock), + for: .touchUpInside + ) + + rootView.allLocksReuseButton?.addTarget( + self, + action: #selector(actionReuseAllLock), + for: .touchUpInside + ) + } +} + +extension ReferendumVoteSetupViewController: AmountInputAccessoryViewDelegate { + func didSelect(on _: AmountInputAccessoryView, percentage: Float) { + rootView.amountInputView.textField.resignFirstResponder() + + presenter.selectAmountPercentage(percentage) + } + + func didSelectDone(on _: AmountInputAccessoryView) { + rootView.amountInputView.textField.resignFirstResponder() + } +} + +extension ReferendumVoteSetupViewController: Localizable { + func applyLocalization() { + if isViewLoaded { + setupLocalization() + } + } +} + +extension ReferendumVoteSetupViewController: ImportantViewProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewFactory.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewFactory.swift new file mode 100644 index 0000000000..a72be5de91 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewFactory.swift @@ -0,0 +1,166 @@ +import Foundation +import SubstrateSdk +import RobinHood +import SoraFoundation + +struct ReferendumVoteSetupViewFactory { + static func createView( + for state: GovernanceSharedState, + referendum: ReferendumIdLocal, + initData: ReferendumVotingInitData + ) -> ReferendumVoteSetupViewProtocol? { + guard + let currencyManager = CurrencyManager.shared, + let interactor = createInteractor( + for: state, + referendum: referendum, + currencyManager: currencyManager + ) else { + return nil + } + + let wireframe = ReferendumVoteSetupWireframe(state: state) + + let dataValidatingFactory = GovernanceValidatorFactory( + presentable: wireframe, + assetBalanceFormatterFactory: AssetBalanceFormatterFactory(), + quantityFormatter: NumberFormatter.quantity.localizableResource() + ) + + guard + let presenter = createPresenter( + from: interactor, + wireframe: wireframe, + dataValidatingFactory: dataValidatingFactory, + referendum: referendum, + initData: initData, + state: state + ) else { + return nil + } + + let view = ReferendumVoteSetupViewController( + presenter: presenter, + localizationManager: LocalizationManager.shared + ) + + presenter.view = view + dataValidatingFactory.view = view + interactor.presenter = presenter + + return view + } + + private static func createPresenter( + from interactor: ReferendumVoteSetupInteractor, + wireframe: ReferendumVoteSetupWireframeProtocol, + dataValidatingFactory: GovernanceValidatorFactoryProtocol, + referendum: ReferendumIdLocal, + initData: ReferendumVotingInitData, + state: GovernanceSharedState + ) -> ReferendumVoteSetupPresenter? { + guard + let option = state.settings.value, + let assetDisplayInfo = option.chain.utilityAssetDisplayInfo(), + let currencyManager = CurrencyManager.shared + else { + return nil + } + + let chain = option.chain + + let votingLockId = state.governanceId(for: option) + + let balanceViewModelFactory = BalanceViewModelFactory( + targetAssetInfo: assetDisplayInfo, + priceAssetInfoFactory: PriceAssetInfoFactory(currencyManager: currencyManager) + ) + + let networkViewModelFactory = NetworkViewModelFactory() + let chainAssetViewModelFactory = ChainAssetViewModelFactory(networkViewModelFactory: networkViewModelFactory) + + let lockChangeViewModelFactory = ReferendumLockChangeViewModelFactory( + assetDisplayInfo: assetDisplayInfo, + votingLockId: votingLockId + ) + + let referendumStringsViewModelFactory = ReferendumDisplayStringFactory() + + return ReferendumVoteSetupPresenter( + chain: chain, + referendumIndex: referendum, + initData: initData, + dataValidatingFactory: dataValidatingFactory, + balanceViewModelFactory: balanceViewModelFactory, + referendumFormatter: NumberFormatter.index.localizableResource(), + chainAssetViewModelFactory: chainAssetViewModelFactory, + referendumStringsViewModelFactory: referendumStringsViewModelFactory, + lockChangeViewModelFactory: lockChangeViewModelFactory, + interactor: interactor, + wireframe: wireframe, + localizationManager: LocalizationManager.shared, + logger: Logger.shared + ) + } + + private static func createInteractor( + for state: GovernanceSharedState, + referendum: ReferendumIdLocal, + currencyManager: CurrencyManagerProtocol + ) -> ReferendumVoteSetupInteractor? { + let wallet: MetaAccountModel? = SelectedWalletSettings.shared.value + + guard let option = state.settings.value else { + return nil + } + + let chain = option.chain + + guard + let selectedAccount = wallet?.fetchMetaChainAccount(for: chain.accountRequest()), + let subscriptionFactory = state.subscriptionFactory, + let lockStateFactory = state.locksOperationFactory, + let blockTimeService = state.blockTimeService, + let blockTimeFactory = state.createBlockTimeOperationFactory() + else { + return nil + } + + let extrinsicFactory = state.createExtrinsicFactory(for: option) + + guard + let connection = state.chainRegistry.getConnection(for: chain.chainId), + let runtimeProvider = state.chainRegistry.getRuntimeProvider(for: chain.chainId) else { + return nil + } + + let operationQueue = OperationManagerFacade.sharedDefaultQueue + let operationManager = OperationManager(operationQueue: operationQueue) + + let extrinsicService = ExtrinsicServiceFactory( + runtimeRegistry: runtimeProvider, + engine: connection, + operationManager: operationManager + ).createService(account: selectedAccount.chainAccount, chain: chain) + + return ReferendumVoteSetupInteractor( + referendumIndex: referendum, + selectedAccount: selectedAccount, + chain: chain, + generalLocalSubscriptionFactory: state.generalLocalSubscriptionFactory, + referendumsSubscriptionFactory: subscriptionFactory, + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactory.shared, + priceLocalSubscriptionFactory: PriceProviderFactory.shared, + blockTimeService: blockTimeService, + blockTimeFactory: blockTimeFactory, + connection: connection, + runtimeProvider: runtimeProvider, + currencyManager: currencyManager, + extrinsicFactory: extrinsicFactory, + extrinsicService: extrinsicService, + feeProxy: ExtrinsicFeeProxy(), + lockStateFactory: lockStateFactory, + operationQueue: operationQueue + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewLayout.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewLayout.swift new file mode 100644 index 0000000000..77457e7fd3 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupViewLayout.swift @@ -0,0 +1,214 @@ +import UIKit + +final class ReferendumVoteSetupViewLayout: UIView { + let containerView: ScrollableContainerView = { + let view = ScrollableContainerView(axis: .vertical, respectsSafeArea: true) + view.stackView.layoutMargins = UIEdgeInsets(top: 8.0, left: 0, bottom: 0, right: 0) + view.stackView.isLayoutMarginsRelativeArrangement = true + view.stackView.alignment = .center + return view + }() + + let ayeButton: TriangularedButton = { + let button = TriangularedButton() + button.applyDefaultStyle() + button.triangularedView?.fillColor = R.color.colorGreen()! + button.triangularedView?.highlightedFillColor = R.color.colorGreen()! + return button + }() + + let nayButton: TriangularedButton = { + let button = TriangularedButton() + button.applyDefaultStyle() + button.triangularedView?.fillColor = R.color.colorRed()! + button.triangularedView?.highlightedFillColor = R.color.colorRed()! + return button + }() + + let titleLabel: UILabel = .create { view in + view.textColor = R.color.colorWhite() + view.font = .boldTitle2 + view.numberOfLines = 0 + } + + let amountView = TitleHorizontalMultiValueView() + + let amountInputView = NewAmountInputView() + + private(set) var govLocksReuseButton: TriangularedButton? + private(set) var allLocksReuseButton: TriangularedButton? + + let lockReuseContainerView: ScrollableContainerView = { + let view = ScrollableContainerView(axis: .horizontal) + view.stackView.layoutMargins = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16) + view.stackView.isLayoutMarginsRelativeArrangement = true + view.stackView.alignment = .fill + view.stackView.spacing = 8.0 + view.scrollView.showsHorizontalScrollIndicator = false + return view + }() + + let convictionView = ReferendumConvictionView() + + var lockAmountTitleLabel: UILabel { + lockedAmountView.titleView.detailsLabel + } + + let lockedAmountView: TitleValueDiffView = .create { view in + view.applyDefaultStyle() + view.titleView.imageView.image = R.image.iconGovAmountLock() + } + + var lockPeriodTitleLabel: UILabel { + lockedPeriodView.titleView.detailsLabel + } + + let lockedPeriodView: TitleValueDiffView = .create { view in + view.applyDefaultStyle() + view.titleView.imageView.image = R.image.iconGovPeriodLock() + } + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = R.color.colorBlack() + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func bindReuseLocks(viewModel: ReferendumLockReuseViewModel, locale: Locale) { + if viewModel.governance != nil, govLocksReuseButton == nil { + let button = createReuseLockButton() + lockReuseContainerView.stackView.insertArrangedSubview(button, at: 0) + + govLocksReuseButton = button + } else if viewModel.governance == nil, govLocksReuseButton != nil { + govLocksReuseButton?.removeFromSuperview() + govLocksReuseButton = nil + } + + if viewModel.all != nil, allLocksReuseButton == nil { + let button = createReuseLockButton() + lockReuseContainerView.stackView.addArrangedSubview(button) + + allLocksReuseButton = button + } else if viewModel.all == nil, allLocksReuseButton != nil { + allLocksReuseButton?.removeFromSuperview() + allLocksReuseButton = nil + } + + if let governance = viewModel.governance { + govLocksReuseButton?.imageWithTitleView?.title = R.string.localizable.govReuseGovernanceLocks( + governance, + preferredLanguages: locale.rLanguages + ) + + govLocksReuseButton?.invalidateLayout() + } + + if let all = viewModel.all { + allLocksReuseButton?.imageWithTitleView?.title = R.string.localizable.govReuseAllLocks( + all, + preferredLanguages: locale.rLanguages + ) + + allLocksReuseButton?.invalidateLayout() + } + + lockReuseContainerView.isHidden = !viewModel.hasLocks + + lockReuseContainerView.setNeedsLayout() + } + + private func createReuseLockButton() -> TriangularedButton { + let button = TriangularedButton() + button.applySecondaryDefaultStyle() + button.contentInsets = UIEdgeInsets(top: 6, left: 12, bottom: 6, right: 12) + button.imageWithTitleView?.titleFont = .semiBoldFootnote + return button + } + + private func setupLayout() { + addSubview(nayButton) + nayButton.snp.makeConstraints { make in + make.leading.equalToSuperview().inset(UIConstants.horizontalInset) + make.trailing.equalTo(safeAreaLayoutGuide.snp.centerX).offset(-8.0) + make.bottom.equalTo(safeAreaLayoutGuide).inset(UIConstants.actionBottomInset) + make.height.equalTo(UIConstants.actionHeight) + } + + addSubview(ayeButton) + ayeButton.snp.makeConstraints { make in + make.leading.equalTo(safeAreaLayoutGuide.snp.centerX).offset(8.0) + make.trailing.equalToSuperview().inset(UIConstants.horizontalInset) + make.bottom.equalTo(safeAreaLayoutGuide).inset(UIConstants.actionBottomInset) + make.height.equalTo(UIConstants.actionHeight) + } + + addSubview(containerView) + containerView.snp.makeConstraints { make in + make.top.leading.trailing.equalToSuperview() + make.bottom.equalTo(ayeButton.snp.top).offset(-8.0) + } + + containerView.stackView.addArrangedSubview(titleLabel) + + containerView.stackView.setCustomSpacing(12.0, after: titleLabel) + + containerView.stackView.addArrangedSubview(amountView) + containerView.stackView.addArrangedSubview(amountInputView) + + amountView.snp.makeConstraints { make in + make.height.equalTo(34.0) + } + + amountInputView.snp.makeConstraints { make in + make.height.equalTo(64) + } + + containerView.stackView.addArrangedSubview(lockReuseContainerView) + lockReuseContainerView.snp.makeConstraints { make in + make.height.equalTo(32.0) + make.width.equalTo(self) + } + + containerView.stackView.setCustomSpacing(16.0, after: lockReuseContainerView) + + containerView.stackView.setCustomSpacing(12.0, after: amountInputView) + + containerView.stackView.addArrangedSubview(convictionView) + + containerView.stackView.setCustomSpacing(16.0, after: convictionView) + + containerView.stackView.addArrangedSubview(lockedAmountView) + + containerView.stackView.setCustomSpacing(10.0, after: lockedAmountView) + + lockedAmountView.snp.makeConstraints { make in + make.height.equalTo(34.0) + } + + containerView.stackView.addArrangedSubview(lockedPeriodView) + + lockedPeriodView.snp.makeConstraints { make in + make.height.equalTo(34.0) + } + + setupContentWidth() + } + + private func setupContentWidth() { + containerView.stackView.arrangedSubviews + .filter { $0 !== lockReuseContainerView } + .forEach { + $0.snp.makeConstraints { make in + make.width.equalTo(self).offset(-2 * UIConstants.horizontalInset) + } + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupWireframe.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupWireframe.swift new file mode 100644 index 0000000000..0e1aac0a5f --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ReferendumVoteSetupWireframe.swift @@ -0,0 +1,25 @@ +import Foundation + +final class ReferendumVoteSetupWireframe: ReferendumVoteSetupWireframeProtocol { + let state: GovernanceSharedState + + init(state: GovernanceSharedState) { + self.state = state + } + + func showConfirmation( + from view: ReferendumVoteSetupViewProtocol?, + vote: ReferendumNewVote, + initData: ReferendumVotingInitData + ) { + guard let confirmView = ReferendumVoteConfirmViewFactory.createView( + for: state, + newVote: vote, + initData: initData + ) else { + return + } + + view?.controller.navigationController?.pushViewController(confirmView.controller, animated: true) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/View/ReferendumConvictionView.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/View/ReferendumConvictionView.swift new file mode 100644 index 0000000000..d6e09a0e52 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/View/ReferendumConvictionView.swift @@ -0,0 +1,76 @@ +import Foundation +import UIKit +import SoraUI + +final class ReferendumConvictionView: UIView { + let backgroundView: RoundedView = .create { view in + view.applyCellBackgroundStyle() + view.cornerRadius = 12.0 + } + + let titleLabel: UILabel = .create { view in + view.font = .regularFootnote + view.textColor = R.color.colorTransparentText() + } + + let slider: DiscreteGradientSlider = .create { view in + view.applyConvictionDefaultStyle() + } + + let separatorView: UIView = .create { view in + view.backgroundColor = R.color.colorWhite8() + } + + let votesView: UILabel = .create { view in + view.textColor = R.color.colorWhite() + view.font = .boldTitle2 + view.textAlignment = .center + } + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func bind(votes: String) { + votesView.text = votes + + setNeedsLayout() + } + + private func setupLayout() { + addSubview(backgroundView) + + backgroundView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + + let stackView = UIView.vStack([ + titleLabel, + slider, + separatorView, + votesView + ]) + + stackView.spacing = 0 + stackView.setCustomSpacing(13.0, after: titleLabel) + stackView.setCustomSpacing(14.0, after: slider) + stackView.setCustomSpacing(12.0, after: separatorView) + + backgroundView.addSubview(stackView) + + stackView.snp.makeConstraints { make in + make.edges.equalToSuperview().inset(16.0) + } + + separatorView.snp.makeConstraints { make in + make.height.equalTo(1) + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockChangeViewModel.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockChangeViewModel.swift new file mode 100644 index 0000000000..5c17f1d2a8 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockChangeViewModel.swift @@ -0,0 +1,12 @@ +import Foundation + +struct ReferendumLockTransitionViewModel { + struct Change { + let isIncrease: Bool + let value: String + } + + let fromValue: String + let toValue: String + let change: Change? +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockChangeViewModelFactory.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockChangeViewModelFactory.swift new file mode 100644 index 0000000000..45c8d29639 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockChangeViewModelFactory.swift @@ -0,0 +1,280 @@ +import Foundation +import SoraFoundation +import BigInt + +protocol ReferendumLockChangeViewModelFactoryProtocol { + func createTransferableAmountViewModel( + resultLocked: BigUInt?, + balance: AssetBalance, + locks: AssetLocks, + locale: Locale + ) -> ReferendumLockTransitionViewModel? + + func createAmountViewModel( + initLocked: BigUInt, + resultLocked: BigUInt?, + locale: Locale + ) -> ReferendumLockTransitionViewModel? + + func createPeriodViewModel( + initLockedUntil: BlockNumber, + resultLockedUntil: BlockNumber?, + blockNumber: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumLockTransitionViewModel? + + func createRemainedOtherLocksViewModel( + locks: AssetLocks, + locale: Locale + ) -> GovernanceRemainedLockViewModel? +} + +extension ReferendumLockChangeViewModelFactoryProtocol { + func createTransferableAmountViewModel( + from diff: GovernanceLockStateDiff, + balance: AssetBalance, + locks: AssetLocks, + locale: Locale + ) -> ReferendumLockTransitionViewModel? { + createTransferableAmountViewModel( + resultLocked: diff.after?.maxLockedAmount, + balance: balance, + locks: locks, + locale: locale + ) + } + + func createAmountViewModel( + from diff: GovernanceLockStateDiff, + locale: Locale + ) -> ReferendumLockTransitionViewModel? { + createAmountViewModel( + initLocked: diff.before.maxLockedAmount, + resultLocked: diff.after?.maxLockedAmount, + locale: locale + ) + } + + func createPeriodViewModel( + from diff: GovernanceLockStateDiff, + blockNumber: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumLockTransitionViewModel? { + let resultLockedUntil: BlockNumber? + + if let toState = diff.after { + resultLockedUntil = toState.lockedUntil ?? blockNumber + } else { + resultLockedUntil = nil + } + + return createPeriodViewModel( + initLockedUntil: diff.before.lockedUntil ?? blockNumber, + resultLockedUntil: resultLockedUntil, + blockNumber: blockNumber, + blockTime: blockTime, + locale: locale + ) + } +} + +final class ReferendumLockChangeViewModelFactory { + let balanceFormatter: LocalizableResource + let amountFormatter: LocalizableResource + let assetDisplayInfo: AssetBalanceDisplayInfo + let votingLockId: String + + init( + assetDisplayInfo: AssetBalanceDisplayInfo, + assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol = AssetBalanceFormatterFactory(), + votingLockId: String + ) { + balanceFormatter = assetBalanceFormatterFactory.createTokenFormatter(for: assetDisplayInfo) + amountFormatter = assetBalanceFormatterFactory.createDisplayFormatter(for: assetDisplayInfo) + self.assetDisplayInfo = assetDisplayInfo + self.votingLockId = votingLockId + } +} + +extension ReferendumLockChangeViewModelFactory: ReferendumLockChangeViewModelFactoryProtocol { + func createRemainedOtherLocksViewModel( + locks: AssetLocks, + locale: Locale + ) -> GovernanceRemainedLockViewModel? { + let otherLocks = locks.filter { $0.displayId != votingLockId } + + let newLocks = otherLocks.sorted { $0.amount > $1.amount } + + if let lockedAmount = newLocks.first?.amount, lockedAmount > 0 { + let amountDecimal = Decimal.fromSubstrateAmount( + lockedAmount, + precision: assetDisplayInfo.assetPrecision + ) ?? 0 + + let balanceFormatter = balanceFormatter.value(for: locale) + let amountString = balanceFormatter.stringFromDecimal(amountDecimal) ?? "" + + let types = newLocks.map { $0.lockType?.displayType.value(for: locale) ?? $0.displayId ?? "" } + + return .init(amount: amountString, modules: types) + } else { + return nil + } + } + + func createTransferableAmountViewModel( + resultLocked: BigUInt?, + balance: AssetBalance, + locks: AssetLocks, + locale: Locale + ) -> ReferendumLockTransitionViewModel? { + guard + let fromAmountDecimal = Decimal.fromSubstrateAmount( + balance.transferable, + precision: assetDisplayInfo.assetPrecision + ), + let fromAmountString = amountFormatter.value(for: locale).stringFromDecimal(fromAmountDecimal) else { + return nil + } + + let toAmountString: String + let change: ReferendumLockTransitionViewModel.Change? + + let balanceFormatter = balanceFormatter.value(for: locale) + + if let resultLocked = resultLocked { + let otherLocks = locks + .filter { $0.displayId != votingLockId } + .map(\.amount) + .max() ?? 0 + + let newLocked = max(otherLocks, resultLocked) + + let newTransferable = balance.newTransferable(for: newLocked) + + guard + let toAmountDecimal = Decimal.fromSubstrateAmount( + newTransferable, + precision: assetDisplayInfo.assetPrecision + ) else { + return nil + } + + toAmountString = balanceFormatter.stringFromDecimal(toAmountDecimal) ?? "" + + if toAmountDecimal > fromAmountDecimal { + let changeAmountString = balanceFormatter.stringFromDecimal(toAmountDecimal - fromAmountDecimal) ?? "" + change = .init(isIncrease: true, value: changeAmountString) + } else if toAmountDecimal < fromAmountDecimal { + let changeAmountString = balanceFormatter.stringFromDecimal(fromAmountDecimal - toAmountDecimal) ?? "" + change = .init(isIncrease: false, value: changeAmountString) + } else { + change = nil + } + + } else { + toAmountString = balanceFormatter.stringFromDecimal(fromAmountDecimal) ?? "" + change = nil + } + + return .init(fromValue: fromAmountString, toValue: toAmountString, change: change) + } + + func createAmountViewModel( + initLocked: BigUInt, + resultLocked: BigUInt?, + locale: Locale + ) -> ReferendumLockTransitionViewModel? { + guard + let fromAmountDecimal = Decimal.fromSubstrateAmount( + initLocked, + precision: assetDisplayInfo.assetPrecision + ), + let fromAmountString = amountFormatter.value(for: locale).stringFromDecimal(fromAmountDecimal) else { + return nil + } + + let toAmountString: String + let change: ReferendumLockTransitionViewModel.Change? + + let balanceFormatter = balanceFormatter.value(for: locale) + + if let resultLocked = resultLocked { + guard + let toAmountDecimal = Decimal.fromSubstrateAmount( + resultLocked, + precision: assetDisplayInfo.assetPrecision + ) else { + return nil + } + + toAmountString = balanceFormatter.stringFromDecimal(toAmountDecimal) ?? "" + + if toAmountDecimal > fromAmountDecimal { + let changeAmountString = balanceFormatter.stringFromDecimal(toAmountDecimal - fromAmountDecimal) ?? "" + change = .init(isIncrease: true, value: changeAmountString) + } else if toAmountDecimal < fromAmountDecimal { + let changeAmountString = balanceFormatter.stringFromDecimal(fromAmountDecimal - toAmountDecimal) ?? "" + change = .init(isIncrease: false, value: changeAmountString) + } else { + change = nil + } + + } else { + toAmountString = balanceFormatter.stringFromDecimal(fromAmountDecimal) ?? "" + change = nil + } + + return .init(fromValue: fromAmountString, toValue: toAmountString, change: change) + } + + func createPeriodViewModel( + initLockedUntil: BlockNumber, + resultLockedUntil: BlockNumber?, + blockNumber: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumLockTransitionViewModel? { + let fromBlock = max(initLockedUntil, blockNumber) + + let fromPeriod = blockNumber.secondsTo(block: fromBlock, blockDuration: blockTime) + let fromPeriodString = fromPeriod.localizedFractionDays(for: locale, shouldAnnotate: false) + + let toPeriodString: String + let change: ReferendumLockTransitionViewModel.Change? + + if let resultLockedUntil = resultLockedUntil { + let toBlock = max(resultLockedUntil, blockNumber) + let toPeriod = blockNumber.secondsTo(block: toBlock, blockDuration: blockTime) + + toPeriodString = toPeriod.localizedFractionDays(for: locale, shouldAnnotate: true) + + if fromPeriod < toPeriod, (toPeriod - fromPeriod).hoursFromSeconds > 0 { + change = .init( + isIncrease: true, + value: R.string.localizable.commonMaximum( + (toPeriod - fromPeriod).localizedDaysHoursIncludingZero(for: locale), + preferredLanguages: locale.rLanguages + ) + ) + } else if fromPeriod > toPeriod, (fromPeriod - toPeriod).hoursFromSeconds > 0 { + change = .init( + isIncrease: false, + value: R.string.localizable.commonMaximum( + (fromPeriod - toPeriod).localizedDaysHoursIncludingZero(for: locale), + preferredLanguages: locale.rLanguages + ) + ) + } else { + change = nil + } + } else { + toPeriodString = fromPeriod.localizedFractionDays(for: locale, shouldAnnotate: true) + change = nil + } + + return .init(fromValue: fromPeriodString, toValue: toPeriodString, change: change) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockReuseViewModel.swift b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockReuseViewModel.swift new file mode 100644 index 0000000000..a7e578b3b9 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoteSetup/ViewModel/ReferendumLockReuseViewModel.swift @@ -0,0 +1,10 @@ +import Foundation + +struct ReferendumLockReuseViewModel { + let governance: String? + let all: String? + + var hasLocks: Bool { + governance != nil || all != nil + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersInteractorError.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersInteractorError.swift new file mode 100644 index 0000000000..f166fc101e --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersInteractorError.swift @@ -0,0 +1,5 @@ +import Foundation + +enum ReferendumVotersInteractorError: Error { + case votersFetchFailed(_ internalError: Error) +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersModel.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersModel.swift new file mode 100644 index 0000000000..874340ca8e --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersModel.swift @@ -0,0 +1,6 @@ +import Foundation + +struct ReferendumVotersModel { + let voters: [ReferendumVoterLocal] + let identites: [AccountAddress: AccountIdentity] +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersType.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersType.swift new file mode 100644 index 0000000000..c6decefef4 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/Model/ReferendumVotersType.swift @@ -0,0 +1,6 @@ +import Foundation + +enum ReferendumVotersType { + case ayes + case nays +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersInteractor.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersInteractor.swift new file mode 100644 index 0000000000..2061e487e6 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersInteractor.swift @@ -0,0 +1,87 @@ +import UIKit +import SubstrateSdk +import RobinHood + +final class ReferendumVotersInteractor { + weak var presenter: ReferendumVotersInteractorOutputProtocol? + + let referendumsOperationFactory: ReferendumsOperationFactoryProtocol + let chain: ChainModel + let referendumIndex: ReferendumIdLocal + let identityOperationFactory: IdentityOperationFactoryProtocol + let connection: JSONRPCEngine + let runtimeProvider: RuntimeProviderProtocol + let operationQueue: OperationQueue + + init( + referendumIndex: ReferendumIdLocal, + chain: ChainModel, + referendumsOperationFactory: ReferendumsOperationFactoryProtocol, + identityOperationFactory: IdentityOperationFactoryProtocol, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + operationQueue: OperationQueue + ) { + self.referendumIndex = referendumIndex + self.chain = chain + self.referendumsOperationFactory = referendumsOperationFactory + self.identityOperationFactory = identityOperationFactory + self.connection = connection + self.runtimeProvider = runtimeProvider + self.operationQueue = operationQueue + } + + private func provideVoters() { + let voterWrapper = referendumsOperationFactory.fetchVotersWrapper( + for: referendumIndex, + from: connection, + runtimeProvider: runtimeProvider + ) + + let identityWrapper = identityOperationFactory.createIdentityWrapper( + for: { + let voters = try voterWrapper.targetOperation.extractNoCancellableResultData() + return voters.map(\.accountId) + }, + engine: connection, + runtimeService: runtimeProvider, + chainFormat: chain.chainFormat + ) + + identityWrapper.addDependency(wrapper: voterWrapper) + + let mappingOperation = ClosureOperation { + let voters = try voterWrapper.targetOperation.extractNoCancellableResultData() + let identities = try identityWrapper.targetOperation.extractNoCancellableResultData() + + return ReferendumVotersModel(voters: voters, identites: identities) + } + + mappingOperation.addDependency(identityWrapper.targetOperation) + + mappingOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + do { + let model = try mappingOperation.extractNoCancellableResultData() + self?.presenter?.didReceiveVoters(model) + } catch { + self?.presenter?.didReceiveError(.votersFetchFailed(error)) + } + } + } + + let operations = voterWrapper.allOperations + identityWrapper.allOperations + [mappingOperation] + + operationQueue.addOperations(operations, waitUntilFinished: false) + } +} + +extension ReferendumVotersInteractor: ReferendumVotersInteractorInputProtocol { + func setup() { + provideVoters() + } + + func refreshVoters() { + provideVoters() + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersPresenter.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersPresenter.swift new file mode 100644 index 0000000000..396d9b0c31 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersPresenter.swift @@ -0,0 +1,158 @@ +import Foundation +import SoraFoundation +import BigInt + +final class ReferendumVotersPresenter { + weak var view: ReferendumVotersViewProtocol? + let wireframe: ReferendumVotersWireframeProtocol + let interactor: ReferendumVotersInteractorInputProtocol + let stringFactory: ReferendumDisplayStringFactoryProtocol + + let referendum: ReferendumLocal + let chain: ChainModel + let type: ReferendumVotersType + let logger: LoggerProtocol + + private var model: ReferendumVotersModel? + + private lazy var displayAddressFactory = DisplayAddressViewModelFactory() + + init( + interactor: ReferendumVotersInteractorInputProtocol, + wireframe: ReferendumVotersWireframeProtocol, + type: ReferendumVotersType, + referendum: ReferendumLocal, + chain: ChainModel, + stringFactory: ReferendumDisplayStringFactoryProtocol, + localizationManager: LocalizationManagerProtocol, + logger: LoggerProtocol + ) { + self.interactor = interactor + self.wireframe = wireframe + self.type = type + self.referendum = referendum + self.stringFactory = stringFactory + self.chain = chain + self.logger = logger + + self.localizationManager = localizationManager + } + + private func createViewModel( + _ model: ReferendumVotersModel, + voter: ReferendumVoterLocal + ) -> ReferendumVotersViewModel? { + guard let address = try? voter.accountId.toAddress(using: chain.chainFormat) else { + return nil + } + + let displayAddressViewModel: DisplayAddressViewModel + + if let displayName = model.identites[address]?.displayName { + let displayAddress = DisplayAddress(address: address, username: displayName) + displayAddressViewModel = displayAddressFactory.createViewModel(from: displayAddress) + } else { + displayAddressViewModel = displayAddressFactory.createViewModel(from: address) + } + + let amountInPlank: BigUInt + let votes: BigUInt + + switch type { + case .ayes: + amountInPlank = voter.vote.ayeBalance + votes = voter.vote.ayes + case .nays: + amountInPlank = voter.vote.nayBalance + votes = voter.vote.nays + } + + let votesString = stringFactory.createVotes(from: votes, chain: chain, locale: selectedLocale) + let details = stringFactory.createVotesDetails( + from: amountInPlank, + conviction: voter.vote.conviction, + chain: chain, + locale: selectedLocale + ) + + return ReferendumVotersViewModel( + displayAddress: displayAddressViewModel, + votes: votesString ?? "", + preConviction: details ?? "" + ) + } + + private func updateView() { + guard let model = model else { + return + } + + let viewModels: [ReferendumVotersViewModel] = model.voters.filter { voter in + switch type { + case .ayes: + return voter.vote.hasAyeVotes + case .nays: + return voter.vote.hasNayVotes + } + } + .sorted { + switch type { + case .ayes: + return $0.vote.ayes > $1.vote.ayes + case .nays: + return $0.vote.nays > $1.vote.nays + } + } + .compactMap { voter in + createViewModel(model, voter: voter) + } + + view?.didReceiveViewModels(.loaded(value: viewModels)) + } +} + +extension ReferendumVotersPresenter: ReferendumVotersPresenterProtocol { + func setup() { + view?.didReceiveViewModels(.loading) + + interactor.setup() + } + + func selectVoter(for viewModel: ReferendumVotersViewModel) { + guard let view = view else { + return + } + + wireframe.presentAccountOptions( + from: view, + address: viewModel.displayAddress.address, + chain: chain, + locale: selectedLocale + ) + } +} + +extension ReferendumVotersPresenter: ReferendumVotersInteractorOutputProtocol { + func didReceiveVoters(_ voters: ReferendumVotersModel) { + model = voters + + updateView() + } + + func didReceiveError(_ error: ReferendumVotersInteractorError) { + logger.error("Did receive error: \(error)") + + switch error { + case .votersFetchFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.refreshVoters() + } + } + } +} + +extension ReferendumVotersPresenter: Localizable { + func applyLocalization() { + updateView() + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersProtocols.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersProtocols.swift new file mode 100644 index 0000000000..8258f7b27d --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersProtocols.swift @@ -0,0 +1,21 @@ +protocol ReferendumVotersViewProtocol: ControllerBackedProtocol { + func didReceiveViewModels(_ viewModels: LoadableViewModelState<[ReferendumVotersViewModel]>) +} + +protocol ReferendumVotersPresenterProtocol: AnyObject { + func setup() + + func selectVoter(for viewModel: ReferendumVotersViewModel) +} + +protocol ReferendumVotersInteractorInputProtocol: AnyObject { + func setup() + func refreshVoters() +} + +protocol ReferendumVotersInteractorOutputProtocol: AnyObject { + func didReceiveVoters(_ voters: ReferendumVotersModel) + func didReceiveError(_ error: ReferendumVotersInteractorError) +} + +protocol ReferendumVotersWireframeProtocol: AlertPresentable, ErrorPresentable, CommonRetryable, AddressOptionsPresentable {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewController.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewController.swift new file mode 100644 index 0000000000..0339c1d2de --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewController.swift @@ -0,0 +1,173 @@ +import UIKit +import SoraFoundation +import SoraUI + +final class ReferendumVotersViewController: UIViewController, ViewHolder { + typealias RootViewType = ReferendumVotersViewLayout + + private let votersType: ReferendumVotersType + private let quantityFormatter: LocalizableResource + + private var state: LoadableViewModelState<[ReferendumVotersViewModel]>? + + let presenter: ReferendumVotersPresenterProtocol + + init( + presenter: ReferendumVotersPresenterProtocol, + votersType: ReferendumVotersType, + quantityFormatter: LocalizableResource, + localizationManager: LocalizationManagerProtocol + ) { + self.presenter = presenter + self.votersType = votersType + self.quantityFormatter = quantityFormatter + + super.init(nibName: nil, bundle: nil) + + self.localizationManager = localizationManager + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = ReferendumVotersViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + setupLocalization() + configureTableView() + + presenter.setup() + } + + override func viewWillLayoutSubviews() { + super.viewWillLayoutSubviews() + + switch state { + case .loading: + rootView.updateLoadingState() + case .loaded, .cached, .none: + break + } + } + + private func configureTableView() { + rootView.tableView.registerClassForCell(ReferendumVotersTableViewCell.self) + rootView.tableView.delegate = self + rootView.tableView.dataSource = self + rootView.tableView.rowHeight = ReferendumVotersTableViewCell.Constants.rowHeight + } + + private func setupLocalization() { + switch votersType { + case .ayes: + title = R.string.localizable.govVotersAye(preferredLanguages: selectedLocale.rLanguages) + case .nays: + title = R.string.localizable.govVotersNay(preferredLanguages: selectedLocale.rLanguages) + } + } + + private func setupCounter(value: Int?) { + navigationItem.rightBarButtonItem = nil + + let formatter = quantityFormatter.value(for: selectedLocale) + + guard + let value = value, + let valueString = formatter.string(from: value as NSNumber) else { + return + } + + rootView.totalVotersLabel.titleLabel.text = valueString + rootView.totalVotersLabel.sizeToFit() + + navigationItem.rightBarButtonItem = UIBarButtonItem(customView: rootView.totalVotersLabel) + } +} + +extension ReferendumVotersViewController: UITableViewDataSource { + func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int { + state?.value?.count ?? 0 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCellWithType(ReferendumVotersTableViewCell.self)! + + if let viewModel = state?.value?[indexPath.row] { + cell.bind(viewModel: viewModel) + } + + return cell + } +} + +extension ReferendumVotersViewController: UITableViewDelegate { + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + + guard let viewModels = state?.value else { + return + } + + presenter.selectVoter(for: viewModels[indexPath.row]) + } +} + +extension ReferendumVotersViewController: EmptyStateViewOwnerProtocol { + var emptyStateDelegate: EmptyStateDelegate { self } + var emptyStateDataSource: EmptyStateDataSource { self } + var contentViewForEmptyState: UIView { rootView } +} + +extension ReferendumVotersViewController: EmptyStateDataSource { + var viewForEmptyState: UIView? { + let emptyView = EmptyStateView() + emptyView.image = R.image.iconEmptyHistory() + emptyView.title = R.string.localizable.govVotersEmpty(preferredLanguages: selectedLocale.rLanguages) + emptyView.titleColor = R.color.colorTransparentText()! + emptyView.titleFont = .regularFootnote + return emptyView + } +} + +extension ReferendumVotersViewController: EmptyStateDelegate { + var shouldDisplayEmptyState: Bool { + switch state { + case let .loaded(value), let .cached(value): + return value.isEmpty + case .loading, .none: + return false + } + } +} + +extension ReferendumVotersViewController: ReferendumVotersViewProtocol { + func didReceiveViewModels(_ viewModels: LoadableViewModelState<[ReferendumVotersViewModel]>) { + state = viewModels + rootView.tableView.reloadData() + + setupCounter(value: viewModels.value?.count) + + switch viewModels { + case .loading: + rootView.startLoadingIfNeeded() + case .loaded, .cached: + rootView.stopLoadingIfNeeded() + } + + reloadEmptyState(animated: false) + } +} + +extension ReferendumVotersViewController: Localizable { + func applyLocalization() { + if isViewLoaded { + setupLocalization() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewFactory.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewFactory.swift new file mode 100644 index 0000000000..ae30b4a8c7 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewFactory.swift @@ -0,0 +1,90 @@ +import Foundation +import SubstrateSdk +import RobinHood +import SoraFoundation + +struct ReferendumVotersViewFactory { + static func createView( + state: GovernanceSharedState, + referendum: ReferendumLocal, + type: ReferendumVotersType + ) -> ReferendumVotersViewProtocol? { + guard + let interactor = createInteractor(for: state, referendum: referendum), + let chain = state.settings.value?.chain + else { + return nil + } + + let wireframe = ReferendumVotersWireframe() + + let localizationManager = LocalizationManager.shared + + let stringViewModelFactory = ReferendumDisplayStringFactory( + formatterFactory: AssetBalanceFormatterFactory() + ) + + let presenter = ReferendumVotersPresenter( + interactor: interactor, + wireframe: wireframe, + type: type, + referendum: referendum, + chain: chain, + stringFactory: stringViewModelFactory, + localizationManager: localizationManager, + logger: Logger.shared + ) + + let view = ReferendumVotersViewController( + presenter: presenter, + votersType: type, + quantityFormatter: NumberFormatter.quantity.localizableResource(), + localizationManager: localizationManager + ) + + presenter.view = view + interactor.presenter = presenter + + return view + } + + private static func createInteractor( + for state: GovernanceSharedState, + referendum: ReferendumLocal + ) -> ReferendumVotersInteractor? { + guard let chain = state.settings.value?.chain else { + return nil + } + + let chainRegistry = ChainRegistryFacade.sharedRegistry + + guard + let connection = chainRegistry.getConnection(for: chain.chainId), + let runtimeProvider = chainRegistry.getRuntimeProvider(for: chain.chainId), + let referendumsOperationFactory = state.referendumsOperationFactory else { + return nil + } + + let operationQueue = OperationQueue() + + let requestFactory = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: OperationManager(operationQueue: operationQueue) + ) + + let identityOperationFactory = IdentityOperationFactory( + requestFactory: requestFactory, + emptyIdentitiesWhenNoStorage: true + ) + + return ReferendumVotersInteractor( + referendumIndex: referendum.index, + chain: chain, + referendumsOperationFactory: referendumsOperationFactory, + identityOperationFactory: identityOperationFactory, + connection: connection, + runtimeProvider: runtimeProvider, + operationQueue: operationQueue + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewLayout.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewLayout.swift new file mode 100644 index 0000000000..62422be43a --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersViewLayout.swift @@ -0,0 +1,120 @@ +import UIKit +import SoraUI + +final class ReferendumVotersViewLayout: UIView, AdaptiveDesignable { + var skeletonView: SkrullableView? + + let totalVotersLabel: BorderedLabelView = .create { view in + view.backgroundView.fillColor = R.color.colorWhite16()! + view.titleLabel.apply(style: .init(textColor: R.color.colorWhite80()!, font: .semiBoldFootnote)) + view.contentInsets = UIEdgeInsets(top: 2, left: 8, bottom: 2, right: 8) + view.backgroundView.cornerRadius = 6 + } + + let tableView: UITableView = .create { view in + view.separatorStyle = .none + view.backgroundColor = .clear + view.contentInset = UIEdgeInsets(top: 8, left: 0, bottom: 0, right: 0) + } + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = R.color.colorBlack()! + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + addSubview(tableView) + + tableView.snp.makeConstraints { make in + make.top.equalTo(safeAreaLayoutGuide) + make.leading.trailing.bottom.equalToSuperview() + } + } +} + +extension ReferendumVotersViewLayout: SkeletonableView { + var skeletonSpaceSize: CGSize { + CGSize(width: frame.width, height: ReferendumVotersTableViewCell.Constants.rowHeight) + } + + var skeletonReplica: SkeletonableViewReplica { + let count = UInt32(20 * designScaleRatio.height) + + return SkeletonableViewReplica(count: count, spacing: 0.0) + } + + var hidingViews: [UIView] { [] } + + var skeletonSuperview: UIView { self } + + // swiftlint:disable:next function_body_length + func createSkeletons(for spaceSize: CGSize) -> [Skeletonable] { + let centerY = tableView.contentInset.top + spaceSize.height / 2.0 + let insetX = UIConstants.horizontalInset + + let imageSize = CGSize(width: 22.0, height: 22.0) + + let nameSize = CGSize(width: 120.0, height: 14) + let nameOffsetX = insetX + imageSize.width + ReferendumVotersTableViewCell.Constants.addressNameSpacing + + let indicatorSize = CGSize(width: 12, height: 12) + let indicatorOffsetX = nameOffsetX + nameSize.width + + ReferendumVotersTableViewCell.Constants.addressIndicatorSpacing + + let votesSize = CGSize(width: 60, height: 14) + + let votesDetailsSize = CGSize(width: 80, height: 14) + + return [ + SingleSkeleton.createRow( + on: tableView, + containerView: self, + spaceSize: spaceSize, + offset: CGPoint(x: insetX, y: centerY - imageSize.height / 2.0), + size: imageSize + ), + SingleSkeleton.createRow( + on: tableView, + containerView: self, + spaceSize: spaceSize, + offset: CGPoint(x: nameOffsetX, y: centerY - nameSize.height / 2.0), + size: nameSize + ), + SingleSkeleton.createRow( + on: tableView, + containerView: self, + spaceSize: spaceSize, + offset: CGPoint(x: indicatorOffsetX, y: centerY - indicatorSize.height / 2.0), + size: indicatorSize + ), + SingleSkeleton.createRow( + on: tableView, + containerView: self, + spaceSize: spaceSize, + offset: CGPoint( + x: spaceSize.width - UIConstants.horizontalInset - votesSize.width, + y: tableView.contentInset.top + spaceSize.height / 3 - votesSize.height / 2.0 + ), + size: votesSize + ), + SingleSkeleton.createRow( + on: tableView, + containerView: self, + spaceSize: spaceSize, + offset: CGPoint( + x: spaceSize.width - UIConstants.horizontalInset - votesDetailsSize.width, + y: tableView.contentInset.top + 2 * spaceSize.height / 3 - votesDetailsSize.height / 2.0 + ), + size: votesDetailsSize + ) + ] + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersWireframe.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersWireframe.swift new file mode 100644 index 0000000000..f962cf284a --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/ReferendumVotersWireframe.swift @@ -0,0 +1,3 @@ +import Foundation + +final class ReferendumVotersWireframe: ReferendumVotersWireframeProtocol {} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/View/ReferendumVotersTableViewCell.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/View/ReferendumVotersTableViewCell.swift new file mode 100644 index 0000000000..93fe54e3b3 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/View/ReferendumVotersTableViewCell.swift @@ -0,0 +1,102 @@ +import UIKit + +final class ReferendumVotersTableViewCell: UITableViewCell { + enum Constants { + static let rowHeight: CGFloat = 44.0 + static let titleValueSpacing: CGFloat = 32.0 + static let addressNameSpacing: CGFloat = 12.0 + static let addressIndicatorSpacing: CGFloat = 4.0 + static let iconSize = CGSize(width: 24.0, height: 24.0) + static let indicatorSize = CGSize(width: 16.0, height: 16.0) + } + + typealias ContentView = GenericTitleValueView, MultiValueView> + + let baseView = ContentView() + + var iconView: UIImageView { + baseView.titleView.imageView + } + + var nameLabel: UILabel { + baseView.titleView.detailsView.detailsLabel + } + + var indicatorView: UIImageView { + baseView.titleView.detailsView.imageView + } + + var votesLabel: UILabel { + baseView.valueView.valueTop + } + + var detailsLabel: UILabel { + baseView.valueView.valueBottom + } + + private var iconViewModel: ImageViewModelProtocol? + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + + setupLayout() + applyStyle() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func bind(viewModel: ReferendumVotersViewModel) { + iconViewModel?.cancel(on: iconView) + iconViewModel = viewModel.displayAddress.imageViewModel + + let imageSize = CGSize(width: baseView.titleView.iconWidth, height: baseView.titleView.iconWidth) + iconViewModel?.loadImage(on: iconView, targetSize: imageSize, animated: true) + + let cellViewModel = viewModel.displayAddress.cellViewModel + nameLabel.text = cellViewModel.details + nameLabel.lineBreakMode = viewModel.displayAddress.lineBreakMode + + votesLabel.text = viewModel.votes + detailsLabel.text = viewModel.preConviction + + setNeedsLayout() + } + + private func applyStyle() { + backgroundColor = .clear + + baseView.spacing = Constants.titleValueSpacing + baseView.titleView.mode = .iconDetails + baseView.titleView.iconWidth = Constants.iconSize.width + baseView.titleView.spacing = Constants.addressNameSpacing + + baseView.titleView.detailsView.spacing = Constants.addressIndicatorSpacing + baseView.titleView.detailsView.iconWidth = Constants.indicatorSize.width + baseView.titleView.detailsView.mode = .detailsIcon + + baseView.valueView.stackView.alignment = .fill + + nameLabel.numberOfLines = 1 + nameLabel.apply(style: UILabel.Style(textColor: R.color.colorWhite()!, font: .regularFootnote)) + indicatorView.image = R.image.iconInfoFilled()?.tinted(with: R.color.colorWhite48()!) + + votesLabel.apply(style: UILabel.Style(textColor: R.color.colorWhite()!, font: .regularFootnote)) + detailsLabel.apply(style: UILabel.Style(textColor: R.color.colorTransparentText()!, font: .caption1)) + + let selectedBackgroundView = UIView() + selectedBackgroundView.backgroundColor = R.color.colorAccentSelected() + self.selectedBackgroundView = selectedBackgroundView + } + + private func setupLayout() { + contentView.addSubview(baseView) + + baseView.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(UIConstants.horizontalInset) + make.top.bottom.equalToSuperview() + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ReferendumVoters/ViewModel/ReferendumVotersViewModel.swift b/novawallet/Modules/Vote/Governance/ReferendumVoters/ViewModel/ReferendumVotersViewModel.swift new file mode 100644 index 0000000000..3bfdca02c9 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ReferendumVoters/ViewModel/ReferendumVotersViewModel.swift @@ -0,0 +1,7 @@ +import Foundation + +struct ReferendumVotersViewModel { + let displayAddress: DisplayAddressViewModel + let votes: String + let preConviction: String +} diff --git a/novawallet/Modules/Vote/Governance/Referendums/Model/ReferendumsInteractorError.swift b/novawallet/Modules/Vote/Governance/Referendums/Model/ReferendumsInteractorError.swift new file mode 100644 index 0000000000..4084971b02 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Referendums/Model/ReferendumsInteractorError.swift @@ -0,0 +1,15 @@ +import Foundation + +enum ReferendumsInteractorError: Error { + case settingsLoadFailed + case priceSubscriptionFailed(_ internalError: Error) + case balanceSubscriptionFailed(_ internalError: Error) + case chainSaveFailed(_ internalError: Error) + case referendumsFetchFailed(_ internalError: Error) + case blockNumberSubscriptionFailed(_ internalError: Error) + case metadataSubscriptionFailed(_ internalError: Error) + case votingSubscriptionFailed(_ internalError: Error) + case blockTimeFetchFailed(_ internalError: Error) + case blockTimeServiceFailed(_ internalError: Error) + case unlockScheduleFetchFailed(_ internalError: Error) +} diff --git a/novawallet/Modules/Vote/Governance/Referendums/ReferendumsInteractor.swift b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsInteractor.swift new file mode 100644 index 0000000000..02ae5a4f2c --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsInteractor.swift @@ -0,0 +1,496 @@ +import Foundation +import RobinHood +import SubstrateSdk +import SoraFoundation + +final class ReferendumsInteractor: AnyProviderAutoCleaning, AnyCancellableCleaning { + weak var presenter: ReferendumsInteractorOutputProtocol? + + let selectedMetaAccount: MetaAccountModel + let governanceState: GovernanceSharedState + let chainRegistry: ChainRegistryProtocol + let walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol + let priceLocalSubscriptionFactory: PriceProviderFactoryProtocol + let applicationHandler: ApplicationHandlerProtocol + let serviceFactory: GovernanceServiceFactoryProtocol + let operationQueue: OperationQueue + + var generalLocalSubscriptionFactory: GeneralStorageSubscriptionFactoryProtocol { + governanceState.generalLocalSubscriptionFactory + } + + private var priceProvider: AnySingleValueProvider? + private var assetBalanceProvider: StreamableProvider? + private var blockNumberSubscription: AnyDataProvider? + private var metadataProvider: StreamableProvider? + + private lazy var localKeyFactory = LocalStorageKeyFactory() + + private var referendumsCancellable: CancellableCall? + private var blockTimeCancellable: CancellableCall? + private var unlockScheduleCancellable: CancellableCall? + + init( + selectedMetaAccount: MetaAccountModel, + governanceState: GovernanceSharedState, + chainRegistry: ChainRegistryProtocol, + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol, + priceLocalSubscriptionFactory: PriceProviderFactoryProtocol, + serviceFactory: GovernanceServiceFactoryProtocol, + applicationHandler: ApplicationHandlerProtocol, + operationQueue: OperationQueue, + currencyManager: CurrencyManagerProtocol + ) { + self.selectedMetaAccount = selectedMetaAccount + self.governanceState = governanceState + self.chainRegistry = chainRegistry + self.walletLocalSubscriptionFactory = walletLocalSubscriptionFactory + self.priceLocalSubscriptionFactory = priceLocalSubscriptionFactory + self.serviceFactory = serviceFactory + self.operationQueue = operationQueue + self.applicationHandler = applicationHandler + self.currencyManager = currencyManager + } + + deinit { + clearBlockTimeService() + clearCancellable() + } + + private func clear() { + clear(streamableProvider: &assetBalanceProvider) + clear(singleValueProvider: &priceProvider) + clear(streamableProvider: &metadataProvider) + + clearBlockTimeService() + clearSubscriptionFactory() + + blockNumberSubscription = nil + + clearCancellable() + } + + private func clearCancellable() { + clear(cancellable: &referendumsCancellable) + clear(cancellable: &blockTimeCancellable) + clear(cancellable: &unlockScheduleCancellable) + } + + private func clearBlockTimeService() { + governanceState.blockTimeService?.throttle() + governanceState.replaceBlockTimeService(nil) + } + + private func clearSubscriptionFactory() { + governanceState.replaceGovernanceFactory(for: nil) + } + + private func continueSetup() { + applicationHandler.delegate = self + + guard let option = governanceState.settings.value else { + presenter?.didReceiveError(.settingsLoadFailed) + return + } + + let accountResponse = selectedMetaAccount.fetch(for: option.chain.accountRequest()) + + setup(with: accountResponse?.accountId, option: option) + } + + private func setup(with accountId: AccountId?, option: GovernanceSelectedOption) { + presenter?.didReceiveSelectedOption(option) + + if let accountId = accountId { + subscribeToAssetBalance(for: accountId, chain: option.chain) + } else { + presenter?.didReceiveAssetBalance(nil) + } + + subscribeToAssetPrice(for: option.chain) + + setupBlockTimeService(for: option.chain) + provideBlockTime() + + setupSubscriptionFactory(for: option) + + subscribeToBlockNumber(for: option.chain) + subscribeToMetadata(for: option) + + if let accountId = accountId { + subscribeAccountVotes(for: accountId) + } else { + presenter?.didReceiveVoting(.init(value: nil, blockHash: nil)) + } + } + + private func setupBlockTimeService(for chain: ChainModel) { + do { + let blockTimeService = try serviceFactory.createBlockTimeService(for: chain.chainId) + + governanceState.replaceBlockTimeService(blockTimeService) + + blockTimeService.setup() + } catch { + presenter?.didReceiveError(.blockTimeServiceFailed(error)) + } + } + + private func setupSubscriptionFactory(for option: GovernanceSelectedOption) { + governanceState.replaceGovernanceFactory(for: option) + } + + private func subscribeToBlockNumber(for chain: ChainModel) { + guard blockNumberSubscription == nil else { + return + } + + blockNumberSubscription = subscribeToBlockNumber(for: chain.chainId) + } + + private func subscribeToAssetBalance(for accountId: AccountId, chain: ChainModel) { + guard let asset = chain.utilityAsset() else { + return + } + + assetBalanceProvider = subscribeToAssetBalanceProvider( + for: accountId, + chainId: chain.chainId, + assetId: asset.assetId + ) + } + + private func subscribeToAssetPrice(for chain: ChainModel) { + guard let priceId = chain.utilityAsset()?.priceId else { + return + } + + priceProvider = subscribeToPrice(for: priceId, currency: selectedCurrency) + } + + private func subscribeToMetadata(for option: GovernanceSelectedOption) { + metadataProvider = subscribeGovernanceMetadata(for: option) + + if metadataProvider == nil { + presenter?.didReceiveReferendumsMetadata([]) + } + } + + private func handleOptionChange(for newOption: GovernanceSelectedOption) { + clear() + + let chain = newOption.chain + let accountResponse = selectedMetaAccount.fetch(for: chain.accountRequest()) + + setup(with: accountResponse?.accountId, option: newOption) + } + + private func provideBlockTime() { + guard + blockTimeCancellable == nil, + let blockTimeService = governanceState.blockTimeService, + let blockTimeFactory = governanceState.createBlockTimeOperationFactory(), + let chain = governanceState.settings.value?.chain else { + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chain.chainId) else { + presenter?.didReceiveError(.blockTimeFetchFailed(ChainRegistryError.runtimeMetadaUnavailable)) + return + } + + let blockTimeWrapper = blockTimeFactory.createBlockTimeOperation( + from: runtimeProvider, + blockTimeEstimationService: blockTimeService + ) + + blockTimeWrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard self?.blockTimeCancellable === blockTimeWrapper else { + return + } + + self?.blockTimeCancellable = nil + + do { + let blockTime = try blockTimeWrapper.targetOperation.extractNoCancellableResultData() + + self?.presenter?.didReceiveBlockTime(blockTime) + } catch { + self?.presenter?.didReceiveError(.blockTimeFetchFailed(error)) + } + } + } + + blockTimeCancellable = blockTimeWrapper + + operationQueue.addOperations(blockTimeWrapper.allOperations, waitUntilFinished: false) + } + + private func provideReferendumsIfNeeded() { + guard referendumsCancellable == nil else { + return + } + + guard let chain = governanceState.settings.value?.chain else { + presenter?.didReceiveError(.referendumsFetchFailed(PersistentValueSettingsError.missingValue)) + return + } + + guard let connection = chainRegistry.getConnection(for: chain.chainId) else { + presenter?.didReceiveError(.referendumsFetchFailed(ChainRegistryError.connectionUnavailable)) + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chain.chainId) else { + presenter?.didReceiveError(.referendumsFetchFailed(ChainRegistryError.runtimeMetadaUnavailable)) + return + } + + guard let referendumsOperationFactory = governanceState.referendumsOperationFactory else { + presenter?.didReceiveReferendums([]) + return + } + + let wrapper = referendumsOperationFactory.fetchAllReferendumsWrapper( + from: connection, + runtimeProvider: runtimeProvider + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.referendumsCancellable else { + return + } + + self?.referendumsCancellable = nil + + do { + let referendums = try wrapper.targetOperation.extractNoCancellableResultData() + self?.presenter?.didReceiveReferendums(referendums) + } catch { + self?.presenter?.didReceiveError(.referendumsFetchFailed(error)) + } + } + } + + referendumsCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + private func subscribeAccountVotes(for accountId: AccountId) { + guard let subscriptionFactory = governanceState.subscriptionFactory else { + return + } + + subscriptionFactory.subscribeToAccountVotes(self, accountId: accountId) { [weak self] result in + switch result { + case let .success(voting): + self?.presenter?.didReceiveVoting(voting) + case let .failure(error): + self?.presenter?.didReceiveError(.votingSubscriptionFailed(error)) + case .none: + break + } + } + } +} + +extension ReferendumsInteractor: ReferendumsInteractorInputProtocol { + func setup() { + DispatchQueue.global(qos: .userInteractive).async { [weak self] in + self?.governanceState.settings.setup(runningCompletionIn: .main) { result in + switch result { + case .success: + self?.continueSetup() + case .failure: + self?.presenter?.didReceiveError(.settingsLoadFailed) + } + } + } + } + + func remakeSubscriptions() { + clear() + + blockNumberSubscription?.removeObserver(self) + blockNumberSubscription = nil + + if let option = governanceState.settings.value { + let chain = option.chain + let accountResponse = selectedMetaAccount.fetch(for: chain.accountRequest()) + + setup(with: accountResponse?.accountId, option: option) + } + } + + func saveSelected(option: GovernanceSelectedOption) { + if option != governanceState.settings.value { + clear() + + governanceState.settings.save(value: option, runningCompletionIn: .main) { [weak self] result in + switch result { + case let .success(option): + self?.handleOptionChange(for: option) + case let .failure(error): + self?.presenter?.didReceiveError(.chainSaveFailed(error)) + } + } + } + } + + func becomeOnline() { + if let chain = governanceState.settings.value?.chain { + subscribeToBlockNumber(for: chain) + } + } + + func putOffline() { + blockNumberSubscription?.removeObserver(self) + blockNumberSubscription = nil + } + + func refresh() { + if governanceState.settings.value != nil { + provideReferendumsIfNeeded() + provideBlockTime() + + metadataProvider?.refresh() + } + } + + func refreshUnlockSchedule(for tracksVoting: ReferendumTracksVotingDistribution, blockHash: Data?) { + if let chain = governanceState.settings.value?.chain { + clear(cancellable: &unlockScheduleCancellable) + + guard let connection = chainRegistry.getConnection(for: chain.chainId) else { + presenter?.didReceiveError(.unlockScheduleFetchFailed(ChainRegistryError.connectionUnavailable)) + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chain.chainId) else { + presenter?.didReceiveError(.unlockScheduleFetchFailed(ChainRegistryError.runtimeMetadaUnavailable)) + return + } + + guard let lockStateFactory = governanceState.locksOperationFactory else { + presenter?.didReceiveUnlockSchedule(.init(items: [])) + return + } + + let wrapper = lockStateFactory.buildUnlockScheduleWrapper( + for: tracksVoting, + from: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard self?.unlockScheduleCancellable === wrapper else { + return + } + + self?.unlockScheduleCancellable = nil + + do { + let schedule = try wrapper.targetOperation.extractNoCancellableResultData() + self?.presenter?.didReceiveUnlockSchedule(schedule) + } catch { + self?.presenter?.didReceiveError(.unlockScheduleFetchFailed(error)) + } + } + } + + unlockScheduleCancellable = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + } + + func retryBlockTime() { + provideBlockTime() + } +} + +extension ReferendumsInteractor: GovMetadataLocalStorageSubscriber, GovMetadataLocalStorageHandler { + var govMetadataLocalSubscriptionFactory: GovMetadataLocalSubscriptionFactoryProtocol { + governanceState.govMetadataLocalSubscriptionFactory + } + + func handleGovernanceMetadataPreview( + result: Result<[DataProviderChange], Error>, + option: GovernanceSelectedOption + ) { + guard let currentOption = governanceState.settings.value, currentOption == option else { + return + } + + switch result { + case let .success(changes): + presenter?.didReceiveReferendumsMetadata(changes) + case let .failure(error): + presenter?.didReceiveError(.metadataSubscriptionFailed(error)) + } + } +} + +extension ReferendumsInteractor: WalletLocalSubscriptionHandler, WalletLocalStorageSubscriber { + func handleAssetBalance( + result: Result, + accountId _: AccountId, + chainId _: ChainModel.Id, + assetId _: AssetModel.Id + ) { + switch result { + case let .success(balance): + presenter?.didReceiveAssetBalance(balance) + case let .failure(error): + presenter?.didReceiveError(.balanceSubscriptionFailed(error)) + } + } +} + +extension ReferendumsInteractor: PriceLocalSubscriptionHandler, PriceLocalStorageSubscriber { + func handlePrice(result: Result, priceId _: AssetModel.PriceId) { + switch result { + case let .success(price): + presenter?.didReceivePrice(price) + case let .failure(error): + presenter?.didReceiveError(.priceSubscriptionFailed(error)) + } + } +} + +extension ReferendumsInteractor: GeneralLocalStorageSubscriber, GeneralLocalStorageHandler { + func handleBlockNumber(result: Result, chainId: ChainModel.Id) { + guard let chain = governanceState.settings.value?.chain, chain.chainId == chainId else { + return + } + + switch result { + case let .success(blockNumber): + if let blockNumber = blockNumber { + presenter?.didReceiveBlockNumber(blockNumber) + } + case let .failure(error): + presenter?.didReceiveError(.blockNumberSubscriptionFailed(error)) + } + } +} + +extension ReferendumsInteractor: SelectedCurrencyDepending { + func applyCurrency() { + if presenter != nil, let chain = governanceState.settings.value?.chain { + subscribeToAssetPrice(for: chain) + } + } +} + +extension ReferendumsInteractor: ApplicationHandlerDelegate { + func didReceiveDidEnterBackground(notification _: Notification) { + clearCancellable() + governanceState.subscriptionFactory?.cancelCancellable() + } +} diff --git a/novawallet/Modules/Vote/Governance/Referendums/ReferendumsPresenter.swift b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsPresenter.swift new file mode 100644 index 0000000000..646b111193 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsPresenter.swift @@ -0,0 +1,436 @@ +import Foundation +import BigInt +import SoraFoundation +import RobinHood + +final class ReferendumsPresenter { + weak var view: ReferendumsViewProtocol? + + let interactor: ReferendumsInteractorInputProtocol + let wireframe: ReferendumsWireframeProtocol + let viewModelFactory: ReferendumsModelFactoryProtocol + let statusViewModelFactory: ReferendumStatusViewModelFactoryProtocol + let assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol + let sorting: ReferendumsSorting + let logger: LoggerProtocol + + private var freeBalance: BigUInt? + private var selectedOption: GovernanceSelectedOption? + private var price: PriceData? + private var referendums: [ReferendumLocal]? + private var referendumsMetadata: ReferendumMetadataMapping? + private var voting: CallbackStorageSubscriptionResult? + private var unlockSchedule: GovernanceUnlockSchedule? + private var blockNumber: BlockNumber? + private var blockTime: BlockTime? + + private var maxStatusTimeInterval: TimeInterval? + private var countdownTimer: CountdownTimer? + private var timeModels: [UInt: StatusTimeViewModel?]? + + private var chain: ChainModel? { + selectedOption?.chain + } + + private var governanceType: GovernanceType? { + selectedOption?.type + } + + private lazy var chainBalanceFactory = ChainBalanceViewModelFactory() + + deinit { + invalidateTimer() + } + + init( + interactor: ReferendumsInteractorInputProtocol, + wireframe: ReferendumsWireframeProtocol, + viewModelFactory: ReferendumsModelFactoryProtocol, + statusViewModelFactory: ReferendumStatusViewModelFactoryProtocol, + assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol, + sorting: ReferendumsSorting, + localizationManager: LocalizationManagerProtocol, + logger: LoggerProtocol + ) { + self.interactor = interactor + self.wireframe = wireframe + self.viewModelFactory = viewModelFactory + self.statusViewModelFactory = statusViewModelFactory + self.assetBalanceFormatterFactory = assetBalanceFormatterFactory + self.sorting = sorting + self.logger = logger + self.localizationManager = localizationManager + } + + func clearOnAssetSwitch() { + invalidateTimer() + + freeBalance = nil + price = nil + referendums = nil + referendumsMetadata = nil + voting = nil + unlockSchedule = nil + blockNumber = nil + blockTime = nil + maxStatusTimeInterval = nil + timeModels = nil + + view?.didReceiveUnlocks(viewModel: nil) + view?.update(model: .init(sections: viewModelFactory.createLoadingViewModel())) + } + + private func provideChainBalance() { + guard + let chain = chain, + let governanceType = governanceType, + let asset = chain.utilityAsset() else { + return + } + + let viewModel = chainBalanceFactory.createViewModel( + from: governanceType.title(for: chain), + chainAsset: ChainAsset(chain: chain, asset: asset), + balanceInPlank: freeBalance, + locale: selectedLocale + ) + + view?.didReceiveChainBalance(viewModel: viewModel) + } + + private func updateUnlocksView() { + guard + let totalLocked = voting?.value?.totalLocked(), + totalLocked > 0, + let displayInfo = chain?.utilityAssetDisplayInfo() + else { + view?.didReceiveUnlocks(viewModel: nil) + return + } + + let totalLockedDecimal = Decimal.fromSubstrateAmount(totalLocked, precision: displayInfo.assetPrecision) ?? 0 + + let tokenFormatter = assetBalanceFormatterFactory.createTokenFormatter(for: displayInfo) + let totalLockedString = tokenFormatter.value(for: selectedLocale).stringFromDecimal(totalLockedDecimal) + + let hasUnlock: Bool + + if let blockNumber = blockNumber, let unlockSchedule = unlockSchedule { + hasUnlock = unlockSchedule.availableUnlock(at: blockNumber).amount > 0 + } else { + hasUnlock = false + } + + let viewModel = ReferendumsUnlocksViewModel(totalLock: totalLockedString ?? "", hasUnlock: hasUnlock) + view?.didReceiveUnlocks(viewModel: viewModel) + } + + private func updateReferendumsView() { + guard let view = view else { + return + } + guard let currentBlock = blockNumber, + let blockTime = blockTime, + let referendums = referendums, + let chainModel = chain else { + return + } + + let accountVotes = voting?.value?.votes + let sections = viewModelFactory.createSections(input: .init( + referendums: referendums, + metadataMapping: referendumsMetadata, + votes: accountVotes?.votes ?? [:], + chainInfo: .init(chain: chainModel, currentBlock: currentBlock, blockDuration: blockTime), + locale: selectedLocale + )) + + view.update(model: .init(sections: sections)) + } + + private func updateTimeModels() { + guard let view = view else { + return + } + guard let currentBlock = blockNumber, let blockTime = blockTime, let referendums = referendums else { + return + } + + let timeModels = statusViewModelFactory.createTimeViewModels( + referendums: referendums, + currentBlock: currentBlock, + blockDuration: blockTime, + locale: selectedLocale + ) + + self.timeModels = timeModels + maxStatusTimeInterval = timeModels.compactMap { $0.value?.timeInterval }.max(by: <) + invalidateTimer() + setupTimer() + updateTimerDisplay() + + view.updateReferendums(time: timeModels) + } + + private func invalidateTimer() { + countdownTimer?.delegate = nil + countdownTimer?.stop() + countdownTimer = nil + } + + private func setupTimer() { + guard let maxStatusTimeInterval = maxStatusTimeInterval else { + return + } + + countdownTimer = CountdownTimer() + countdownTimer?.delegate = self + countdownTimer?.start(with: maxStatusTimeInterval) + } + + private func updateTimerDisplay() { + guard + let view = view, + let maxStatusTimeInterval = maxStatusTimeInterval, + let remainedTimeInterval = countdownTimer?.remainedInterval, + let timeModels = timeModels else { + return + } + + let elapsedTime = maxStatusTimeInterval >= remainedTimeInterval ? + maxStatusTimeInterval - remainedTimeInterval : 0 + + let updatedTimeModels = timeModels.reduce(into: timeModels) { result, model in + guard let timeModel = model.value, + let time = timeModel.timeInterval else { + return + } + + guard time > elapsedTime else { + result[model.key] = nil + return + } + let remainedTime = time - elapsedTime + guard let updatedViewModel = timeModel.updateModelClosure(remainedTime) else { + result[model.key] = nil + return + } + + result[model.key] = .init( + viewModel: updatedViewModel, + timeInterval: time, + updateModelClosure: timeModel.updateModelClosure + ) + } + + self.timeModels = updatedTimeModels + view.updateReferendums(time: updatedTimeModels) + } + + private func refreshUnlockSchedule() { + guard let tracksVoting = voting?.value else { + return + } + + interactor.refreshUnlockSchedule(for: tracksVoting, blockHash: nil) + } +} + +extension ReferendumsPresenter: ReferendumsPresenterProtocol { + func select(referendumIndex: UInt) { + guard let referendum = referendums?.first(where: { $0.index == referendumIndex }) else { + return + } + + let initData = ReferendumDetailsInitData( + referendum: referendum, + votesResult: voting, + blockNumber: blockNumber, + blockTime: blockTime, + metadata: referendumsMetadata?[referendum.index] + ) + + wireframe.showReferendumDetails(from: view, initData: initData) + } + + func selectUnlocks() { + let initData = GovernanceUnlockInitData( + votingResult: voting, + unlockSchedule: unlockSchedule, + blockNumber: blockNumber, + blockTime: blockTime + ) + + wireframe.showUnlocksDetails(from: view, initData: initData) + } +} + +extension ReferendumsPresenter: VoteChildPresenterProtocol { + func setup() { + view?.update(model: .init(sections: viewModelFactory.createLoadingViewModel())) + interactor.setup() + } + + func becomeOnline() { + interactor.becomeOnline() + } + + func putOffline() { + interactor.putOffline() + } + + func selectChain() { + wireframe.selectChain( + from: view, + delegate: self, + chainId: chain?.chainId, + governanceType: governanceType + ) + } +} + +extension ReferendumsPresenter: ReferendumsInteractorOutputProtocol { + func didReceiveVoting(_ voting: CallbackStorageSubscriptionResult) { + self.voting = voting + updateReferendumsView() + updateUnlocksView() + + if let tracksVoting = voting.value { + interactor.refreshUnlockSchedule(for: tracksVoting, blockHash: voting.blockHash) + } + } + + func didReceiveReferendumsMetadata(_ changes: [DataProviderChange]) { + let indexedReferendums = Array((referendumsMetadata ?? [:]).values).reduceToDict() + + referendumsMetadata = changes.reduce(into: referendumsMetadata ?? [:]) { accum, change in + switch change { + case let .insert(newItem), let .update(newItem): + accum[newItem.referendumId] = newItem + case let .delete(deletedIdentifier): + if let referendumId = indexedReferendums[deletedIdentifier]?.referendumId { + accum[referendumId] = nil + } + } + } + updateReferendumsView() + } + + func didReceiveBlockNumber(_ blockNumber: BlockNumber) { + self.blockNumber = blockNumber + + interactor.refresh() + } + + func didReceiveBlockTime(_ blockTime: BlockTime) { + self.blockTime = blockTime + updateTimeModels() + } + + func didReceiveReferendums(_ referendums: [ReferendumLocal]) { + self.referendums = referendums.sorted { sorting.compare(referendum1: $0, referendum2: $1) } + + updateReferendumsView() + updateTimeModels() + refreshUnlockSchedule() + } + + func didReceiveSelectedOption(_ option: GovernanceSelectedOption) { + selectedOption = option + + provideChainBalance() + updateReferendumsView() + } + + func didReceiveAssetBalance(_ balance: AssetBalance?) { + freeBalance = balance?.freeInPlank ?? 0 + + provideChainBalance() + } + + func didReceivePrice(_ price: PriceData?) { + self.price = price + } + + func didReceiveUnlockSchedule(_ unlockSchedule: GovernanceUnlockSchedule) { + self.unlockSchedule = unlockSchedule + updateUnlocksView() + } + + func didReceiveError(_ error: ReferendumsInteractorError) { + logger.error("Did receive error: \(error)") + + switch error { + case .settingsLoadFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.setup() + } + case .chainSaveFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + if let option = self?.selectedOption { + self?.interactor.saveSelected(option: option) + } + } + case .referendumsFetchFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.refresh() + } + case .blockNumberSubscriptionFailed, .priceSubscriptionFailed, .balanceSubscriptionFailed, + .metadataSubscriptionFailed, .blockTimeServiceFailed, .votingSubscriptionFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.remakeSubscriptions() + } + case .blockTimeFetchFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.interactor.retryBlockTime() + } + case .unlockScheduleFetchFailed: + wireframe.presentRequestStatus(on: view, locale: selectedLocale) { [weak self] in + self?.refreshUnlockSchedule() + } + } + } +} + +extension ReferendumsPresenter: GovernanceAssetSelectionDelegate { + func governanceAssetSelection( + view _: AssetSelectionViewProtocol, + didCompleteWith option: GovernanceSelectedOption + ) { + if selectedOption == option { + return + } + + selectedOption = option + + clearOnAssetSwitch() + provideChainBalance() + + interactor.saveSelected(option: option) + } +} + +extension ReferendumsPresenter: Localizable { + func applyLocalization() { + if let view = view, view.isSetup { + provideChainBalance() + + updateReferendumsView() + updateUnlocksView() + } + } +} + +extension ReferendumsPresenter: CountdownTimerDelegate { + func didStart(with _: TimeInterval) { + updateTimerDisplay() + } + + func didCountdown(remainedInterval _: TimeInterval) { + updateTimerDisplay() + } + + func didStop(with _: TimeInterval) { + updateTimerDisplay() + } +} diff --git a/novawallet/Modules/Vote/Governance/Referendums/ReferendumsProtocols.swift b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsProtocols.swift new file mode 100644 index 0000000000..87dbc42d72 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsProtocols.swift @@ -0,0 +1,53 @@ +import Foundation +import RobinHood + +protocol ReferendumsViewProtocol: ControllerBackedProtocol { + var presenter: ReferendumsPresenterProtocol? { get set } + + func didReceiveChainBalance(viewModel: ChainBalanceViewModel) + func update(model: ReferendumsViewModel) + func updateReferendums(time: [UInt: StatusTimeViewModel?]) + func didReceiveUnlocks(viewModel: ReferendumsUnlocksViewModel?) +} + +protocol ReferendumsPresenterProtocol: AnyObject { + func select(referendumIndex: UInt) + func selectUnlocks() +} + +protocol ReferendumsInteractorInputProtocol: AnyObject { + func setup() + func saveSelected(option: GovernanceSelectedOption) + func becomeOnline() + func putOffline() + func refresh() + func refreshUnlockSchedule(for tracksVoting: ReferendumTracksVotingDistribution, blockHash: Data?) + func remakeSubscriptions() + func retryBlockTime() +} + +protocol ReferendumsInteractorOutputProtocol: AnyObject { + func didReceiveReferendums(_ referendums: [ReferendumLocal]) + func didReceiveReferendumsMetadata(_ changes: [DataProviderChange]) + func didReceiveVoting(_ voting: CallbackStorageSubscriptionResult) + func didReceiveSelectedOption(_ option: GovernanceSelectedOption) + func didReceiveAssetBalance(_ balance: AssetBalance?) + func didReceivePrice(_ price: PriceData?) + func didReceiveBlockNumber(_ blockNumber: BlockNumber) + func didReceiveBlockTime(_ blockTime: BlockTime) + func didReceiveUnlockSchedule(_ unlockSchedule: GovernanceUnlockSchedule) + func didReceiveError(_ error: ReferendumsInteractorError) +} + +protocol ReferendumsWireframeProtocol: AlertPresentable, ErrorPresentable, CommonRetryable { + func selectChain( + from view: ControllerBackedProtocol?, + delegate: GovernanceAssetSelectionDelegate, + chainId: ChainModel.Id?, + governanceType: GovernanceType? + ) + + func showReferendumDetails(from view: ControllerBackedProtocol?, initData: ReferendumDetailsInitData) + + func showUnlocksDetails(from view: ControllerBackedProtocol?, initData: GovernanceUnlockInitData) +} diff --git a/novawallet/Modules/Vote/Governance/Referendums/ReferendumsViewManager.swift b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsViewManager.swift new file mode 100644 index 0000000000..70c0828c89 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsViewManager.swift @@ -0,0 +1,247 @@ +import Foundation +import UIKit + +final class ReferendumsViewManager: NSObject { + private enum Constants { + static let unlocksCellHeight: CGFloat = 52 + static let referendumCellMinimumHeight: CGFloat = 185 + static let headerMinimumHeight: CGFloat = 56 + } + + let tableView: UITableView + let chainSelectionView: VoteChainViewProtocol + private var referendumsViewModel: ReferendumsViewModel = .init(sections: []) + private var unlocksViewModel: ReferendumsUnlocksViewModel? + + var locale = Locale.current { + didSet { + if locale != oldValue { + tableView.reloadData() + } + } + } + + weak var presenter: ReferendumsPresenterProtocol? + private weak var parent: ControllerBackedProtocol? + + init(tableView: UITableView, chainSelectionView: VoteChainViewProtocol, parent: ControllerBackedProtocol) { + self.tableView = tableView + self.chainSelectionView = chainSelectionView + self.parent = parent + + super.init() + } +} + +extension ReferendumsViewManager: UITableViewDataSource { + func numberOfSections(in _: UITableView) -> Int { + referendumsViewModel.sections.count + 1 + } + + func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int { + if section == 0 { + return unlocksViewModel != nil ? 1 : 0 + } else { + let referendumsSection = section - 1 + switch referendumsViewModel.sections[referendumsSection] { + case let .active(_, cells), let .completed(_, cells): + return !cells.isEmpty ? cells.count : 1 + } + } + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + if indexPath.section == 0 { + let unlocksCell: ReferendumsUnlocksTableViewCell = tableView.dequeueReusableCell(for: indexPath) + unlocksCell.applyStyle() + + if let viewModel = unlocksViewModel { + unlocksCell.view.bind(viewModel: viewModel, locale: locale) + } + + return unlocksCell + } else { + let referendumsSection = indexPath.section - 1 + let section = referendumsViewModel.sections[referendumsSection] + + if section.isEmpty { + let cell: BlurredTableViewCell = tableView.dequeueReusableCell(for: indexPath) + let text = R.string.localizable.govEmptyList(preferredLanguages: locale.rLanguages) + cell.view.bind(image: R.image.iconEmptyHistory(), text: text) + cell.applyStyle() + + return cell + } else { + let cell: ReferendumTableViewCell = tableView.dequeueReusableCell(for: indexPath) + cell.applyStyle() + + switch section { + case let .active(_, cellModels), let .completed(_, cellModels): + let cellModel = cellModels[indexPath.row].viewModel + cell.view.bind(viewModel: cellModel) + return cell + } + } + } + } +} + +extension ReferendumsViewManager: UITableViewDelegate { + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + + if indexPath.section == 0 { + presenter?.selectUnlocks() + } else { + let referendumsSection = indexPath.section - 1 + let section = referendumsViewModel.sections[referendumsSection] + + guard !section.isEmpty else { + return + } + + switch section { + case let .active(_, cellModels), let .completed(_, cellModels): + let referendumIndex = cellModels[indexPath.row].referendumIndex + presenter?.select(referendumIndex: referendumIndex) + } + } + } + + func tableView(_: UITableView, viewForHeaderInSection section: Int) -> UIView? { + guard section > 0 else { + return nil + } + + let referendumsSection = section - 1 + let sectionModel = referendumsViewModel.sections[referendumsSection] + switch sectionModel { + case let .active(title, cells), let .completed(title, cells): + let headerView: VoteStatusSectionView = tableView.dequeueReusableHeaderFooterView() + switch title { + case let .loaded(value): + headerView.bind(viewModel: .loaded(value: .init(title: value, count: cells.count))) + case let .cached(value): + headerView.bind(viewModel: .cached(value: .init(title: value, count: cells.count))) + case .loading: + headerView.bind(viewModel: .loading) + } + return headerView + } + } + + func tableView(_: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + guard section > 0 else { + return 0 + } + + let referendumsSection = section - 1 + let sectionModel = referendumsViewModel.sections[referendumsSection] + switch sectionModel { + case let .active(header, _), let .completed(header, _): + switch header { + case .loaded, .cached: + return UITableView.automaticDimension + case .loading: + return Constants.headerMinimumHeight + } + } + } + + func tableView(_: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + if indexPath.section == 0 { + return Constants.unlocksCellHeight + } else { + let referendumsSection = indexPath.section - 1 + let sectionModel = referendumsViewModel.sections[referendumsSection] + + if sectionModel.isEmpty { + return UITableView.automaticDimension + } else { + switch sectionModel { + case let .active(_, cells), let .completed(_, cells): + switch cells[indexPath.row].viewModel { + case .loaded, .cached: + return UITableView.automaticDimension + case .loading: + return Constants.referendumCellMinimumHeight + } + } + } + } + } + + func tableView(_: UITableView, willDisplay cell: UITableViewCell, forRowAt _: IndexPath) { + (cell as? SkeletonableViewCell)?.updateLoadingState() + } + + func tableView(_: UITableView, willDisplayHeaderView view: UIView, forSection _: Int) { + (view as? SkeletonableView)?.updateLoadingState() + } +} + +extension ReferendumsViewManager: ReferendumsViewProtocol { + func didReceiveChainBalance(viewModel: ChainBalanceViewModel) { + chainSelectionView.bind(viewModel: viewModel) + } + + func update(model: ReferendumsViewModel) { + referendumsViewModel = model + tableView.reloadData() + } + + func updateReferendums(time: [UInt: StatusTimeViewModel?]) { + tableView.visibleCells.forEach { cell in + guard let referendumCell = cell as? ReferendumTableViewCell, + let indexPath = tableView.indexPath(for: cell) else { + return + } + + let referendumsSection = indexPath.section - 1 + switch referendumsViewModel.sections[referendumsSection] { + case let .active(_, cells), let .completed(_, cells): + let cellModel = cells[indexPath.row] + guard let timeModel = time[cellModel.referendumIndex]??.viewModel else { + return + } + + referendumCell.view.referendumInfoView.bind(timeModel: timeModel) + } + } + } + + func didReceiveUnlocks(viewModel: ReferendumsUnlocksViewModel?) { + unlocksViewModel = viewModel + tableView.reloadData() + } +} + +extension ReferendumsViewManager: VoteChildViewProtocol { + var isSetup: Bool { + parent?.isSetup ?? false + } + + var controller: UIViewController { + parent?.controller ?? UIViewController() + } + + func bind() { + tableView.dataSource = self + tableView.delegate = self + tableView.registerClassForCell(ReferendumTableViewCell.self) + tableView.registerClassForCell(ReferendumsUnlocksTableViewCell.self) + tableView.registerClassForCell(BlurredTableViewCell.self) + tableView.registerHeaderFooterView(withClass: VoteStatusSectionView.self) + tableView.reloadData() + } + + func unbind() { + tableView.dataSource = nil + tableView.delegate = nil + tableView.unregisterClassForCell(ReferendumTableViewCell.self) + tableView.unregisterClassForCell(ReferendumsUnlocksTableViewCell.self) + tableView.unregisterClassForCell(BlurredTableViewCell.self) + tableView.unregisterHeaderFooterView(withClass: VoteStatusSectionView.self) + tableView.reloadData() + } +} diff --git a/novawallet/Modules/Vote/Governance/Referendums/ReferendumsWireframe.swift b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsWireframe.swift new file mode 100644 index 0000000000..b017678ffa --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Referendums/ReferendumsWireframe.swift @@ -0,0 +1,54 @@ +import Foundation + +final class ReferendumsWireframe: ReferendumsWireframeProtocol { + let state: GovernanceSharedState + + init(state: GovernanceSharedState) { + self.state = state + } + + func selectChain( + from view: ControllerBackedProtocol?, + delegate: GovernanceAssetSelectionDelegate, + chainId: ChainModel.Id?, + governanceType: GovernanceType? + ) { + guard let selectionView = GovernanceAssetSelectionViewFactory.createView( + for: delegate, + chainId: chainId, + governanceType: governanceType + ) else { + return + } + + let navigationController = FearlessNavigationController( + rootViewController: selectionView.controller + ) + + view?.controller.present(navigationController, animated: true, completion: nil) + } + + func showReferendumDetails(from view: ControllerBackedProtocol?, initData: ReferendumDetailsInitData) { + guard + let detailsView = ReferendumDetailsViewFactory.createView( + for: state, + initData: initData + ) else { + return + } + + detailsView.controller.hidesBottomBarWhenPushed = true + + view?.controller.navigationController?.pushViewController(detailsView.controller, animated: true) + } + + func showUnlocksDetails(from view: ControllerBackedProtocol?, initData: GovernanceUnlockInitData) { + guard let unlocksView = GovernanceUnlockSetupViewFactory.createView(for: state, initData: initData) else { + return + } + + let navigationController = ImportantFlowViewFactory.createNavigation(from: unlocksView.controller) + + view?.controller.present(navigationController, animated: true) + } +} diff --git a/novawallet/Modules/Vote/Governance/Subscription/Gov1SubscriptionFactory.swift b/novawallet/Modules/Vote/Governance/Subscription/Gov1SubscriptionFactory.swift new file mode 100644 index 0000000000..d2dc531bb7 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Subscription/Gov1SubscriptionFactory.swift @@ -0,0 +1,313 @@ +import Foundation +import SubstrateSdk +import RobinHood + +final class Gov1SubscriptionFactory: AnyCancellableCleaning { + typealias ReferendumState = NotEqualWrapper + typealias VotesState = NotEqualWrapper + typealias VotesWrapper = StorageSubscriptionObserver + + typealias ReferendumWrapper = StorageSubscriptionObserver< + Democracy.ReferendumInfo, ReferendumState + > + + private(set) var referendums: [ReferendumIdLocal: ReferendumWrapper] = [:] + private(set) var votes: [AccountId: VotesWrapper] = [:] + private(set) var cancellables: [String: CancellableCall] = [:] + + let operationFactory: Gov1OperationFactory + let chainRegistry: ChainRegistryProtocol + let operationQueue: OperationQueue + let chainId: ChainModel.Id + + init( + chainId: ChainModel.Id, + operationFactory: Gov1OperationFactory, + chainRegistry: ChainRegistryProtocol, + operationQueue: OperationQueue + ) { + self.chainId = chainId + self.operationFactory = operationFactory + self.chainRegistry = chainRegistry + self.operationQueue = operationQueue + } + + private func handleReferendumResult( + _ result: Result, Error>, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + referendumIndex: ReferendumIdLocal + ) { + guard let wrapper = referendums[referendumIndex] else { + return + } + + switch result { + case let .success(result): + if let referendumInfo = result.value { + handleReferendum( + for: referendumInfo, + connection: connection, + runtimeProvider: runtimeProvider, + referendumIndex: referendumIndex, + blockHash: result.blockHash + ) + } else { + let value = CallbackStorageSubscriptionResult(value: nil, blockHash: nil) + wrapper.state = NotEqualWrapper(value: .success(value)) + } + case let .failure(error): + wrapper.state = NotEqualWrapper(value: .failure(error)) + } + } + + private func handleReferendum( + for referendumInfo: Democracy.ReferendumInfo, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + referendumIndex: ReferendumIdLocal, + blockHash: Data? + ) { + let cancellableKey = "referendum-\(referendumIndex)" + clear(cancellable: &cancellables[cancellableKey]) + + let wrapper = operationFactory.fetchReferendumWrapper( + for: referendumInfo, + index: referendumIndex, + connection: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.cancellables[cancellableKey] else { + return + } + + self?.cancellables[cancellableKey] = nil + + do { + let referendum = try wrapper.targetOperation.extractNoCancellableResultData() + let value = CallbackStorageSubscriptionResult( + value: referendum, + blockHash: blockHash + ) + + self?.referendums[referendumIndex]?.state = NotEqualWrapper(value: .success(value)) + } catch { + self?.referendums[referendumIndex]?.state = NotEqualWrapper(value: .failure(error)) + } + } + } + + cancellables[cancellableKey] = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + private func handleVotesResult( + _ result: Result, Error>, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + accountId: AccountId + ) { + guard let wrapper = votes[accountId] else { + return + } + + switch result { + case let .success(result): + handleVotes( + for: result.value, + connection: connection, + runtimeProvider: runtimeProvider, + accountId: accountId, + blockHash: result.blockHash + ) + case let .failure(error): + wrapper.state = NotEqualWrapper(value: .failure(error)) + } + } + + private func handleVotes( + for votes: Democracy.Voting?, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + accountId: AccountId, + blockHash: Data? + ) { + let cancellableKey = "votes-\(accountId.toHex())" + clear(cancellable: &cancellables[cancellableKey]) + + let wrapper = operationFactory.fetchTracksVotingWrapper( + for: votes, + accountId: accountId, + connection: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.cancellables[cancellableKey] else { + return + } + + self?.cancellables[cancellableKey] = nil + + do { + let tracksVoting = try wrapper.targetOperation.extractNoCancellableResultData() + let value = CallbackStorageSubscriptionResult( + value: tracksVoting, + blockHash: blockHash + ) + + self?.votes[accountId]?.state = NotEqualWrapper(value: .success(value)) + } catch { + self?.votes[accountId]?.state = NotEqualWrapper(value: .failure(error)) + } + } + } + + cancellables[cancellableKey] = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } +} + +extension Gov1SubscriptionFactory: GovernanceSubscriptionFactoryProtocol { + func cancelCancellable() { + let keys = cancellables.keys + + for key in keys { + clear(cancellable: &cancellables[key]) + } + } + + func subscribeToReferendum( + _ target: AnyObject, + referendumIndex: UInt, + notificationClosure: @escaping (ReferendumSubscriptionResult?) -> Void + ) { + let subscriptionWrapper: ReferendumWrapper + + if let wrapper = referendums[referendumIndex] { + subscriptionWrapper = wrapper + } else { + let request = MapSubscriptionRequest(storagePath: Democracy.referendumInfo, localKey: "") { + StringScaleMapper(value: referendumIndex) + } + + guard let connection = chainRegistry.getConnection(for: chainId) else { + notificationClosure(.failure(ChainRegistryError.connectionUnavailable)) + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + notificationClosure(.failure(ChainRegistryError.runtimeMetadaUnavailable)) + return + } + + let subscription = CallbackStorageSubscription( + request: request, + connection: connection, + runtimeService: runtimeProvider, + repository: nil, + operationQueue: operationQueue, + callbackWithBlockQueue: .main + ) { [weak self] result in + self?.handleReferendumResult( + result, + connection: connection, + runtimeProvider: runtimeProvider, + referendumIndex: referendumIndex + ) + } + + subscriptionWrapper = ReferendumWrapper(subscription: subscription) + referendums[referendumIndex] = subscriptionWrapper + } + + notificationClosure(subscriptionWrapper.state?.value) + + subscriptionWrapper.addObserver(with: target) { _, newValueWrapper in + notificationClosure(newValueWrapper?.value) + } + } + + func unsubscribeFromReferendum(_: AnyObject, referendumIndex: ReferendumIdLocal) { + guard let subscriptionWrapper = referendums[referendumIndex] else { + return + } + + subscriptionWrapper.removeObserver(by: self) + + if subscriptionWrapper.observers.isEmpty { + referendums[referendumIndex] = nil + } + } + + func subscribeToAccountVotes( + _ target: AnyObject, + accountId: AccountId, + notificationClosure: @escaping (ReferendumVotesSubscriptionResult?) -> Void + ) { + let subscriptionWrapper: VotesWrapper + + if let wrapper = votes[accountId] { + subscriptionWrapper = wrapper + } else { + let request = MapSubscriptionRequest(storagePath: Democracy.votingOf, localKey: "") { + BytesCodable(wrappedValue: accountId) + } + + guard let connection = chainRegistry.getConnection(for: chainId) else { + notificationClosure(.failure(ChainRegistryError.connectionUnavailable)) + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + notificationClosure(.failure(ChainRegistryError.runtimeMetadaUnavailable)) + return + } + + let subscription = CallbackStorageSubscription( + request: request, + connection: connection, + runtimeService: runtimeProvider, + repository: nil, + operationQueue: operationQueue, + callbackWithBlockQueue: .main + ) { [weak self] result in + self?.handleVotesResult( + result, + connection: connection, + runtimeProvider: runtimeProvider, + accountId: accountId + ) + } + + subscriptionWrapper = VotesWrapper(subscription: subscription) + votes[accountId] = subscriptionWrapper + } + + notificationClosure(subscriptionWrapper.state?.value) + + subscriptionWrapper.addObserver(with: target) { _, newValueWrapper in + notificationClosure(newValueWrapper?.value) + } + } + + func unsubscribeFromAccountVotes(_: AnyObject, accountId: AccountId) { + guard let subscriptionWrapper = votes[accountId] else { + return + } + + subscriptionWrapper.removeObserver(by: self) + + if subscriptionWrapper.observers.isEmpty { + votes[accountId] = nil + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Subscription/Gov2SubscriptionFactory.swift b/novawallet/Modules/Vote/Governance/Subscription/Gov2SubscriptionFactory.swift new file mode 100644 index 0000000000..d7d7a9b42a --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Subscription/Gov2SubscriptionFactory.swift @@ -0,0 +1,309 @@ +import Foundation +import SubstrateSdk +import RobinHood + +final class Gov2SubscriptionFactory: AnyCancellableCleaning { + typealias ReferendumState = NotEqualWrapper + typealias VotesState = NotEqualWrapper + typealias ReferendumWrapper = StorageSubscriptionObserver + typealias VotesWrapper = StorageSubscriptionObserver<[ConvictionVoting.ClassLock], VotesState> + + private(set) var referendums: [ReferendumIdLocal: ReferendumWrapper] = [:] + private(set) var votes: [AccountId: VotesWrapper] = [:] + private(set) var cancellables: [String: CancellableCall] = [:] + + let operationFactory: Gov2OperationFactory + let chainRegistry: ChainRegistryProtocol + let operationQueue: OperationQueue + let chainId: ChainModel.Id + + init( + chainId: ChainModel.Id, + operationFactory: Gov2OperationFactory, + chainRegistry: ChainRegistryProtocol, + operationQueue: OperationQueue + ) { + self.chainId = chainId + self.operationFactory = operationFactory + self.chainRegistry = chainRegistry + self.operationQueue = operationQueue + } + + private func handleReferendumResult( + _ result: Result, Error>, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + referendumIndex: ReferendumIdLocal + ) { + guard let wrapper = referendums[referendumIndex] else { + return + } + + switch result { + case let .success(result): + if let referendumInfo = result.value { + handleReferendum( + for: referendumInfo, + connection: connection, + runtimeProvider: runtimeProvider, + referendumIndex: referendumIndex, + blockHash: result.blockHash + ) + } else { + let value = CallbackStorageSubscriptionResult(value: nil, blockHash: nil) + wrapper.state = NotEqualWrapper(value: .success(value)) + } + case let .failure(error): + wrapper.state = NotEqualWrapper(value: .failure(error)) + } + } + + private func handleReferendum( + for referendumInfo: ReferendumInfo, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + referendumIndex: ReferendumIdLocal, + blockHash: Data? + ) { + let cancellableKey = "referendum-\(referendumIndex)" + clear(cancellable: &cancellables[cancellableKey]) + + let wrapper = operationFactory.fetchReferendumWrapper( + for: referendumInfo, + index: referendumIndex, + connection: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.cancellables[cancellableKey] else { + return + } + + self?.cancellables[cancellableKey] = nil + + do { + let referendum = try wrapper.targetOperation.extractNoCancellableResultData() + let value = CallbackStorageSubscriptionResult( + value: referendum, + blockHash: blockHash + ) + + self?.referendums[referendumIndex]?.state = NotEqualWrapper(value: .success(value)) + } catch { + self?.referendums[referendumIndex]?.state = NotEqualWrapper(value: .failure(error)) + } + } + } + + cancellables[cancellableKey] = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } + + private func handleVotesResult( + _ result: Result, Error>, + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + accountId: AccountId + ) { + guard let wrapper = votes[accountId] else { + return + } + + switch result { + case let .success(result): + handleVotes( + for: accountId, + trackLocks: result.value ?? [], + connection: connection, + runtimeProvider: runtimeProvider, + blockHash: result.blockHash + ) + case let .failure(error): + wrapper.state = NotEqualWrapper(value: .failure(error)) + } + } + + private func handleVotes( + for accountId: AccountId, + trackLocks: [ConvictionVoting.ClassLock], + connection: JSONRPCEngine, + runtimeProvider: RuntimeProviderProtocol, + blockHash: Data? + ) { + let cancellableKey = "votes-\(accountId.toHex())" + clear(cancellable: &cancellables[cancellableKey]) + + let wrapper = operationFactory.fetchAccountVotesWrapper( + for: accountId, + from: connection, + runtimeProvider: runtimeProvider, + blockHash: blockHash + ) + + wrapper.targetOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard wrapper === self?.cancellables[cancellableKey] else { + return + } + + self?.cancellables[cancellableKey] = nil + + do { + let accountVoting = try wrapper.targetOperation.extractNoCancellableResultData() + let value = CallbackStorageSubscriptionResult( + value: .init(votes: accountVoting, trackLocks: trackLocks), + blockHash: blockHash + ) + + self?.votes[accountId]?.state = NotEqualWrapper(value: .success(value)) + } catch { + self?.votes[accountId]?.state = NotEqualWrapper(value: .failure(error)) + } + } + } + + cancellables[cancellableKey] = wrapper + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: false) + } +} + +extension Gov2SubscriptionFactory: GovernanceSubscriptionFactoryProtocol { + func cancelCancellable() { + let keys = cancellables.keys + + for key in keys { + clear(cancellable: &cancellables[key]) + } + } + + func subscribeToReferendum( + _ target: AnyObject, + referendumIndex: ReferendumIdLocal, + notificationClosure: @escaping (ReferendumSubscriptionResult?) -> Void + ) { + let subscriptionWrapper: ReferendumWrapper + + if let wrapper = referendums[referendumIndex] { + subscriptionWrapper = wrapper + } else { + let request = MapSubscriptionRequest(storagePath: Referenda.referendumInfo, localKey: "") { + StringScaleMapper(value: referendumIndex) + } + + guard let connection = chainRegistry.getConnection(for: chainId) else { + notificationClosure(.failure(ChainRegistryError.connectionUnavailable)) + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + notificationClosure(.failure(ChainRegistryError.runtimeMetadaUnavailable)) + return + } + + let subscription = CallbackStorageSubscription( + request: request, + connection: connection, + runtimeService: runtimeProvider, + repository: nil, + operationQueue: operationQueue, + callbackWithBlockQueue: .main + ) { [weak self] result in + self?.handleReferendumResult( + result, + connection: connection, + runtimeProvider: runtimeProvider, + referendumIndex: referendumIndex + ) + } + + subscriptionWrapper = ReferendumWrapper(subscription: subscription) + referendums[referendumIndex] = subscriptionWrapper + } + + notificationClosure(subscriptionWrapper.state?.value) + + subscriptionWrapper.addObserver(with: target) { _, newValueWrapper in + notificationClosure(newValueWrapper?.value) + } + } + + func unsubscribeFromReferendum(_: AnyObject, referendumIndex: ReferendumIdLocal) { + guard let subscriptionWrapper = referendums[referendumIndex] else { + return + } + + subscriptionWrapper.removeObserver(by: self) + + if subscriptionWrapper.observers.isEmpty { + referendums[referendumIndex] = nil + } + } + + func subscribeToAccountVotes( + _ target: AnyObject, + accountId: AccountId, + notificationClosure: @escaping (ReferendumVotesSubscriptionResult?) -> Void + ) { + let subscriptionWrapper: VotesWrapper + + if let wrapper = votes[accountId] { + subscriptionWrapper = wrapper + } else { + let request = MapSubscriptionRequest(storagePath: ConvictionVoting.trackLocksFor, localKey: "") { + BytesCodable(wrappedValue: accountId) + } + + guard let connection = chainRegistry.getConnection(for: chainId) else { + notificationClosure(.failure(ChainRegistryError.connectionUnavailable)) + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + notificationClosure(.failure(ChainRegistryError.runtimeMetadaUnavailable)) + return + } + + let subscription = CallbackStorageSubscription<[ConvictionVoting.ClassLock]>( + request: request, + connection: connection, + runtimeService: runtimeProvider, + repository: nil, + operationQueue: operationQueue, + callbackWithBlockQueue: .main + ) { [weak self] result in + self?.handleVotesResult( + result, + connection: connection, + runtimeProvider: runtimeProvider, + accountId: accountId + ) + } + + subscriptionWrapper = VotesWrapper(subscription: subscription) + votes[accountId] = subscriptionWrapper + } + + notificationClosure(subscriptionWrapper.state?.value) + + subscriptionWrapper.addObserver(with: target) { _, newValueWrapper in + notificationClosure(newValueWrapper?.value) + } + } + + func unsubscribeFromAccountVotes(_: AnyObject, accountId: AccountId) { + guard let subscriptionWrapper = votes[accountId] else { + return + } + + subscriptionWrapper.removeObserver(by: self) + + if subscriptionWrapper.observers.isEmpty { + votes[accountId] = nil + } + } +} diff --git a/novawallet/Modules/Vote/Governance/Subscription/GovernanceSubscriptionProtocol.swift b/novawallet/Modules/Vote/Governance/Subscription/GovernanceSubscriptionProtocol.swift new file mode 100644 index 0000000000..5ab536b995 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Subscription/GovernanceSubscriptionProtocol.swift @@ -0,0 +1,28 @@ +import Foundation + +typealias ReferendumSubscriptionResult = Result, Error> + +typealias ReferendumVotesSubscriptionResult = Result< + CallbackStorageSubscriptionResult, + Error +> + +protocol GovernanceSubscriptionFactoryProtocol { + func subscribeToReferendum( + _ target: AnyObject, + referendumIndex: UInt, + notificationClosure: @escaping (ReferendumSubscriptionResult?) -> Void + ) + + func unsubscribeFromReferendum(_ target: AnyObject, referendumIndex: ReferendumIdLocal) + + func subscribeToAccountVotes( + _ target: AnyObject, + accountId: AccountId, + notificationClosure: @escaping (ReferendumVotesSubscriptionResult?) -> Void + ) + + func unsubscribeFromAccountVotes(_ target: AnyObject, accountId: AccountId) + + func cancelCancellable() +} diff --git a/novawallet/Modules/Vote/Governance/Validating/DataValidationRunner+GovVote.swift b/novawallet/Modules/Vote/Governance/Validating/DataValidationRunner+GovVote.swift new file mode 100644 index 0000000000..e1f1d9113a --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Validating/DataValidationRunner+GovVote.swift @@ -0,0 +1,46 @@ +import Foundation + +extension DataValidationRunner { + static func validateVote( + factory: GovernanceValidatorFactoryProtocol, + params: GovernanceVoteValidatingParams, + selectedLocale: Locale, + feeErrorClosure: @escaping () -> Void, + successClosure: @escaping DataValidationRunnerCompletion + ) { + let runner = DataValidationRunner(validators: [ + factory.enoughTokensForVoting( + params.assetBalance, + votingAmount: params.newVote?.voteAction.amount, + assetInfo: params.assetInfo, + locale: selectedLocale + ), + factory.hasInPlank( + fee: params.fee, + locale: selectedLocale, + precision: params.assetInfo.assetPrecision, + onError: feeErrorClosure + ), + factory.enoughTokensForVotingAndFee( + params.assetBalance, + votingAmount: params.newVote?.voteAction.amount, + fee: params.fee, + assetInfo: params.assetInfo, + locale: selectedLocale + ), + factory.referendumNotEnded(params.referendum, locale: selectedLocale), + factory.notDelegating( + params.votes, + track: params.referendum?.trackId, + locale: selectedLocale + ), + factory.maxVotesNotReached( + params.votes, + track: params.referendum?.trackId, + locale: selectedLocale + ) + ]) + + runner.runValidation(notifyingOnSuccess: successClosure) + } +} diff --git a/novawallet/Modules/Vote/Governance/Validating/GovernanceErrorPresentable.swift b/novawallet/Modules/Vote/Governance/Validating/GovernanceErrorPresentable.swift new file mode 100644 index 0000000000..9e4ac2727f --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Validating/GovernanceErrorPresentable.swift @@ -0,0 +1,77 @@ +import Foundation + +protocol GovernanceErrorPresentable: BaseErrorPresentable { + func presentNotEnoughTokensToVote( + from view: ControllerBackedProtocol, + available: String, + locale: Locale? + ) + + func presentReferendumCompleted( + from view: ControllerBackedProtocol, + locale: Locale? + ) + + func presentAlreadyDelegatingVotes( + from view: ControllerBackedProtocol, + locale: Locale? + ) + + func presentVotesMaximumNumberReached( + from view: ControllerBackedProtocol, + allowed: String, + locale: Locale? + ) +} + +extension GovernanceErrorPresentable where Self: AlertPresentable & ErrorPresentable { + func presentNotEnoughTokensToVote( + from view: ControllerBackedProtocol, + available: String, + locale: Locale? + ) { + let title = R.string.localizable.commonAmountTooBig(preferredLanguages: locale?.rLanguages) + let message = R.string.localizable.govNotEnoughVoteTokens(available, preferredLanguages: locale?.rLanguages) + + let close = R.string.localizable.commonClose(preferredLanguages: locale?.rLanguages) + + present(message: message, title: title, closeAction: close, from: view) + } + + func presentReferendumCompleted( + from view: ControllerBackedProtocol, + locale: Locale? + ) { + let title = R.string.localizable.govReferendumCompletedTitle(preferredLanguages: locale?.rLanguages) + let message = R.string.localizable.govReferendumCompletedMessage(preferredLanguages: locale?.rLanguages) + + let close = R.string.localizable.commonClose(preferredLanguages: locale?.rLanguages) + + present(message: message, title: title, closeAction: close, from: view) + } + + func presentAlreadyDelegatingVotes( + from view: ControllerBackedProtocol, + locale: Locale? + ) { + let title = R.string.localizable.govAlreadyDelegatingVotesTitle(preferredLanguages: locale?.rLanguages) + let message = R.string.localizable.govAlreadyDelegatingVotesMessage(preferredLanguages: locale?.rLanguages) + + let close = R.string.localizable.commonClose(preferredLanguages: locale?.rLanguages) + + present(message: message, title: title, closeAction: close, from: view) + } + + func presentVotesMaximumNumberReached( + from view: ControllerBackedProtocol, + allowed: String, + locale: Locale? + ) { + let title = R.string.localizable.govMaxVotesReachedTitle(preferredLanguages: locale?.rLanguages) + let message = R.string.localizable.govMaxVotesReachedMessage(allowed, preferredLanguages: locale?.rLanguages) + + let close = R.string.localizable.commonClose(preferredLanguages: locale?.rLanguages) + + present(message: message, title: title, closeAction: close, from: view) + } +} diff --git a/novawallet/Modules/Vote/Governance/Validating/GovernanceValidatorFactory.swift b/novawallet/Modules/Vote/Governance/Validating/GovernanceValidatorFactory.swift new file mode 100644 index 0000000000..8842ba9ab0 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Validating/GovernanceValidatorFactory.swift @@ -0,0 +1,223 @@ +import Foundation +import BigInt +import SoraFoundation + +protocol GovernanceValidatorFactoryProtocol: BaseDataValidatingFactoryProtocol { + func enoughTokensForVoting( + _ assetBalance: AssetBalance?, + votingAmount: BigUInt?, + assetInfo: AssetBalanceDisplayInfo, + locale: Locale? + ) -> DataValidating + + func enoughTokensForVotingAndFee( + _ assetBalance: AssetBalance?, + votingAmount: BigUInt?, + fee: BigUInt?, + assetInfo: AssetBalanceDisplayInfo, + locale: Locale? + ) -> DataValidating + + func referendumNotEnded( + _ referendum: ReferendumLocal?, + locale: Locale? + ) -> DataValidating + + func notDelegating( + _ accountVotingDistribution: ReferendumAccountVotingDistribution?, + track: TrackIdLocal?, + locale: Locale? + ) -> DataValidating + + func maxVotesNotReached( + _ accountVotingDistribution: ReferendumAccountVotingDistribution?, + track: TrackIdLocal?, + locale: Locale? + ) -> DataValidating +} + +final class GovernanceValidatorFactory { + weak var view: (Localizable & ControllerBackedProtocol)? + + var basePresentable: BaseErrorPresentable { presentable } + let assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol + let quantityFormatter: LocalizableResource + let presentable: GovernanceErrorPresentable + + init( + presentable: GovernanceErrorPresentable, + assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol, + quantityFormatter: LocalizableResource + ) { + self.presentable = presentable + self.assetBalanceFormatterFactory = assetBalanceFormatterFactory + self.quantityFormatter = quantityFormatter + } +} + +extension GovernanceValidatorFactory: GovernanceValidatorFactoryProtocol { + func enoughTokensForVoting( + _ assetBalance: AssetBalance?, + votingAmount: BigUInt?, + assetInfo: AssetBalanceDisplayInfo, + locale: Locale? + ) -> DataValidating { + ErrorConditionViolation(onError: { [weak self] in + guard let view = self?.view else { + return + } + + let amountFormatter = self?.assetBalanceFormatterFactory.createTokenFormatter(for: assetInfo) + let amountString: String + + if + let freeInPlank = assetBalance?.freeInPlank, + let amountDecimal = Decimal.fromSubstrateAmount(freeInPlank, precision: assetInfo.assetPrecision) { + amountString = amountFormatter?.value(for: locale ?? Locale.current).stringFromDecimal( + amountDecimal + ) ?? "" + } else { + amountString = "" + } + + self?.presentable.presentNotEnoughTokensToVote( + from: view, + available: amountString, + locale: locale + ) + }, preservesCondition: { + guard + let assetBalance = assetBalance, + let votingAmount = votingAmount else { + return false + } + + return assetBalance.freeInPlank >= votingAmount + }) + } + + func enoughTokensForVotingAndFee( + _ assetBalance: AssetBalance?, + votingAmount: BigUInt?, + fee: BigUInt?, + assetInfo: AssetBalanceDisplayInfo, + locale: Locale? + ) -> DataValidating { + let availableForFee: BigUInt + + if + let assetBalance = assetBalance, + let votingAmount = votingAmount, + assetBalance.freeInPlank >= votingAmount { + availableForFee = min(assetBalance.freeInPlank - votingAmount, assetBalance.transferable) + } else { + availableForFee = 0 + } + + return ErrorConditionViolation(onError: { [weak self] in + guard let view = self?.view else { + return + } + + let amountFormatter = self?.assetBalanceFormatterFactory.createTokenFormatter( + for: assetInfo + ).value(for: locale ?? Locale.current) + + let amountString: String + + if + let amountDecimal = Decimal.fromSubstrateAmount( + availableForFee, + precision: assetInfo.assetPrecision + ) { + amountString = amountFormatter?.stringFromDecimal(amountDecimal) ?? "" + } else { + amountString = "" + } + + let feeString: String + + if + let feeDecimal = Decimal.fromSubstrateAmount( + fee ?? 0, + precision: assetInfo.assetPrecision + ) { + feeString = amountFormatter?.stringFromDecimal(feeDecimal) ?? "" + } else { + feeString = "" + } + + self?.presentable.presentFeeTooHigh(from: view, balance: amountString, fee: feeString, locale: locale) + }, preservesCondition: { + guard let fee = fee else { + return true + } + + return availableForFee >= fee + }) + } + + func referendumNotEnded(_ referendum: ReferendumLocal?, locale: Locale?) -> DataValidating { + ErrorConditionViolation(onError: { [weak self] in + guard let view = self?.view else { + return + } + + self?.presentable.presentReferendumCompleted(from: view, locale: locale) + }, preservesCondition: { + guard let referendum = referendum else { + return false + } + + return referendum.canVote + }) + } + + func notDelegating( + _ accountVotingDistribution: ReferendumAccountVotingDistribution?, + track: TrackIdLocal?, + locale: Locale? + ) -> DataValidating { + ErrorConditionViolation(onError: { [weak self] in + guard let view = self?.view else { + return + } + + self?.presentable.presentAlreadyDelegatingVotes(from: view, locale: locale) + }, preservesCondition: { + guard let track = track else { + return true + } + + return accountVotingDistribution?.delegatings[track] == nil + }) + } + + func maxVotesNotReached( + _ accountVotingDistribution: ReferendumAccountVotingDistribution?, + track: TrackIdLocal?, + locale: Locale? + ) -> DataValidating { + ErrorConditionViolation(onError: { [weak self] in + guard let view = self?.view, let accountVotingDistribution = accountVotingDistribution else { + return + } + + let allowed = self?.quantityFormatter.value( + for: locale ?? Locale.current + ).string(from: accountVotingDistribution.maxVotesPerTrack as NSNumber) + + self?.presentable.presentVotesMaximumNumberReached(from: view, allowed: allowed ?? "", locale: locale) + }, preservesCondition: { + guard + let track = track, + let accountVotingDistribution = accountVotingDistribution else { + return true + } + + let numberOfVotes = accountVotingDistribution.votedTracks[track]?.count ?? 0 + + return numberOfVotes < Int(accountVotingDistribution.maxVotesPerTrack) + }) + } +} diff --git a/novawallet/Modules/Vote/Governance/Validating/GovernanceVoteValidatingParams.swift b/novawallet/Modules/Vote/Governance/Validating/GovernanceVoteValidatingParams.swift new file mode 100644 index 0000000000..2ba35a2110 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/Validating/GovernanceVoteValidatingParams.swift @@ -0,0 +1,11 @@ +import Foundation +import BigInt + +struct GovernanceVoteValidatingParams { + let assetBalance: AssetBalance? + let referendum: ReferendumLocal? + let newVote: ReferendumNewVote? + let fee: BigUInt? + let votes: ReferendumAccountVotingDistribution? + let assetInfo: AssetBalanceDisplayInfo +} diff --git a/novawallet/Modules/Vote/Governance/View/MarkdownParsingOperationFactory.swift b/novawallet/Modules/Vote/Governance/View/MarkdownParsingOperationFactory.swift new file mode 100644 index 0000000000..80c4b2d476 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/MarkdownParsingOperationFactory.swift @@ -0,0 +1,101 @@ +import Foundation +import RobinHood +import CDMarkdownKit +import UIKit + +protocol MarkdownParsingOperationFactoryProtocol { + func createParseOperation(for string: String, preferredWidth: CGFloat) -> BaseOperation +} + +final class MarkdownParsingOperationFactory: MarkdownParsingOperationFactoryProtocol { + let maxSize: Int? + + init(maxSize: Int?) { + self.maxSize = maxSize + } + + private func createMarkdownParser(for preferredWidth: CGFloat, imageDetectionEnabled: Bool) -> CDMarkdownParser { + let textParagraphStyle = NSMutableParagraphStyle() + textParagraphStyle.paragraphSpacing = 8 + textParagraphStyle.paragraphSpacingBefore = 8 + + let parser = CDMarkdownParser( + font: CDFont.systemFont(ofSize: 15), + fontColor: R.color.colorTransparentText()!, + paragraphStyle: textParagraphStyle, + imageDetectionEnabled: imageDetectionEnabled + ) + + parser.bold.color = R.color.colorTransparentText()! + parser.bold.backgroundColor = nil + parser.header.color = R.color.colorWhite()! + parser.header.backgroundColor = nil + parser.list.color = R.color.colorTransparentText()! + parser.list.backgroundColor = nil + parser.quote.color = R.color.colorTransparentText() + parser.quote.backgroundColor = nil + parser.link.color = R.color.colorNovaBlue()! + parser.link.backgroundColor = nil + parser.automaticLink.color = R.color.colorNovaBlue()! + parser.automaticLink.backgroundColor = nil + parser.italic.color = R.color.colorTransparentText()! + parser.italic.backgroundColor = nil + let codeParagraphStyle = NSMutableParagraphStyle() + parser.code.font = UIFont.systemFont(ofSize: 15) + parser.code.color = R.color.colorWhite()! + parser.code.backgroundColor = UIColor(white: 20.0 / 256.0, alpha: 1.0) + parser.code.paragraphStyle = codeParagraphStyle + parser.syntax.font = UIFont.systemFont(ofSize: 15) + parser.syntax.color = R.color.colorWhite()! + parser.syntax.backgroundColor = UIColor(white: 20.0 / 256.0, alpha: 1.0) + + // library uses only width internally and adjusts the height of the image + parser.image.size = CGSize(width: preferredWidth, height: 0) + + return parser + } + + private func createOperation( + for string: String, + preferredWidth: CGFloat, + maxSize: Int? + ) -> BaseOperation { + ClosureOperation { + let preprocessed: String + let isFull: Bool + + let parser: CDMarkdownParser + + if let maxSize = maxSize { + isFull = string.count <= maxSize + preprocessed = string.convertToReadMore(after: maxSize) + parser = self.createMarkdownParser(for: preferredWidth, imageDetectionEnabled: false) + } else { + isFull = true + preprocessed = string + parser = self.createMarkdownParser(for: preferredWidth, imageDetectionEnabled: true) + } + + let attributedString = parser.parse(preprocessed) + + let preferredHeight = attributedString.boundingRect( + with: CGSize(width: preferredWidth, height: 0), + options: .usesLineFragmentOrigin, + context: nil + ).height + + let preferredSize = CGSize(width: preferredWidth, height: preferredHeight) + + return .init( + originalString: string, + attributedString: attributedString, + preferredSize: preferredSize, + isFull: isFull + ) + } + } + + func createParseOperation(for string: String, preferredWidth: CGFloat) -> BaseOperation { + createOperation(for: string, preferredWidth: preferredWidth, maxSize: maxSize) + } +} diff --git a/novawallet/Modules/Vote/Governance/View/MarkdownViewContainer.swift b/novawallet/Modules/Vote/Governance/View/MarkdownViewContainer.swift new file mode 100644 index 0000000000..69805b7a95 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/MarkdownViewContainer.swift @@ -0,0 +1,143 @@ +import UIKit +import CDMarkdownKit +import RobinHood + +protocol MarkdownViewContainerDelegate: AnyObject { + func markdownView(_ view: MarkdownViewContainer, asksHandle url: URL) +} + +final class MarkdownViewContainer: UIView, AnyCancellableCleaning { + private var textView: UITextView? + private var model: MarkdownText? + let preferredWidth: CGFloat + + override var intrinsicContentSize: CGSize { + CGSize(width: preferredWidth, height: model?.preferredSize.height ?? 0) + } + + let operationQueue: OperationQueue + + private let operationFactory: MarkdownParsingOperationFactoryProtocol + + private var operation: CancellableCall? + + weak var delegate: MarkdownViewContainerDelegate? + + init( + preferredWidth: CGFloat, + maxTextLength: Int? = nil, + operationQueue: OperationQueue = OperationQueue() + ) { + self.preferredWidth = preferredWidth + operationFactory = MarkdownParsingOperationFactory(maxSize: maxTextLength) + self.operationQueue = operationQueue + + super.init(frame: .zero) + } + + deinit { + clear(cancellable: &operation) + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func clearTextView() { + textView?.removeFromSuperview() + textView = nil + } + + func setupTextView(for size: CGSize, text: NSAttributedString) { + clearTextView() + + let textContainer = NSTextContainer(size: size) + let layoutManager = CDMarkdownLayoutManager() + layoutManager.roundAllCorners = true + layoutManager.addTextContainer(textContainer) + let textStorage = NSTextStorage() + textStorage.addLayoutManager(layoutManager) + + let textView = UITextView( + frame: .init(origin: .zero, size: size), + textContainer: textContainer + ) + + textView.delegate = self + textView.isEditable = false + textView.isScrollEnabled = false + textView.isSelectable = true + textView.textContainerInset = .zero + textView.textContainer.lineFragmentPadding = 0 + + textView.backgroundColor = .clear + + addSubview(textView) + + textView.snp.makeConstraints { make in + make.leading.trailing.top.bottom.equalToSuperview() + } + + textView.attributedText = text + + self.textView = textView + } + + private func bind(model: MarkdownText) { + self.model = model + + setupTextView(for: model.preferredSize, text: model.attributedString) + + invalidateIntrinsicContentSize() + } +} + +extension MarkdownViewContainer { + func load(from string: String, completion: ((MarkdownText?) -> Void)?) { + guard model?.originalString != string else { + completion?(model) + return + } + + model = nil + + clear(cancellable: &operation) + clearTextView() + + let parsingOperation = operationFactory.createParseOperation(for: string, preferredWidth: preferredWidth) + + parsingOperation.completionBlock = { [weak self] in + DispatchQueue.main.async { + guard self?.operation === parsingOperation else { + completion?(nil) + return + } + + do { + let model = try parsingOperation.extractNoCancellableResultData() + self?.bind(model: model) + completion?(model) + } catch { + completion?(nil) + } + } + } + + operation = parsingOperation + + operationQueue.addOperation(parsingOperation) + } +} + +extension MarkdownViewContainer: UITextViewDelegate { + func textView( + _: UITextView, + shouldInteractWith URL: URL, + in _: NSRange, + interaction _: UITextItemInteraction + ) -> Bool { + delegate?.markdownView(self, asksHandle: URL) + return false + } +} diff --git a/novawallet/Modules/Vote/Governance/View/MultiValueView+Model.swift b/novawallet/Modules/Vote/Governance/View/MultiValueView+Model.swift new file mode 100644 index 0000000000..3e85a9c9a1 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/MultiValueView+Model.swift @@ -0,0 +1,15 @@ +import UIKit + +extension MultiValueView: BindableView { + struct Model { + let topValue: String + let bottomValue: String? + } + + func bind(viewModel: Model) { + bind( + topValue: viewModel.topValue, + bottomValue: viewModel.bottomValue + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/View/ReferendumInfoView.swift b/novawallet/Modules/Vote/Governance/View/ReferendumInfoView.swift new file mode 100644 index 0000000000..6bd8443426 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/ReferendumInfoView.swift @@ -0,0 +1,217 @@ +import UIKit +import SoraUI + +final class ReferendumInfoView: UIView { + let statusLabel: UILabel = .init(style: .neutralStatusLabel) + + let timeView: IconDetailsView = .create { + $0.mode = .detailsIcon + $0.detailsLabel.numberOfLines = 1 + $0.spacing = 5 + $0.apply(style: .timeView) + } + + let titleLabel: UILabel = .init(style: .title) + + let trackNameView: BorderedIconLabelView = .create { + $0.iconDetailsView.spacing = 6 + $0.contentInsets = .init(top: 4, left: 6, bottom: 4, right: 8) + $0.iconDetailsView.detailsLabel.apply(style: .track) + $0.backgroundView.apply(style: .referendum) + $0.iconDetailsView.detailsLabel.numberOfLines = 1 + $0.backgroundView.cornerRadius = 7 + } + + let numberLabel: BorderedLabelView = .create { + $0.titleLabel.apply(style: .track) + $0.contentInsets = .init(top: 4, left: 6, bottom: 4, right: 8) + $0.backgroundView.apply(style: .referendum) + $0.titleLabel.numberOfLines = 1 + $0.backgroundView.cornerRadius = 7 + } + + private var trackImageViewModel: ImageViewModelProtocol? + + lazy var trackInformation: UIStackView = UIView.hStack( + spacing: Constants.trackInformationHorizontalSpace, + [ + trackNameView, + numberLabel, + UIView() + ] + ) + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let content = UIView.vStack( + spacing: Constants.verticalSpace, + [ + UIView.hStack([ + statusLabel, + UIView(), + timeView + ]), + titleLabel, + trackInformation + ] + ) + + content.setCustomSpacing(Constants.afterTitleLabelVerticalSpace, after: titleLabel) + + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview() + } + + trackInformation.snp.makeConstraints { + $0.height.equalTo(Constants.trackInformationHeight) + } + } +} + +extension ReferendumInfoView { + enum Constants { + static let verticalSpace: CGFloat = 8 + static let afterTitleLabelVerticalSpace: CGFloat = 12 + static let trackInformationHeight: CGFloat = 22 + static let trackInformationHorizontalSpace: CGFloat = 6 + } +} + +extension ReferendumInfoView { + struct Model { + let status: Status + let time: Time? + let title: String? + let track: Track? + let referendumNumber: String? + } + + struct Time: Equatable { + let titleIcon: TitleIconViewModel + let isUrgent: Bool + } + + struct Track { + let title: String + let icon: ImageViewModelProtocol? + } + + struct Status { + let name: String + let kind: StatusKind + } + + enum StatusKind { + case positive + case negative + case neutral + } + + func bind(viewModel: Model) { + trackImageViewModel?.cancel(on: trackNameView.iconDetailsView.imageView) + trackImageViewModel = viewModel.track?.icon + + if let track = viewModel.track { + trackNameView.isHidden = false + + trackNameView.iconDetailsView.detailsLabel.text = track.title + + let iconSize = trackNameView.iconDetailsView.iconWidth + let imageSettings = ImageViewModelSettings( + targetSize: CGSize(width: iconSize, height: iconSize), + cornerRadius: nil, + tintColor: UILabel.Style.track.textColor + ) + + track.icon?.loadImage( + on: trackNameView.iconDetailsView.imageView, + settings: imageSettings, + animated: true + ) + } else { + trackNameView.isHidden = true + } + + numberLabel.isHidden = viewModel.referendumNumber == nil + + titleLabel.text = viewModel.title + + numberLabel.titleLabel.text = viewModel.referendumNumber + statusLabel.text = viewModel.status.name + bind(timeModel: viewModel.time) + + switch viewModel.status.kind { + case .positive: + statusLabel.apply(style: .positiveStatusLabel) + case .negative: + statusLabel.apply(style: .negativeStatusLabel) + case .neutral: + statusLabel.apply(style: .neutralStatusLabel) + } + } + + func bind(timeModel: Time?) { + if let time = timeModel { + timeView.bind(viewModel: time.titleIcon) + timeView.apply(style: time.isUrgent ? .activeTimeView : .timeView) + } else { + timeView.bind(viewModel: nil) + } + } +} + +extension IconDetailsView.Style { + static let timeView = IconDetailsView.Style( + tintColor: R.color.colorWhite64()!, + font: .caption1 + ) + static let activeTimeView = IconDetailsView.Style( + tintColor: R.color.colorDarkYellow()!, + font: .caption1 + ) +} + +private extension UILabel.Style { + static let positiveStatusLabel = UILabel.Style( + textColor: R.color.colorGreen15CF37(), + font: .semiBoldCaps1 + ) + static let neutralStatusLabel = UILabel.Style( + textColor: R.color.colorWhite64(), + font: .semiBoldCaps1 + ) + static let negativeStatusLabel = UILabel.Style( + textColor: R.color.colorRedFF3A69(), + font: .semiBoldCaps1 + ) + static let title = UILabel.Style( + textColor: .white, + font: .regularSubheadline + ) +} + +extension UILabel.Style { + static let track = UILabel.Style( + textColor: R.color.colorWhite64(), + font: .semiBoldCaps1 + ) +} + +extension RoundedView.Style { + static let referendum = RoundedView.Style( + fillColor: R.color.colorWhite8()!, + highlightedFillColor: R.color.colorAccentSelected()!, + rounding: .init(radius: 8, corners: .allCorners) + ) +} diff --git a/novawallet/Modules/Vote/Governance/View/ReferendumTableViewCell.swift b/novawallet/Modules/Vote/Governance/View/ReferendumTableViewCell.swift new file mode 100644 index 0000000000..87f16f8868 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/ReferendumTableViewCell.swift @@ -0,0 +1,293 @@ +import UIKit +import SoraUI + +final class ReferendumView: UIView { + let referendumInfoView = ReferendumInfoView() + let progressView = VotingProgressView() + let yourVoteView = YourVotesView() + var skeletonView: SkrullableView? + private var viewModel: LoadableViewModelState? + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let content = UIView.vStack( + spacing: 0, + [ + referendumInfoView, + progressView, + yourVoteView + ] + ) + + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } + + override func layoutSubviews() { + super.layoutSubviews() + + if skeletonView == nil, viewModel?.isLoading == true { + updateLoadingState() + } + } +} + +typealias ReferendumTableViewCell = BlurredTableViewCell + +extension ReferendumTableViewCell { + func applyStyle() { + shouldApplyHighlighting = true + contentInsets = .init(top: 8, left: 16, bottom: 8, right: 16) + innerInsets = .init(top: 16, left: 16, bottom: 16, right: 16) + } +} + +extension ReferendumView { + struct Model { + let referendumInfo: ReferendumInfoView.Model + let progress: VotingProgressView.Model? + let yourVotes: YourVotesView.Model? + } + + func bind(viewModel: LoadableViewModelState) { + self.viewModel = viewModel + + guard let model = viewModel.value else { + return + } + referendumInfoView.bind(viewModel: model.referendumInfo) + if let progressModel = model.progress { + progressView.bind(viewModel: progressModel) + progressView.isHidden = false + } else { + progressView.isHidden = true + } + + if let yourVotesModel = model.yourVotes { + yourVoteView.bind(viewModel: yourVotesModel) + yourVoteView.isHidden = false + } else { + yourVoteView.isHidden = true + } + } +} + +extension ReferendumView: SkeletonableView { + var skeletonSuperview: UIView { + self + } + + var hidingViews: [UIView] { + [ + referendumInfoView, + progressView, + yourVoteView + ] + } + + func updateLoadingState() { + if viewModel?.isLoading == false { + stopLoadingIfNeeded() + } else { + startLoadingIfNeeded() + } + } + + func createSkeletons(for spaceSize: CGSize) -> [Skeletonable] { + let (referendumInfoViewSkeletons, referendumInfoViewBottomViewMaxY) = + referendumInfoView.createSkeletons(on: self, contentInsets: .zero, spaceSize: spaceSize) + + let progressViewSkeletons = progressView.createSkeletons( + on: self, + contentInsets: .init(top: referendumInfoViewBottomViewMaxY, left: 0, bottom: 0, right: 0), + spaceSize: spaceSize + ) + + return referendumInfoViewSkeletons + progressViewSkeletons + } +} + +extension VotingProgressView { + // swiftlint:disable:next function_body_length + func createSkeletons( + on view: UIView, + contentInsets externalInsets: UIEdgeInsets, + spaceSize: CGSize + ) -> [SingleSkeleton] { + let contentInsets = UIEdgeInsets( + top: externalInsets.top + Constants.contentInsets.top, + left: externalInsets.left + Constants.contentInsets.left, + bottom: externalInsets.bottom + Constants.contentInsets.bottom, + right: externalInsets.right + Constants.contentInsets.right + ) + let tresholdSkeletonSize = CGSize(width: 121, height: 8) + let progressSkeletonHeight: CGFloat = 5 + let votingSkeletonSize = CGSize(width: 60, height: 8) + + let thresholdViewHeight = max(thresholdView.iconWidth, thresholdView.detailsLabel.font.lineHeight) + let thresholdSkeletonOffsetY = contentInsets.top + thresholdViewHeight / 2 - tresholdSkeletonSize.height / 2 + let thresholdSkeletonOffset = CGPoint( + x: contentInsets.left, + y: thresholdSkeletonOffsetY + ) + + let progressOffsetY = contentInsets.top + thresholdViewHeight + Constants.verticalSpace + let sliderHeight = slider.intrinsicContentSize.height + let progressSkeletonOffsetY = progressOffsetY + sliderHeight / 2 - progressSkeletonHeight / 2 + let progressHalfWidth = (spaceSize.width - contentInsets.left - contentInsets.right - 6) / 2 + + let progressSkeletonFirstPartOffset = CGPoint( + x: contentInsets.left, + y: progressSkeletonOffsetY + ) + let progressSkeletonSecondPartOffset = CGPoint( + x: progressSkeletonFirstPartOffset.x + progressHalfWidth + 6, + y: progressSkeletonOffsetY + ) + let progressSkeletonSize = CGSize(width: progressHalfWidth, height: progressSkeletonHeight) + let votingSkeletonOffsetY = progressOffsetY + sliderHeight + Constants.verticalSpace + + ayeProgressLabel.font.lineHeight / 2 - votingSkeletonSize.height / 2 + let ayeVotingSkeletonOffset = CGPoint( + x: contentInsets.left, + y: votingSkeletonOffsetY + ) + let nayVotingSkeletonOffset = CGPoint( + x: spaceSize.width - contentInsets.right - votingSkeletonSize.width, + y: votingSkeletonOffsetY + ) + let progressCenterX = (progressSkeletonSecondPartOffset.x + progressSkeletonSize.width - + progressSkeletonFirstPartOffset.x) / 2 + let passVotingSkeletonOffset = CGPoint( + x: progressCenterX - votingSkeletonSize.width / 2, + y: votingSkeletonOffsetY + ) + + return [ + CGRect(origin: thresholdSkeletonOffset, size: tresholdSkeletonSize), + CGRect(origin: progressSkeletonFirstPartOffset, size: progressSkeletonSize), + CGRect(origin: progressSkeletonSecondPartOffset, size: progressSkeletonSize), + CGRect(origin: ayeVotingSkeletonOffset, size: votingSkeletonSize), + CGRect(origin: passVotingSkeletonOffset, size: votingSkeletonSize), + CGRect(origin: nayVotingSkeletonOffset, size: votingSkeletonSize) + ].map { + SingleSkeleton.createRow( + on: view, + containerView: view, + spaceSize: spaceSize, + offset: $0.origin, + size: $0.size + ) + } + } +} + +extension ReferendumInfoView { + // swiftlint:disable:next function_body_length + func createSkeletons(on view: UIView, contentInsets: UIEdgeInsets, spaceSize: CGSize) -> ( + skeletons: [SingleSkeleton], + bottomViewMaxY: CGFloat + ) { + let statusSkeletonSize = CGSize(width: 60, height: 12) + let timeSkeletonSize = CGSize(width: 116, height: 12) + let titleSkeletonSize = CGSize(width: 178, height: 12) + let trackNameSkeletonSize = CGSize(width: 121, height: 22) + let numberSkeletonSize = CGSize(width: 46, height: 22) + + let statusSkeletonOffsetY = contentInsets.top + statusLabel.font.lineHeight / 2 - statusSkeletonSize.height / 2 + + let statusSkeletonOffset = CGPoint( + x: contentInsets.left, + y: statusSkeletonOffsetY + ) + + let timeSkeletonOffsetY = contentInsets.top + timeView.detailsLabel.font.lineHeight / 2 - + timeSkeletonSize.height / 2 + let timeSkeletonOffset = CGPoint( + x: spaceSize.width - contentInsets.right - timeSkeletonSize.width, + y: timeSkeletonOffsetY + ) + + let titleOffsetY = contentInsets.top + statusLabel.font.lineHeight + Constants.verticalSpace + let titleSkeletonOffsetY: CGFloat = titleOffsetY + titleLabel.font.lineHeight / 2 - titleSkeletonSize.height / 2 + + let titleSkeletonOffset = CGPoint( + x: contentInsets.left, + y: titleSkeletonOffsetY + ) + let trackNameOffsetY = contentInsets.top + statusLabel.font.lineHeight + Constants.verticalSpace + + titleLabel.font.lineHeight + Constants.afterTitleLabelVerticalSpace + let trackNameSkeletonOffsetY = trackNameOffsetY + Constants.trackInformationHeight / 2 - + trackNameSkeletonSize.height / 2 + + let trackNameSkeletonOffset = CGPoint( + x: contentInsets.left, + y: trackNameSkeletonOffsetY + ) + + let numberSkeletonOffset = CGPoint( + x: trackNameSkeletonOffset.x + trackNameSkeletonSize.width + Constants.trackInformationHorizontalSpace, + y: trackNameSkeletonOffsetY + ) + + return ( + skeletons: [ + SingleSkeleton.createRow( + on: view, + containerView: view, + spaceSize: spaceSize, + offset: statusSkeletonOffset, + size: statusSkeletonSize + ), + SingleSkeleton.createRow( + on: view, + containerView: view, + spaceSize: spaceSize, + offset: timeSkeletonOffset, + size: timeSkeletonSize + ), + SingleSkeleton.createRow( + on: view, + containerView: view, + spaceSize: spaceSize, + offset: titleSkeletonOffset, + size: titleSkeletonSize + ), + SingleSkeleton.createRow( + on: view, + containerView: view, + spaceSize: spaceSize, + offset: trackNameSkeletonOffset, + size: trackNameSkeletonSize, + cornerRadii: .init( + width: 7 / trackNameSkeletonSize.width, + height: 7 / trackNameSkeletonSize.height + ) + ), + SingleSkeleton.createRow( + on: view, + containerView: view, + spaceSize: spaceSize, + offset: numberSkeletonOffset, + size: numberSkeletonSize, + cornerRadii: .init( + width: 7 / numberSkeletonSize.width, + height: 7 / numberSkeletonSize.height + ) + ) + ], + bottomViewMaxY: trackNameOffsetY + Constants.trackInformationHeight + ) + } +} diff --git a/novawallet/Modules/Vote/Governance/View/ReferendumsUnlocksTableViewCell.swift b/novawallet/Modules/Vote/Governance/View/ReferendumsUnlocksTableViewCell.swift new file mode 100644 index 0000000000..ca3b34637f --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/ReferendumsUnlocksTableViewCell.swift @@ -0,0 +1,72 @@ +import UIKit + +final class ReferendumsUnlocksView: GenericTitleValueView< + GenericPairValueView, IconDetailsView +> { + var titleLabel: UILabel { + titleView.fView + } + + var locksLabel: UILabel { + titleView.sView.iconDetailsView.detailsLabel + } + + var unlocksLabel: UILabel { + valueView.detailsLabel + } + + override init(frame: CGRect) { + super.init(frame: frame) + + configure() + } + + func bind(viewModel: ReferendumsUnlocksViewModel, locale: Locale) { + titleLabel.text = R.string.localizable.walletBalanceLocked(preferredLanguages: locale.rLanguages) + locksLabel.text = viewModel.totalLock + unlocksLabel.text = viewModel.hasUnlock ? + R.string.localizable.commonUnlock(preferredLanguages: locale.rLanguages) : "" + } + + private func configure() { + titleView.setHorizontalAndSpacing(8.0) + + titleLabel.apply(style: .regularSubhedlineWhite) + + locksLabel.apply(style: .footnoteWhite64) + locksLabel.numberOfLines = 1 + + unlocksLabel.apply(style: .unlockStyle) + unlocksLabel.numberOfLines = 1 + + titleView.sView.backgroundView.fillColor = R.color.colorWhite16()! + titleView.sView.iconDetailsView.iconWidth = 12 + titleView.sView.iconDetailsView.spacing = 4 + titleView.sView.contentInsets = UIEdgeInsets(top: 3, left: 8, bottom: 3, right: 8) + titleView.sView.backgroundView.cornerRadius = 6 + titleView.sView.iconDetailsView.imageView.image = R.image.iconBrowserSecurity()?.tinted( + with: R.color.colorWhite64()! + ) + + valueView.mode = .detailsIcon + valueView.spacing = 4 + valueView.iconWidth = 24 + valueView.imageView.image = R.image.iconSmallArrow()?.tinted(with: R.color.colorWhite48()!) + } +} + +private extension UILabel.Style { + static var unlockStyle: UILabel.Style { + .init(textColor: R.color.colorGreen()!, font: .caption1) + } +} + +typealias ReferendumsUnlocksTableViewCell = BlurredTableViewCell + +extension ReferendumsUnlocksTableViewCell { + func applyStyle() { + shouldApplyHighlighting = true + contentInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16) + innerInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16) + } +} diff --git a/novawallet/Modules/Vote/Governance/View/Slider/GovernanceStyle.swift b/novawallet/Modules/Vote/Governance/View/Slider/GovernanceStyle.swift new file mode 100644 index 0000000000..7a86d62c41 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/Slider/GovernanceStyle.swift @@ -0,0 +1,34 @@ +import UIKit + +extension SliderView.Style { + static let governance = SliderView.Style( + firstColor: R.color.colorGreen15CF37()!, + lastColor: R.color.colorRedFF3A69()!, + zeroColor: R.color.colorWhite16()!, + cornerRadius: 4, + dividerSpace: 6 + ) +} + +extension SegmentedSliderView.ThumbStyle { + static let governance = SegmentedSliderView.ThumbStyle( + color: .white, + cornerRadius: 8, + width: 3, + height: nil, + shadow: .init( + color: R.color.colorBlack72()!, + opacity: 1, + offset: .zero, + radius: 8 + ) + ) +} + +extension SegmentedSliderView.Style { + static let governance = SegmentedSliderView.Style( + lineInsets: .init(top: 3, left: 0, bottom: 3, right: 0), + sliderStyle: .governance, + thumbStyle: .governance + ) +} diff --git a/novawallet/Modules/Vote/Governance/View/Slider/SegmentedSliderView.swift b/novawallet/Modules/Vote/Governance/View/Slider/SegmentedSliderView.swift new file mode 100644 index 0000000000..a58006b715 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/Slider/SegmentedSliderView.swift @@ -0,0 +1,129 @@ +import UIKit + +final class SegmentedSliderView: UIView { + private var style: Style = .defaultStyle + private var model: Model = .init() + + let slider = SliderView() + let thumb = ThumbView() + + override init(frame: CGRect) { + super.init(frame: frame) + + backgroundColor = .clear + + addSubview(slider) + addSubview(thumb) + + apply(style: style) + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func layoutSubviews() { + super.layoutSubviews() + + let sliderFrame = bounds.inset(by: style.lineInsets) + slider.frame = sliderFrame + + guard let thumbStyle = style.thumbStyle else { + thumb.frame = .zero + return + } + + let thumbValueDouble = NSDecimalNumber(decimal: model.thumbProgress).doubleValue + let originX = sliderFrame.size.width * thumbValueDouble - thumbStyle.width / 2 + let thumbHeight = thumbStyle.height ?? bounds.size.height + let originY = sliderFrame.midY - thumbHeight / 2 + let origin = CGPoint(x: min(bounds.maxX, max(originX, bounds.minX)), y: originY) + let size = CGSize(width: thumbStyle.width, height: thumbHeight) + + thumb.frame = CGRect(origin: origin, size: size) + } + + override var intrinsicContentSize: CGSize { + CGSize(width: UIView.noIntrinsicMetric, height: 11) + } +} + +extension SegmentedSliderView { + typealias SliderStyle = SliderView.Style + struct Style { + let lineInsets: UIEdgeInsets + let sliderStyle: SliderStyle + let thumbStyle: ThumbStyle? + + static let defaultStyle = Style( + lineInsets: .init(top: 3, left: 0, bottom: 3, right: 0), + sliderStyle: .defaultStyle, + thumbStyle: .defaultStyle + ) + } + + struct ThumbStyle { + let color: UIColor + let cornerRadius: CGFloat + let width: CGFloat + let height: CGFloat? + var shadow: ShadowStyle + + static let defaultStyle = ThumbStyle( + color: .white, + cornerRadius: 8, + width: 3, + height: nil, + shadow: .defaultStyle + ) + } + + struct ShadowStyle { + let color: UIColor + let opacity: Float + let offset: CGSize + let radius: CGFloat + + static let defaultStyle = ShadowStyle( + color: UIColor(red: 0, green: 0, blue: 0, alpha: 0.72), + opacity: 1, + offset: .zero, + radius: 8 + ) + } + + func apply(style: Style) { + self.style = style + slider.apply(style: style.sliderStyle) + + style.thumbStyle.map { + thumb.apply(style: .init(color: $0.color, cornerRadius: $0.cornerRadius)) + thumb.shadowColor = $0.shadow.color + thumb.shadowOpacity = $0.shadow.opacity + thumb.shadowOffset = $0.shadow.offset + thumb.shadowRadius = $0.shadow.radius + } + + setNeedsDisplay() + } +} + +extension SegmentedSliderView { + struct Model { + let thumbProgress: Decimal + let value: Decimal? + + init(thumbProgress: Decimal = 0.0, value: Decimal? = nil) { + self.thumbProgress = thumbProgress + self.value = value + } + } + + func bind(viewModel: Model) { + model = viewModel + slider.gap = model.value.map { CGFloat(NSDecimalNumber(decimal: $0).floatValue) } + + setNeedsLayout() + } +} diff --git a/novawallet/Modules/Vote/Governance/View/Slider/SliderView.swift b/novawallet/Modules/Vote/Governance/View/Slider/SliderView.swift new file mode 100644 index 0000000000..87b35243fa --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/Slider/SliderView.swift @@ -0,0 +1,103 @@ +import UIKit +import SoraUI + +final class SliderView: UIView { + private let firstSegment: RoundedView = .create { view in + view.shadowOpacity = 0.0 + } + + private let lastSegment: RoundedView = .create { view in + view.shadowOpacity = 0.0 + } + + private var sliderStyle: Style = .defaultStyle + + var gap: CGFloat? { + didSet { + if gap != oldValue { + applyStyleAndLayout() + } + } + } + + override init(frame: CGRect) { + super.init(frame: frame) + + addSubview(firstSegment) + addSubview(lastSegment) + + apply(style: sliderStyle) + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func applyStyleAndLayout() { + firstSegment.cornerRadius = sliderStyle.cornerRadius + lastSegment.cornerRadius = sliderStyle.cornerRadius + + if gap != nil { + firstSegment.fillColor = sliderStyle.firstColor + lastSegment.fillColor = sliderStyle.lastColor + + lastSegment.isHidden = false + } else { + firstSegment.fillColor = sliderStyle.zeroColor + + lastSegment.isHidden = true + } + + setNeedsLayout() + } + + override func layoutSubviews() { + super.layoutSubviews() + + if let gap = gap { + let lineCalculationSize = CGSize( + width: bounds.width - sliderStyle.dividerSpace, + height: bounds.height + ) + + let firstSegmentSize = lineCalculationSize.applying(.init(scaleX: gap, y: 1)) + let lastSegmentSize = lineCalculationSize.applying(.init(scaleX: 1 - gap, y: 1)) + let space = firstSegmentSize.width + sliderStyle.dividerSpace + + let lastSegmentOrigin = bounds.origin.applying(.init( + translationX: space, + y: 0 + )) + + firstSegment.frame = CGRect(origin: bounds.origin, size: firstSegmentSize) + lastSegment.frame = CGRect(origin: lastSegmentOrigin, size: lastSegmentSize) + } else { + firstSegment.frame = bounds + } + } +} + +extension SliderView { + struct Style { + let firstColor: UIColor + let lastColor: UIColor + let zeroColor: UIColor + let cornerRadius: CGFloat + let dividerSpace: CGFloat + + static let defaultStyle = Style( + firstColor: .green, + lastColor: .red, + zeroColor: .gray, + cornerRadius: 4, + dividerSpace: 6 + ) + } + + func apply(style: Style) { + sliderStyle = style + + applyStyleAndLayout() + } +} diff --git a/novawallet/Modules/Vote/Governance/View/Slider/ThumbView.swift b/novawallet/Modules/Vote/Governance/View/Slider/ThumbView.swift new file mode 100644 index 0000000000..d62b768949 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/Slider/ThumbView.swift @@ -0,0 +1,35 @@ +import UIKit +import SoraUI + +final class ThumbView: RoundedView { + private var thumbStyle: Style = .defaultStyle + + override init(frame: CGRect) { + super.init(frame: frame) + + apply(style: thumbStyle) + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +extension ThumbView { + struct Style { + let color: UIColor + let cornerRadius: CGFloat + + static let defaultStyle = Style(color: .gray, cornerRadius: 10) + } + + func apply(style: Style) { + thumbStyle = style + + fillColor = thumbStyle.color + cornerRadius = style.cornerRadius + + setNeedsLayout() + } +} diff --git a/novawallet/Modules/Vote/Governance/View/UILabel+Style.swift b/novawallet/Modules/Vote/Governance/View/UILabel+Style.swift new file mode 100644 index 0000000000..c2481d38d1 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/UILabel+Style.swift @@ -0,0 +1,96 @@ +import UIKit +import SoraUI + +extension UILabel { + struct Style { + let textColor: UIColor? + let font: UIFont + } + + convenience init(style: Style, textAlignment: NSTextAlignment = .left, numberOfLines: Int = 0) { + self.init() + self.textAlignment = textAlignment + self.numberOfLines = numberOfLines + apply(style: style) + } + + func apply(style: Style) { + textColor = style.textColor + font = style.font + } +} + +extension RoundedView { + struct Style { + var shadowOpacity: CFloat? + var strokeWidth: CGFloat? + var strokeColor: UIColor? + var highlightedStrokeColor: UIColor? + var fillColor: UIColor + var highlightedFillColor: UIColor + var rounding: Rounding? + + struct Rounding { + let radius: CGFloat + let corners: UIRectCorner + } + } + + func apply(style: Style) { + style.shadowOpacity.map { shadowOpacity = $0 } + style.strokeWidth.map { strokeWidth = $0 } + style.strokeColor.map { strokeColor = $0 } + style.highlightedStrokeColor.map { highlightedStrokeColor = $0 } + + fillColor = style.fillColor + highlightedFillColor = style.highlightedFillColor + + style.rounding.map { + roundingCorners = $0.corners + cornerRadius = $0.radius + } + } +} + +extension IconDetailsView { + struct Style { + let tintColor: UIColor + let font: UIFont + } + + func apply(style: Style) { + detailsLabel.apply(style: .init(textColor: style.tintColor, font: style.font)) + imageView.tintColor = style.tintColor + } +} + +extension IconDetailsView { + func bind(viewModel: TitleIconViewModel?) { + imageView.image = viewModel?.icon + detailsLabel.text = viewModel?.title + } +} + +extension UILabel.Style { + static let footnoteWhite64 = UILabel.Style( + textColor: R.color.colorWhite64()!, + font: .regularFootnote + ) + + static let caption1White64 = UILabel.Style( + textColor: R.color.colorWhite64()!, + font: .caption1 + ) + + static let regularSubhedlineWhite = UILabel.Style( + textColor: R.color.colorWhite()!, + font: .regularSubheadline + ) +} + +extension UILabel.Style { + static let rowLink = UILabel.Style( + textColor: R.color.colorAccent(), + font: .p2Paragraph + ) +} diff --git a/novawallet/Modules/Vote/Governance/View/VotingProgressView.swift b/novawallet/Modules/Vote/Governance/View/VotingProgressView.swift new file mode 100644 index 0000000000..301d115093 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/VotingProgressView.swift @@ -0,0 +1,104 @@ +import UIKit + +final class VotingProgressView: UIView { + let thresholdView: IconDetailsView = .create { + $0.detailsLabel.apply(style: .referendaTimeView) + $0.imageView.contentMode = .scaleAspectFit + $0.iconWidth = 14 + $0.spacing = 5 + } + + let slider: SegmentedSliderView = .create { + $0.apply(style: .governance) + } + + let ayeProgressLabel: UILabel = .init(style: .referendaTimeView, textAlignment: .left) + let passProgressLabel: UILabel = .init(style: .referendaTimeView, textAlignment: .center) + let nayProgressLabel: UILabel = .init(style: .referendaTimeView, textAlignment: .right) + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let content = UIView.vStack( + spacing: Constants.verticalSpace, + [ + thresholdView, + slider, + UIView.hStack( + distribution: .fillEqually, + [ + ayeProgressLabel, + passProgressLabel, + nayProgressLabel + ] + ) + ] + ) + + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview().inset(Constants.contentInsets) + } + } +} + +extension VotingProgressView { + enum Constants { + static let verticalSpace: CGFloat = 6 + static let contentInsets = UIEdgeInsets(top: 16, left: 0, bottom: 0, right: 0) + } +} + +extension VotingProgressView: BindableView { + struct Model { + let support: SupportModel? + let approval: ApprovalModel + } + + struct SupportModel { + let titleIcon: TitleIconViewModel + let completed: Bool + } + + struct ApprovalModel { + let passThreshold: Decimal + let ayeProgress: Decimal? + let ayeMessage: String + let passMessage: String + let nayMessage: String + } + + func bind(viewModel: Model) { + slider.bind(viewModel: .init( + thumbProgress: viewModel.approval.passThreshold, + value: viewModel.approval.ayeProgress + )) + + ayeProgressLabel.text = viewModel.approval.ayeMessage + passProgressLabel.text = viewModel.approval.passMessage + nayProgressLabel.text = viewModel.approval.nayMessage + + if let support = viewModel.support, !support.completed { + thresholdView.isHidden = false + thresholdView.bind(viewModel: support.titleIcon) + } else { + thresholdView.isHidden = true + } + } +} + +extension UILabel.Style { + static let referendaTimeView = UILabel.Style( + textColor: R.color.colorWhite64(), + font: .caption1 + ) +} diff --git a/novawallet/Modules/Vote/Governance/View/YourVoteView.swift b/novawallet/Modules/Vote/Governance/View/YourVoteView.swift new file mode 100644 index 0000000000..876a66dc14 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/View/YourVoteView.swift @@ -0,0 +1,168 @@ +import UIKit + +final class YourVotesView: UIView { + let topLine = createSeparator(color: R.color.colorWhite8()) + let ayeView: YourVoteView = .create { + $0.apply(style: .aye) + } + + let nayView: YourVoteView = .create { + $0.apply(style: .nay) + } + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + let content = UIView.vStack( + spacing: 12, + [ + topLine, + ayeView, + nayView + ] + ) + + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview().inset(UIEdgeInsets(top: 13, left: 0, bottom: 0, right: 0)) + } + topLine.snp.makeConstraints { + $0.height.equalTo(1) + } + } +} + +extension YourVotesView { + struct Model { + let aye: YourVoteView.Model? + let nay: YourVoteView.Model? + } + + func bind(viewModel: Model) { + ayeView.isHidden = viewModel.aye == nil + ayeView.bind(viewModel: viewModel.aye) + nayView.isHidden = viewModel.nay == nil + nayView.bind(viewModel: viewModel.nay) + } +} + +final class YourVoteView: UIView { + let typeView: BorderedLabelView = .create { + $0.contentInsets = .init(top: 4, left: 8, bottom: 4, right: 8) + } + + let voteLabel = UILabel(style: .votes, textAlignment: .left) + lazy var content: UIStackView = UIView.hStack( + spacing: 6, + [ + typeView, + voteLabel + ] + ) + + override init(frame: CGRect) { + super.init(frame: frame) + + setupLayout() + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupLayout() { + voteLabel.setContentHuggingPriority(.defaultLow, for: .horizontal) + addSubview(content) + content.snp.makeConstraints { + $0.edges.equalToSuperview() + } + } +} + +extension YourVoteView { + struct Model { + let title: String + let description: String + let style: YourVoteView.Style + } + + func bind(viewModel: Model?) { + typeView.titleLabel.text = viewModel?.title + voteLabel.text = viewModel?.description + + if let style = viewModel?.style { + apply(style: style) + } + } +} + +extension YourVoteView { + struct Style { + let voteLabel: UILabel.Style + let typeView: UILabel.Style + let mode: Mode + + enum Mode { + case titleType, typeTitle + } + } + + func apply(style: Style) { + voteLabel.apply(style: style.voteLabel) + typeView.titleLabel.apply(style: style.typeView) + switch style.mode { + case .titleType: + content.semanticContentAttribute = .forceRightToLeft + case .typeTitle: + content.semanticContentAttribute = .unspecified + } + } +} + +extension YourVoteView.Style { + static let aye = YourVoteView.Style( + voteLabel: .votes, + typeView: .ayeType, + mode: .typeTitle + ) + static let nay = YourVoteView.Style( + voteLabel: .votes, + typeView: .nayType, + mode: .typeTitle + ) + static let ayeInverse = YourVoteView.Style( + voteLabel: .votes, + typeView: .ayeType, + mode: .titleType + ) + static let nayInverse = YourVoteView.Style( + voteLabel: .votes, + typeView: .nayType, + mode: .titleType + ) +} + +extension UILabel.Style { + static let ayeType = UILabel.Style( + textColor: R.color.colorGreen15CF37()!, + font: .semiBoldCaps1 + ) + static let nayType = UILabel.Style( + textColor: R.color.colorRedFF3A69(), + font: .semiBoldCaps1 + ) + static let votes = UILabel.Style( + textColor: R.color.colorWhite64(), + font: .caption1 + ) +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumDisplayStringFactory.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumDisplayStringFactory.swift new file mode 100644 index 0000000000..7fea807594 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumDisplayStringFactory.swift @@ -0,0 +1,147 @@ +import Foundation +import BigInt + +protocol ReferendumDisplayStringFactoryProtocol { + func createVotes(from votes: BigUInt, chain: ChainModel, locale: Locale) -> String? + + func createVotesDetails( + from amount: BigUInt, + conviction: Decimal?, + chain: ChainModel, + locale: Locale + ) -> String? +} + +extension ReferendumDisplayStringFactoryProtocol { + func createReferendumVotes( + from referendum: ReferendumLocal, + chain: ChainModel, + locale: Locale + ) -> ReferendumVotesViewModel? { + guard let voting = referendum.voting else { + return nil + } + + let ayesString: String? + let naysString: String? + + switch voting { + case let .supportAndVotes(model): + ayesString = createVotes(from: model.ayes, chain: chain, locale: locale) + naysString = createVotes(from: model.nays, chain: chain, locale: locale) + case let .threshold(model): + ayesString = createVotes(from: model.ayes, chain: chain, locale: locale) + naysString = createVotes(from: model.nays, chain: chain, locale: locale) + } + + let aye: VoteRowView.Model? = ayesString.map { + .init( + title: R.string.localizable.governanceAye(preferredLanguages: locale.rLanguages), + votes: $0 + ) + } + + let nay: VoteRowView.Model? = naysString.map { + .init( + title: R.string.localizable.governanceNay(preferredLanguages: locale.rLanguages), + votes: $0 + ) + } + + return ReferendumVotesViewModel(ayes: aye, nays: nay) + } + + func createYourVotesViewModel( + from vote: ReferendumAccountVoteLocal, + chain: ChainModel, + locale: Locale + ) -> YourVoteRow.Model { + let votesString = createVotes( + from: vote.convictionValue.votes(for: vote.totalBalance) ?? 0, + chain: chain, + locale: locale + ) + + let convictionString = createVotesDetails( + from: vote.totalBalance, + conviction: vote.conviction, + chain: chain, + locale: locale + ) + + let voteSideString: String + let voteSideStyle: YourVoteView.Style + + if vote.hasAyeVotes { + voteSideString = R.string.localizable.governanceAye(preferredLanguages: locale.rLanguages) + voteSideStyle = .ayeInverse + } else { + voteSideString = R.string.localizable.governanceNay(preferredLanguages: locale.rLanguages) + voteSideStyle = .nayInverse + } + + let voteDescription = R.string.localizable.govYourVote(preferredLanguages: locale.rLanguages) + + return YourVoteRow.Model( + vote: .init(title: voteSideString.uppercased(), description: voteDescription, style: voteSideStyle), + amount: .init(topValue: votesString ?? "", bottomValue: convictionString) + ) + } +} + +final class ReferendumDisplayStringFactory: ReferendumDisplayStringFactoryProtocol { + let formatterFactory: AssetBalanceFormatterFactoryProtocol + + init(formatterFactory: AssetBalanceFormatterFactoryProtocol = AssetBalanceFormatterFactory()) { + self.formatterFactory = formatterFactory + } + + func createVotes(from votes: BigUInt, chain: ChainModel, locale: Locale) -> String? { + guard let asset = chain.utilityAsset() else { + return nil + } + + let displayInfo = ChainAsset(chain: chain, asset: asset).assetDisplayInfo + + let votesDecimal = Decimal.fromSubstrateAmount(votes, precision: displayInfo.assetPrecision) ?? 0 + + let displayFormatter = formatterFactory.createDisplayFormatter(for: displayInfo).value(for: locale) + + if let votesValueString = displayFormatter.stringFromDecimal(votesDecimal) { + return R.string.localizable.govCommonVotesFormat(votesValueString, preferredLanguages: locale.rLanguages) + } else { + return nil + } + } + + func createVotesDetails( + from amount: BigUInt, + conviction: Decimal?, + chain: ChainModel, + locale: Locale + ) -> String? { + guard let asset = chain.utilityAsset() else { + return nil + } + + let displayInfo = ChainAsset(chain: chain, asset: asset).assetDisplayInfo + + let displayFormatter = formatterFactory.createDisplayFormatter(for: displayInfo).value(for: locale) + let tokenFormatter = formatterFactory.createTokenFormatter(for: displayInfo).value(for: locale) + + let optConvictionString = displayFormatter.stringFromDecimal(conviction ?? 0) + + let amountDecimal = Decimal.fromSubstrateAmount(amount, precision: displayInfo.assetPrecision) ?? 0 + let optAmountString = tokenFormatter.stringFromDecimal(amountDecimal) + + if let convictionString = optConvictionString, let amountString = optAmountString { + return R.string.localizable.govCommonAmountConvictionFormat( + amountString, + convictionString, + preferredLanguages: locale.rLanguages + ) + } else { + return nil + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumMetadataViewModelFactory.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumMetadataViewModelFactory.swift new file mode 100644 index 0000000000..04c74ad394 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumMetadataViewModelFactory.swift @@ -0,0 +1,64 @@ +import Foundation +import SoraFoundation + +protocol ReferendumMetadataViewModelFactoryProtocol { + func createTitle( + for referendum: ReferendumLocal, + metadata: ReferendumMetadataLocal?, + locale: Locale + ) -> String + + func createDescription( + for referendum: ReferendumLocal, + metadata: ReferendumMetadataLocal?, + locale: Locale + ) -> String +} + +extension ReferendumMetadataViewModelFactoryProtocol { + func createDetailsViewModel( + for referendum: ReferendumLocal, + metadata: ReferendumMetadataLocal?, + locale: Locale + ) -> ReferendumDetailsTitleView.Details { + let title = createTitle(for: referendum, metadata: metadata, locale: locale) + let description = createDescription(for: referendum, metadata: metadata, locale: locale) + + return .init(title: title, description: description) + } +} + +final class ReferendumMetadataViewModelFactory { + let indexFormatter: LocalizableResource + + init(indexFormatter: LocalizableResource) { + self.indexFormatter = indexFormatter + } +} + +extension ReferendumMetadataViewModelFactory: ReferendumMetadataViewModelFactoryProtocol { + func createTitle(for referendum: ReferendumLocal, metadata: ReferendumMetadataLocal?, locale: Locale) -> String { + if let title = metadata?.title, !title.isEmpty { + return title + } else { + let index = indexFormatter.value(for: locale).string(from: referendum.index as NSNumber) + + return R.string.localizable.govReferendumTitleFallback( + index ?? "", + preferredLanguages: locale.rLanguages + ) + } + } + + func createDescription( + for _: ReferendumLocal, + metadata: ReferendumMetadataLocal?, + locale: Locale + ) -> String { + if let description = metadata?.content, !description.isEmpty { + return description + } else { + return R.string.localizable.govReferendumDescriptionFallback(preferredLanguages: locale.rLanguages) + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumStatusViewModelFactory.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumStatusViewModelFactory.swift new file mode 100644 index 0000000000..7c8335ed02 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumStatusViewModelFactory.swift @@ -0,0 +1,172 @@ +import Foundation + +protocol ReferendumStatusViewModelFactoryProtocol { + func createTimeViewModel( + for referendum: ReferendumLocal, + currentBlock: BlockNumber, + blockDuration: UInt64, + locale: Locale + ) -> StatusTimeViewModel? +} + +extension ReferendumStatusViewModelFactoryProtocol { + func createTimeViewModels( + referendums: [ReferendumLocal], + currentBlock: BlockNumber, + blockDuration: UInt64, + locale: Locale + ) -> [UInt: StatusTimeViewModel?] { + referendums.reduce(into: [UInt: StatusTimeViewModel?]()) { result, referendum in + result[referendum.index] = createTimeViewModel( + for: referendum, + currentBlock: currentBlock, + blockDuration: blockDuration, + locale: locale + ) + } + } +} + +final class ReferendumStatusViewModelFactory { + // swiftlint:disable:next function_parameter_count + private func createTimeViewModel( + state: ReferendumStateLocal, + atBlock: Moment, + currentBlock: BlockNumber, + blockDuration: UInt64, + timeStringProvider: @escaping (String, [String]?) -> String, + locale: Locale + ) -> StatusTimeViewModel? { + let time = calculateTime( + block: atBlock, + currentBlock: currentBlock, + blockDuration: blockDuration + ) + guard let timeModel = createTimeViewModel( + time: time, + timeStringProvider: timeStringProvider, + state: state, + locale: locale + ) else { + return nil + } + return .init(viewModel: timeModel, timeInterval: time) { [weak self] in + self?.createTimeViewModel( + time: $0, + timeStringProvider: timeStringProvider, + state: state, + locale: locale + ) + } + } + + private func createTimeViewModel( + time: TimeInterval, + timeStringProvider: (String, [String]?) -> String, + state: ReferendumStateLocal, + locale: Locale + ) -> ReferendumInfoView.Time? { + guard let localizedDaysHours = time.localizedDaysOrTime(for: locale) else { + return nil + } + let timeString = timeStringProvider(localizedDaysHours, locale.rLanguages) + let timeModel = isUrgent(state: state, time: time).map { isUrgent in + ReferendumInfoView.Time( + titleIcon: .init( + title: timeString, + icon: isUrgent ? R.image.iconFire() : R.image.iconLightPending() + ), + isUrgent: isUrgent + ) + } + return timeModel + } + + private func calculateTime(block: Moment, currentBlock: BlockNumber, blockDuration: UInt64) -> TimeInterval { + currentBlock.secondsTo(block: block, blockDuration: blockDuration) + } + + private func isUrgent(state: ReferendumStateLocal, time: TimeInterval) -> Bool? { + switch state { + case .preparing: + return time.hoursFromSeconds <= 3 + case .deciding: + return time.daysFromSeconds < 1 + case .approved: + return time.daysFromSeconds < 1 + case .rejected: + return time.daysFromSeconds < 1 + case .cancelled, .timedOut, .killed, .executed: + return nil + } + } +} + +extension ReferendumStatusViewModelFactory: ReferendumStatusViewModelFactoryProtocol { + // swiftlint:disable:next function_body_length + func createTimeViewModel( + for referendum: ReferendumLocal, + currentBlock: BlockNumber, + blockDuration: UInt64, + locale: Locale + ) -> StatusTimeViewModel? { + let strings = R.string.localizable.self + switch referendum.state { + case let .preparing(model): + if model.deposit == nil || currentBlock >= model.preparingEnd { + return createTimeViewModel( + state: referendum.state, + atBlock: max(currentBlock, model.timeoutAt), + currentBlock: currentBlock, + blockDuration: blockDuration, + timeStringProvider: strings.governanceReferendumsTimeTimeout, + locale: locale + ) + } else { + return createTimeViewModel( + state: referendum.state, + atBlock: model.preparingEnd, + currentBlock: currentBlock, + blockDuration: blockDuration, + timeStringProvider: strings.governanceReferendumsTimeDeciding, + locale: locale + ) + } + case let .deciding(model): + if model.isPassing(for: currentBlock), let confirmationUntil = model.confirmationUntil { + return createTimeViewModel( + state: referendum.state, + atBlock: confirmationUntil, + currentBlock: currentBlock, + blockDuration: blockDuration, + timeStringProvider: strings.governanceReferendumsTimeApprove, + locale: locale + ) + } else { + return createTimeViewModel( + state: referendum.state, + atBlock: model.rejectedAt, + currentBlock: currentBlock, + blockDuration: blockDuration, + timeStringProvider: strings.governanceReferendumsTimeReject, + locale: locale + ) + } + case let .approved(model): + guard let whenEnactment = model.whenEnactment else { + return nil + } + + return createTimeViewModel( + state: referendum.state, + atBlock: whenEnactment, + currentBlock: currentBlock, + blockDuration: blockDuration, + timeStringProvider: strings.governanceReferendumsTimeExecute, + locale: locale + ) + case .rejected, .cancelled, .timedOut, .killed, .executed: + return nil + } + } +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumTimelineViewModelFactory.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumTimelineViewModelFactory.swift new file mode 100644 index 0000000000..8b2ef6f996 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumTimelineViewModelFactory.swift @@ -0,0 +1,385 @@ +import Foundation +import SoraFoundation + +protocol ReferendumTimelineViewModelFactoryProtocol { + func createTimelineViewModel( + for referendum: ReferendumLocal, + metadata: ReferendumMetadataLocal?, + currentBlock: BlockNumber, + blockDuration: UInt64, + locale: Locale + ) -> [ReferendumTimelineView.Model]? +} + +final class ReferendumTimelineViewModelFactory { + let statusViewModelFactory: ReferendumStatusViewModelFactoryProtocol + let timeFormatter: LocalizableResource + + init( + statusViewModelFactory: ReferendumStatusViewModelFactoryProtocol, + timeFormatter: LocalizableResource + ) { + self.statusViewModelFactory = statusViewModelFactory + self.timeFormatter = timeFormatter + } + + private func createPreviousTime( + atBlock: BlockNumber, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> String? { + let date: Date + + if atBlock < currentBlock { + let timeInterval = atBlock.secondsTo(block: currentBlock, blockDuration: blockTime) + + date = Date().addingTimeInterval(-timeInterval) + } else { + date = Date() + } + + return timeFormatter.value(for: locale).string(from: date) + } + + private func makeTimeViewModel( + title: String, + atBlock: BlockNumber?, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale, + isLast: Bool = false + ) -> ReferendumTimelineView.Model { + let subtitle: ReferendumTimelineView.StatusSubtitle? + + if + let atBlock = atBlock, + let date = createPreviousTime( + atBlock: atBlock, + currentBlock: currentBlock, + blockTime: blockTime, + locale: locale + ) { + subtitle = .date(date) + } else { + subtitle = nil + } + + return .init(title: title, subtitle: subtitle, isLast: isLast) + } + + private func makeCreatedViewModel( + atBlock: BlockNumber?, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumTimelineView.Model { + makeTimeViewModel( + title: R.string.localizable.govTimelineCreated(preferredLanguages: locale.rLanguages), + atBlock: atBlock, + currentBlock: currentBlock, + blockTime: blockTime, + locale: locale + ) + } + + private func createPreparing( + model: ReferendumStateLocal.Preparing, + referendum: ReferendumLocal, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumTimelineView.Model { + let status = statusViewModelFactory.createTimeViewModel( + for: referendum, + currentBlock: currentBlock, + blockDuration: blockTime, + locale: locale + ) + + let votingTitle: String = model.inQueue ? + R.string.localizable.governanceReferendumsStatusPreparingInqueue(preferredLanguages: locale.rLanguages) : + R.string.localizable.governanceReferendumsStatusPreparing(preferredLanguages: locale.rLanguages) + + let title = R.string.localizable.govTimelineVotingFormat( + votingTitle.lowercased().firstLetterCapitalized(), + preferredLanguages: locale.rLanguages + ) + + let subtitle = status.map { ReferendumTimelineView.StatusSubtitle.interval($0.viewModel) } + + return .init( + title: title, + subtitle: subtitle, + isLast: false + ) + } + + private func createDeciding( + model: ReferendumStateLocal.Deciding, + referendum: ReferendumLocal, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumTimelineView.Model { + let status = statusViewModelFactory.createTimeViewModel( + for: referendum, + currentBlock: currentBlock, + blockDuration: blockTime, + locale: locale + ) + + let isPassing: Bool + switch model.voting { + case let .supportAndVotes(votingModel): + isPassing = votingModel.isPassing(at: currentBlock) + case let .threshold(votingModel): + isPassing = votingModel.isPassing() + } + + let votingTitle = isPassing ? + R.string.localizable.governanceReferendumsStatusPassing(preferredLanguages: locale.rLanguages) : + R.string.localizable.governanceReferendumsStatusNotPassing(preferredLanguages: locale.rLanguages) + + let title = R.string.localizable.govTimelineVotingFormat( + votingTitle.lowercased().firstLetterCapitalized(), + preferredLanguages: locale.rLanguages + ) + + let subtitle = status.map { ReferendumTimelineView.StatusSubtitle.interval($0.viewModel) } + + return .init( + title: title, + subtitle: subtitle, + isLast: false + ) + } + + private func createApprovedTitle(for locale: Locale) -> String { + let votingTitle = R.string.localizable.governanceReferendumsStatusApproved( + preferredLanguages: locale.rLanguages + ) + + return R.string.localizable.govTimelineVotedFormat( + votingTitle.lowercased().firstLetterCapitalized(), + preferredLanguages: locale.rLanguages + ) + } + + private func createApproved( + atBlock: BlockNumber?, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumTimelineView.Model { + let title = createApprovedTitle(for: locale) + + return makeTimeViewModel( + title: title, + atBlock: atBlock, + currentBlock: currentBlock, + blockTime: blockTime, + locale: locale + ) + } + + private func createApproved( + referendum: ReferendumLocal, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumTimelineView.Model { + let status = statusViewModelFactory.createTimeViewModel( + for: referendum, + currentBlock: currentBlock, + blockDuration: blockTime, + locale: locale + ) + + let title = createApprovedTitle(for: locale) + + let subtitle = status.map { ReferendumTimelineView.StatusSubtitle.interval($0.viewModel) } + + return .init( + title: title, + subtitle: subtitle, + isLast: false + ) + } + + private func createVotedTerminal( + status: String, + atBlock: BlockNumber, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> ReferendumTimelineView.Model { + let date = createPreviousTime( + atBlock: atBlock, + currentBlock: currentBlock, + blockTime: blockTime, + locale: locale + ) + + let title = R.string.localizable.govTimelineVotedFormat( + status.lowercased().firstLetterCapitalized(), + preferredLanguages: locale.rLanguages + ) + + let subtitle = date.map { ReferendumTimelineView.StatusSubtitle.date($0) } + + return .init(title: title, subtitle: subtitle, isLast: true) + } + + private func createExecutedViewModels( + metadata: ReferendumMetadataLocal?, + currentBlock: BlockNumber, + blockTime: BlockTime, + locale: Locale + ) -> [ReferendumTimelineView.Model] { + let approvedBlock = metadata?.timeline?.first( + where: { $0.status == ReferendumMetadataStatus.passed.rawValue } + )?.block + + let approved = createApproved( + atBlock: approvedBlock, + currentBlock: currentBlock, + blockTime: blockTime, + locale: locale + ) + + let executedBlock = metadata?.timeline?.first( + where: { $0.status == ReferendumMetadataStatus.executed.rawValue } + )?.block + + let executedTitle = R.string.localizable.governanceReferendumsStatusExecuted( + preferredLanguages: locale.rLanguages + ).firstLetterCapitalized() + + let executed = makeTimeViewModel( + title: executedTitle, + atBlock: executedBlock, + currentBlock: currentBlock, + blockTime: blockTime, + locale: locale, + isLast: true + ) + + return [approved, executed] + } +} + +extension ReferendumTimelineViewModelFactory: ReferendumTimelineViewModelFactoryProtocol { + // swiftlint:disable:next function_body_length + func createTimelineViewModel( + for referendum: ReferendumLocal, + metadata: ReferendumMetadataLocal?, + currentBlock: BlockNumber, + blockDuration: UInt64, + locale: Locale + ) -> [ReferendumTimelineView.Model]? { + var createdAt: BlockNumber? + + let models: [ReferendumTimelineView.Model] + + switch referendum.state { + case let .preparing(model): + createdAt = model.since + + let preparing = createPreparing( + model: model, + referendum: referendum, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + + models = [preparing] + case let .deciding(model): + createdAt = model.submitted + + let deciding = createDeciding( + model: model, + referendum: referendum, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + + models = [deciding] + case .approved: + let approved = createApproved( + referendum: referendum, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + + models = [approved] + case let .rejected(model): + let rejected = createVotedTerminal( + status: R.string.localizable.governanceReferendumsStatusRejected(preferredLanguages: locale.rLanguages), + atBlock: model.atBlock, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + + models = [rejected] + case let .cancelled(model): + let cancelled = createVotedTerminal( + status: R.string.localizable.governanceReferendumsStatusCancelled( + preferredLanguages: locale.rLanguages + ), + atBlock: model.atBlock, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + + models = [cancelled] + case let .killed(atBlock): + let killed = createVotedTerminal( + status: R.string.localizable.governanceReferendumsStatusKilled(preferredLanguages: locale.rLanguages), + atBlock: atBlock, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + + models = [killed] + case let .timedOut(model): + let timedOut = createVotedTerminal( + status: R.string.localizable.governanceReferendumsStatusTimedOut(preferredLanguages: locale.rLanguages), + atBlock: model.atBlock, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + + models = [timedOut] + case .executed: + models = createExecutedViewModels( + metadata: metadata, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + } + + if createdAt == nil { + createdAt = metadata?.timeline?.first( + where: { $0.status == ReferendumMetadataStatus.started.rawValue } + )?.block + } + + let created = makeCreatedViewModel( + atBlock: createdAt, + currentBlock: currentBlock, + blockTime: blockDuration, + locale: locale + ) + + return [created] + models + } +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumTrackType.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumTrackType.swift new file mode 100644 index 0000000000..0f5a83b741 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumTrackType.swift @@ -0,0 +1,90 @@ +import Foundation +import UIKit + +enum ReferendumTrackType: String, CaseIterable, Equatable { + case root + case whiteListedCaller = "whitelisted_caller" + case stakingAdmin = "staking_admin" + case treasurer + case leaseAdmin = "lease_admin" + case fellowshipAdmin = "fellowship_admin" + case generalAdmin = "general_admin" + case auctionAdmin = "auction_admin" + case referendumCanceller = "referendum_canceller" + case referendumKiller = "referendum_killer" + case smallTipper = "small_tipper" + case bigTipper = "big_tipper" + case smallSpender = "small_spender" + case mediumSpender = "medium_spender" + case bigSpender = "big_spender" + + var priority: UInt { + let index = Self.allCases.firstIndex(of: self) + return UInt(index ?? 0) + } + + // swiftlint:disable:next cyclomatic_complexity + func title(for locale: Locale) -> String? { + switch self { + case .root: + return R.string.localizable.govTrackRoot(preferredLanguages: locale.rLanguages) + case .whiteListedCaller: + return R.string.localizable.govTrackWhitelistedCaller(preferredLanguages: locale.rLanguages) + case .stakingAdmin: + return R.string.localizable.govTrackStakingAdmin(preferredLanguages: locale.rLanguages) + case .treasurer: + return R.string.localizable.govTrackTreasurer(preferredLanguages: locale.rLanguages) + case .leaseAdmin: + return R.string.localizable.govTrackLeaseAdmin(preferredLanguages: locale.rLanguages) + case .fellowshipAdmin: + return R.string.localizable.govTrackFellowshipAdmin(preferredLanguages: locale.rLanguages) + case .generalAdmin: + return R.string.localizable.govTrackGeneralAdmin(preferredLanguages: locale.rLanguages) + case .auctionAdmin: + return R.string.localizable.govTrackAuctionAdmin(preferredLanguages: locale.rLanguages) + case .referendumCanceller: + return R.string.localizable.govTrackReferendumCanceller(preferredLanguages: locale.rLanguages) + case .referendumKiller: + return R.string.localizable.govTrackReferendumKiller(preferredLanguages: locale.rLanguages) + case .smallTipper: + return R.string.localizable.govTrackSmallTipper(preferredLanguages: locale.rLanguages) + case .bigTipper: + return R.string.localizable.govTrackBigTipper(preferredLanguages: locale.rLanguages) + case .smallSpender: + return R.string.localizable.govTrackSmallSpender(preferredLanguages: locale.rLanguages) + case .mediumSpender: + return R.string.localizable.govTrackMediumSpender(preferredLanguages: locale.rLanguages) + case .bigSpender: + return R.string.localizable.govTrackBigSpender(preferredLanguages: locale.rLanguages) + } + } + + func imageViewModel(for chain: ChainModel) -> ImageViewModelProtocol? { + switch self { + case .root: + return RemoteImageViewModel(url: chain.utilityAsset()?.icon ?? chain.icon) + case .whiteListedCaller, .fellowshipAdmin: + return StaticImageViewModel(image: R.image.iconGovFellowship()!) + case .auctionAdmin: + return StaticImageViewModel(image: R.image.iconGovCrowdloan()!) + case .stakingAdmin: + return StaticImageViewModel(image: R.image.iconGovStaking()!) + case .leaseAdmin, .generalAdmin, .referendumCanceller, .referendumKiller: + return StaticImageViewModel(image: R.image.iconGovGovernance()!) + case .treasurer, .smallTipper, .bigTipper, .smallSpender, .mediumSpender, .bigSpender: + return StaticImageViewModel(image: R.image.iconGovTreasury()!) + } + } + + static func createViewModel( + from rawName: String, + chain: ChainModel, + locale: Locale + ) -> ReferendumInfoView.Track { + let type = ReferendumTrackType(rawValue: rawName) + let title = type?.title(for: locale)?.uppercased() ?? rawName.replacingSnakeCase().uppercased() + let icon = type?.imageViewModel(for: chain) + + return .init(title: title, icon: icon) + } +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumVotesViewModel.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumVotesViewModel.swift new file mode 100644 index 0000000000..6bda8649ae --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumVotesViewModel.swift @@ -0,0 +1,6 @@ +import Foundation + +struct ReferendumVotesViewModel { + let ayes: VoteRowView.Model? + let nays: VoteRowView.Model? +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsModelFactory.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsModelFactory.swift new file mode 100644 index 0000000000..f0192fb5f6 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsModelFactory.swift @@ -0,0 +1,598 @@ +import Foundation +import SoraFoundation +import BigInt + +struct ReferendumsModelFactoryInput { + let referendums: [ReferendumLocal] + let metadataMapping: [ReferendumIdLocal: ReferendumMetadataLocal]? + let votes: [ReferendumIdLocal: ReferendumAccountVoteLocal] + let chainInfo: ChainInformation + let locale: Locale + + struct ChainInformation { + let chain: ChainModel + let currentBlock: BlockNumber + let blockDuration: UInt64 + } +} + +protocol ReferendumsModelFactoryProtocol { + func createSections(input: ReferendumsModelFactoryInput) -> [ReferendumsSection] + + func createViewModel( + from referendum: ReferendumLocal, + metadata: ReferendumMetadataLocal?, + vote: ReferendumAccountVoteLocal?, + chainInfo: ReferendumsModelFactoryInput.ChainInformation, + selectedLocale: Locale + ) -> ReferendumView.Model + + func createLoadingViewModel() -> [ReferendumsSection] +} + +final class ReferendumsModelFactory { + private typealias Input = ReferendumsModelFactoryInput + private typealias Strings = R.string.localizable + + private struct StatusParams { + let referendum: ReferendumLocal + let metadata: ReferendumMetadataLocal? + let chainInfo: Input.ChainInformation + let votes: ReferendumAccountVoteLocal? + } + + let assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol + let localizedPercentFormatter: LocalizableResource + let localizedIndexFormatter: LocalizableResource + let localizedQuantityFormatter: LocalizableResource + let statusViewModelFactory: ReferendumStatusViewModelFactoryProtocol + let referendumMetadataViewModelFactory: ReferendumMetadataViewModelFactoryProtocol + + init( + referendumMetadataViewModelFactory: ReferendumMetadataViewModelFactoryProtocol, + statusViewModelFactory: ReferendumStatusViewModelFactoryProtocol, + assetBalanceFormatterFactory: AssetBalanceFormatterFactoryProtocol, + percentFormatter: LocalizableResource, + indexFormatter: LocalizableResource, + quantityFormatter: LocalizableResource + ) { + self.referendumMetadataViewModelFactory = referendumMetadataViewModelFactory + self.statusViewModelFactory = statusViewModelFactory + self.assetBalanceFormatterFactory = assetBalanceFormatterFactory + localizedPercentFormatter = percentFormatter + localizedIndexFormatter = indexFormatter + localizedQuantityFormatter = quantityFormatter + } + + private func provideCommonReferendumCellViewModel( + status: ReferendumInfoView.Status, + params: StatusParams, + locale: Locale + ) -> ReferendumView.Model { + let yourVotesModel = createVotesViewModel( + votes: params.votes, + chainAsset: params.chainInfo.chain.utilityAsset(), + locale: locale + ) + + let referendumNumber = localizedIndexFormatter.value(for: locale).string( + from: NSNumber(value: params.referendum.index) + ) + + let referendumTitle = referendumMetadataViewModelFactory.createTitle( + for: params.referendum, + metadata: params.metadata, + locale: locale + ) + + return .init( + referendumInfo: .init( + status: status, + time: nil, + title: referendumTitle, + track: nil, + referendumNumber: referendumNumber + ), + progress: nil, + yourVotes: yourVotesModel + ) + } + + private func createInQueueFormatting( + for position: ReferendumStateLocal.InQueuePosition?, + locale: Locale + ) -> String { + if let position = position { + let formatter = localizedQuantityFormatter.value(for: locale) + let positionString = formatter.string(from: (position.index + 1) as NSNumber) ?? "" + let totalString = formatter.string(from: position.total as NSNumber) ?? "" + + let queueString = R.string.localizable.govInQueueCounter( + positionString, + totalString, + preferredLanguages: locale.rLanguages + ) + + let prefixTitle = R.string.localizable.governanceReferendumsStatusPreparingInqueue( + preferredLanguages: locale.rLanguages + ) + + return prefixTitle + " " + queueString + } else { + return R.string.localizable.governanceReferendumsStatusPreparingInqueue( + preferredLanguages: locale.rLanguages + ) + } + } + + private func createPreparingStatus(for model: ReferendumStateLocal.Preparing, locale: Locale) -> String { + if model.inQueue { + return createInQueueFormatting(for: model.inQueuePosition, locale: locale) + } else if model.deposit == nil { + return Strings.governanceReferendumsTimeWaitingDeposit(preferredLanguages: locale.rLanguages) + } else { + return Strings.governanceReferendumsStatusPreparing(preferredLanguages: locale.rLanguages) + } + } + + private func providePreparingReferendumCellViewModel( + _ model: ReferendumStateLocal.Preparing, + params: StatusParams, + locale: Locale + ) -> ReferendumView.Model { + let timeModel = statusViewModelFactory.createTimeViewModel( + for: params.referendum, + currentBlock: params.chainInfo.currentBlock, + blockDuration: params.chainInfo.blockDuration, + locale: locale + ) + + let title = createPreparingStatus(for: model, locale: locale) + + let votingProgressViewModel: VotingProgressView.Model + + switch model.voting { + case let .supportAndVotes(supportAndVotes): + votingProgressViewModel = createGov2VotingProgressViewModel( + supportAndVotes: supportAndVotes, + chain: params.chainInfo.chain, + currentBlock: params.chainInfo.currentBlock, + locale: locale + ) + case let .threshold(threshold): + votingProgressViewModel = createGov1VotingProgressViewModel(votingThreshold: threshold, locale: locale) + } + + let yourVotesModel = createVotesViewModel( + votes: params.votes, + chainAsset: params.chainInfo.chain.utilityAsset(), + locale: locale + ) + + let track = createTrackViewModel(from: model.track, params: params, locale: locale) + + let referendumNumber = localizedIndexFormatter.value(for: locale).string( + from: NSNumber(value: params.referendum.index) + ) + + let referendumTitle = referendumMetadataViewModelFactory.createTitle( + for: params.referendum, + metadata: params.metadata, + locale: locale + ) + + return .init( + referendumInfo: .init( + status: .init(name: title.uppercased(), kind: .neutral), + time: timeModel?.viewModel, + title: referendumTitle, + track: track, + referendumNumber: referendumNumber + ), + progress: votingProgressViewModel, + yourVotes: yourVotesModel + ) + } + + private func createVotesViewModel( + votes: ReferendumAccountVoteLocal?, + chainAsset: AssetModel?, + locale: Locale + ) -> YourVotesView.Model? { + guard let votes = votes, let chainAsset = chainAsset else { + return nil + } + + let inputFormatter = assetBalanceFormatterFactory.createInputFormatter(for: chainAsset.displayInfo) + + let formatVotes: (BigUInt) -> String = { votesInPlank in + guard let votes = Decimal.fromSubstrateAmount( + votesInPlank, + precision: Int16(chainAsset.precision) + ) else { + return "" + } + let votesString = inputFormatter.value(for: locale).stringFromDecimal(votes) ?? "" + return Strings.governanceReferendumsYourVote( + votesString, + preferredLanguages: locale.rLanguages + ) + } + let ayesModel = votes.hasAyeVotes ? YourVoteView.Model( + title: Strings.governanceAye(preferredLanguages: locale.rLanguages).uppercased(), + description: formatVotes(votes.ayes), + style: .aye + ) : nil + let naysModel = votes.hasNayVotes ? YourVoteView.Model( + title: Strings.governanceNay(preferredLanguages: locale.rLanguages).uppercased(), + description: formatVotes(votes.nays), + style: .nay + ) : nil + return .init( + aye: ayesModel, + nay: naysModel + ) + } + + private func createTrackViewModel( + from track: GovernanceTrackLocal, + params: StatusParams, + locale: Locale + ) -> ReferendumInfoView.Track? { + // display track name if more than 1 track in the network + guard track.totalTracksCount > 1 else { + return nil + } + + return ReferendumTrackType.createViewModel(from: track.name, chain: params.chainInfo.chain, locale: locale) + } + + private func provideDecidingReferendumCellViewModel( + _ model: ReferendumStateLocal.Deciding, + params: StatusParams, + locale: Locale + ) -> ReferendumView.Model { + let votingProgressViewModel: VotingProgressView.Model + let isPassing: Bool + + switch model.voting { + case let .supportAndVotes(supportAndVotes): + votingProgressViewModel = createGov2VotingProgressViewModel( + supportAndVotes: supportAndVotes, + chain: params.chainInfo.chain, + currentBlock: params.chainInfo.currentBlock, + locale: locale + ) + + isPassing = supportAndVotes.isPassing(at: params.chainInfo.currentBlock) + case let .threshold(threshold): + votingProgressViewModel = createGov1VotingProgressViewModel(votingThreshold: threshold, locale: locale) + + isPassing = threshold.isPassing() + } + + let timeModel = statusViewModelFactory.createTimeViewModel( + for: params.referendum, + currentBlock: params.chainInfo.currentBlock, + blockDuration: params.chainInfo.blockDuration, + locale: locale + ) + + let statusName = isPassing ? + Strings.governanceReferendumsStatusPassing(preferredLanguages: locale.rLanguages) : + Strings.governanceReferendumsStatusNotPassing(preferredLanguages: locale.rLanguages) + + let statusKind: ReferendumInfoView.StatusKind = isPassing ? .positive : .negative + let yourVotesModel = createVotesViewModel( + votes: params.votes, + chainAsset: params.chainInfo.chain.utilityAsset(), + locale: locale + ) + + let track = createTrackViewModel(from: model.track, params: params, locale: locale) + + let indexFormatter = localizedIndexFormatter.value(for: locale) + let referendumNumber = indexFormatter.string(from: NSNumber(value: params.referendum.index)) + + let referendumTitle = referendumMetadataViewModelFactory.createTitle( + for: params.referendum, + metadata: params.metadata, + locale: locale + ) + + return .init( + referendumInfo: .init( + status: .init(name: statusName.uppercased(), kind: statusKind), + time: timeModel?.viewModel, + title: referendumTitle, + track: track, + referendumNumber: referendumNumber + ), + progress: votingProgressViewModel, + yourVotes: yourVotesModel + ) + } + + private func provideApprovedReferendumCellViewModel( + params: StatusParams, + locale: Locale + ) -> ReferendumView.Model { + let timeModel = statusViewModelFactory.createTimeViewModel( + for: params.referendum, + currentBlock: params.chainInfo.currentBlock, + blockDuration: params.chainInfo.blockDuration, + locale: locale + ) + + let title = Strings.governanceReferendumsStatusApproved(preferredLanguages: locale.rLanguages) + + let yourVotesModel = createVotesViewModel( + votes: params.votes, + chainAsset: params.chainInfo.chain.utilityAsset(), + locale: locale + ) + + let referendumNumber = localizedIndexFormatter.value(for: locale).string( + from: NSNumber(value: params.referendum.index) + ) + + let referendumTitle = referendumMetadataViewModelFactory.createTitle( + for: params.referendum, + metadata: params.metadata, + locale: locale + ) + + return .init( + referendumInfo: .init( + status: .init(name: title.uppercased(), kind: .positive), + time: timeModel?.viewModel, + title: referendumTitle, + track: nil, + referendumNumber: referendumNumber + ), + progress: nil, + yourVotes: yourVotesModel + ) + } + + private func createVotingSupportProgressViewModel( + supportAndVotes: SupportAndVotesLocal, + chain: ChainModel, + currentBlock: BlockNumber, + locale: Locale + ) -> VotingProgressView.SupportModel? { + guard + let chainAsset = chain.utilityAsset(), + let supportThreshold = supportAndVotes.supportFunction?.calculateThreshold(for: currentBlock) else { + return nil + } + + let totalIssuanceDecimal = Decimal.fromSubstrateAmount( + supportAndVotes.totalIssuance, + precision: Int16(chainAsset.precision) + ) ?? 0 + + let targetThreshold = totalIssuanceDecimal * supportThreshold + + let threshold = Decimal.fromSubstrateAmount( + supportAndVotes.support, + precision: Int16(chainAsset.precision) + ) + let isCompleted = supportAndVotes.supportFraction >= supportThreshold + + let image = isCompleted ? + R.image.iconCheckmark()?.tinted(with: R.color.colorGreen15CF37()!) : + R.image.iconClose()?.tinted(with: R.color.colorRedFF3A69()!) + + let tokenFormatter = assetBalanceFormatterFactory.createTokenFormatter(for: chainAsset.displayInfo) + let amountFormatter = assetBalanceFormatterFactory.createDisplayFormatter(for: chainAsset.displayInfo) + + let targetThresholdString = tokenFormatter.value(for: locale).stringFromDecimal(targetThreshold) ?? "" + + let thresholdString = threshold.map { + amountFormatter.value(for: locale).stringFromDecimal($0) ?? "" + } ?? "" + + let text = R.string.localizable.governanceReferendumsThreshold( + thresholdString, + targetThresholdString, + preferredLanguages: locale.rLanguages + ) + + let titleIcon = TitleIconViewModel(title: text, icon: image) + + return .init(titleIcon: titleIcon, completed: isCompleted) + } + + private func createVotingApprovalProgressViewModel( + supportAndVotes: SupportAndVotesLocal, + currentBlock: BlockNumber, + locale: Locale + ) -> VotingProgressView.ApprovalModel { + let ayeProgressString: String + let nayProgressString: String + + let percentFormatter = localizedPercentFormatter.value(for: locale) + + if let approvalFraction = supportAndVotes.approvalFraction { + ayeProgressString = percentFormatter.stringFromDecimal(approvalFraction) ?? "" + nayProgressString = percentFormatter.stringFromDecimal(1 - approvalFraction) ?? "" + } else { + ayeProgressString = percentFormatter.stringFromDecimal(0) ?? "" + nayProgressString = percentFormatter.stringFromDecimal(0) ?? "" + } + + let passThreshold = supportAndVotes.approvalFunction?.calculateThreshold(for: currentBlock) ?? 0 + let passThresholdString = percentFormatter.stringFromDecimal(passThreshold) ?? "" + + return .init( + passThreshold: passThreshold, + ayeProgress: supportAndVotes.approvalFraction, + ayeMessage: Strings.governanceAyesFormat(ayeProgressString, preferredLanguages: locale.rLanguages), + passMessage: Strings.governanceToPassFormat(passThresholdString, preferredLanguages: locale.rLanguages), + nayMessage: Strings.governanceNaysFormat(nayProgressString, preferredLanguages: locale.rLanguages) + ) + } + + private func createVotingThresholdProgressViewModel( + for votingThreshold: VotingThresholdLocal, + locale: Locale + ) -> VotingProgressView.ApprovalModel { + let ayeProgressString: String + let nayProgressString: String + + let percentFormatter = localizedPercentFormatter.value(for: locale) + + if let approvalFraction = votingThreshold.approvalFraction { + ayeProgressString = percentFormatter.stringFromDecimal(approvalFraction) ?? "" + nayProgressString = percentFormatter.stringFromDecimal(1 - approvalFraction) ?? "" + } else { + ayeProgressString = percentFormatter.stringFromDecimal(0) ?? "" + nayProgressString = percentFormatter.stringFromDecimal(0) ?? "" + } + + let passThreshold = votingThreshold.calculateThreshold() ?? 0 + let passThresholdString = percentFormatter.stringFromDecimal(passThreshold) ?? "" + + return .init( + passThreshold: passThreshold, + ayeProgress: votingThreshold.approvalFraction, + ayeMessage: Strings.governanceAyesFormat(ayeProgressString, preferredLanguages: locale.rLanguages), + passMessage: Strings.governanceToPassFormat(passThresholdString, preferredLanguages: locale.rLanguages), + nayMessage: Strings.governanceNaysFormat(nayProgressString, preferredLanguages: locale.rLanguages) + ) + } + + private func createGov2VotingProgressViewModel( + supportAndVotes: SupportAndVotesLocal, + chain: ChainModel, + currentBlock: BlockNumber, + locale: Locale + ) -> VotingProgressView.Model { + let supportModel = createVotingSupportProgressViewModel( + supportAndVotes: supportAndVotes, + chain: chain, + currentBlock: currentBlock, + locale: locale + ) + + let approvalModel = createVotingApprovalProgressViewModel( + supportAndVotes: supportAndVotes, + currentBlock: currentBlock, + locale: locale + ) + + return .init(support: supportModel, approval: approvalModel) + } + + private func createGov1VotingProgressViewModel( + votingThreshold: VotingThresholdLocal, + locale: Locale + ) -> VotingProgressView.Model { + let thresholdViewModel = createVotingThresholdProgressViewModel(for: votingThreshold, locale: locale) + + return .init(support: nil, approval: thresholdViewModel) + } +} + +extension ReferendumsModelFactory: ReferendumsModelFactoryProtocol { + func createLoadingViewModel() -> [ReferendumsSection] { + let cells: [ReferendumsCellViewModel] = (0 ..< 10).map { + ReferendumsCellViewModel( + referendumIndex: UInt($0), + viewModel: .loading + ) + } + return [ReferendumsSection.active(.loading, cells)] + } + + func createSections(input: ReferendumsModelFactoryInput) -> [ReferendumsSection] { + var active: [ReferendumsCellViewModel] = [] + var completed: [ReferendumsCellViewModel] = [] + + input.referendums.forEach { referendum in + let metadata = input.metadataMapping?[referendum.index] + + let params = StatusParams( + referendum: referendum, + metadata: metadata, + chainInfo: input.chainInfo, + votes: input.votes[referendum.index] + ) + + let model = createReferendumCellViewModel( + state: referendum.state, + params: params, + locale: input.locale + ) + + let viewModel = ReferendumsCellViewModel( + referendumIndex: referendum.index, + viewModel: .loaded(value: model) + ) + + referendum.state.completed ? completed.append(viewModel) : active.append(viewModel) + } + var sections: [ReferendumsSection] = [] + if !active.isEmpty || completed.isEmpty { + // still add empty section to display empty state + let title = Strings.governanceReferendumsActive(preferredLanguages: input.locale.rLanguages) + sections.append(.active(.loaded(value: title), active)) + } + if !completed.isEmpty { + let title = Strings.commonCompleted(preferredLanguages: input.locale.rLanguages) + sections.append(.completed(.loaded(value: title), completed)) + } + return sections + } + + func createViewModel( + from referendum: ReferendumLocal, + metadata: ReferendumMetadataLocal?, + vote: ReferendumAccountVoteLocal?, + chainInfo: ReferendumsModelFactoryInput.ChainInformation, + selectedLocale: Locale + ) -> ReferendumView.Model { + let params = StatusParams( + referendum: referendum, + metadata: metadata, + chainInfo: chainInfo, + votes: vote + ) + + return createReferendumCellViewModel(state: referendum.state, params: params, locale: selectedLocale) + } + + private func createReferendumCellViewModel( + state: ReferendumStateLocal, + params: StatusParams, + locale: Locale + ) -> ReferendumView.Model { + let status: ReferendumInfoView.Status + switch state { + case let .preparing(model): + return providePreparingReferendumCellViewModel(model, params: params, locale: locale) + case let .deciding(model): + return provideDecidingReferendumCellViewModel(model, params: params, locale: locale) + case .approved: + return provideApprovedReferendumCellViewModel(params: params, locale: locale) + case .rejected: + let statusName = Strings.governanceReferendumsStatusRejected(preferredLanguages: locale.rLanguages) + status = .init(name: statusName.uppercased(), kind: .negative) + case .cancelled: + let statusName = Strings.governanceReferendumsStatusCancelled(preferredLanguages: locale.rLanguages) + status = .init(name: statusName.uppercased(), kind: .neutral) + case .timedOut: + let statusName = Strings.governanceReferendumsStatusTimedOut(preferredLanguages: locale.rLanguages) + status = .init(name: statusName.uppercased(), kind: .neutral) + case .killed: + let statusName = Strings.governanceReferendumsStatusKilled(preferredLanguages: locale.rLanguages) + status = .init(name: statusName.uppercased(), kind: .negative) + case .executed: + let statusName = Strings.governanceReferendumsStatusExecuted(preferredLanguages: locale.rLanguages) + status = .init(name: statusName.uppercased(), kind: .positive) + } + + return provideCommonReferendumCellViewModel(status: status, params: params, locale: locale) + } +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsUnlocksViewModel.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsUnlocksViewModel.swift new file mode 100644 index 0000000000..bb7feb1e0f --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsUnlocksViewModel.swift @@ -0,0 +1,6 @@ +import Foundation + +struct ReferendumsUnlocksViewModel { + let totalLock: String? + let hasUnlock: Bool +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsViewModel.swift b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsViewModel.swift new file mode 100644 index 0000000000..9a09339671 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/ReferendumsViewModel.swift @@ -0,0 +1,22 @@ +struct ReferendumsViewModel { + let sections: [ReferendumsSection] +} + +enum ReferendumsSection { + case active(LoadableViewModelState, [ReferendumsCellViewModel]) + case completed(LoadableViewModelState, [ReferendumsCellViewModel]) + + var isEmpty: Bool { + switch self { + case let .active(_, array): + return array.isEmpty + case let .completed(_, array): + return array.isEmpty + } + } +} + +struct ReferendumsCellViewModel { + var referendumIndex: UInt + var viewModel: LoadableViewModelState +} diff --git a/novawallet/Modules/Vote/Governance/ViewModel/StatusTimeViewModel.swift b/novawallet/Modules/Vote/Governance/ViewModel/StatusTimeViewModel.swift new file mode 100644 index 0000000000..5eafadd5f4 --- /dev/null +++ b/novawallet/Modules/Vote/Governance/ViewModel/StatusTimeViewModel.swift @@ -0,0 +1,7 @@ +import Foundation + +struct StatusTimeViewModel { + let viewModel: ReferendumInfoView.Time + let timeInterval: TimeInterval? + let updateModelClosure: (TimeInterval) -> ReferendumInfoView.Time? +} diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/View/SkeletonableView.swift b/novawallet/Modules/Vote/Parent/View/SkeletonableView.swift similarity index 75% rename from novawallet/Modules/Crowdloan/CrowdloanList/View/SkeletonableView.swift rename to novawallet/Modules/Vote/Parent/View/SkeletonableView.swift index b004eb17ab..46663cf3d3 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/View/SkeletonableView.swift +++ b/novawallet/Modules/Vote/Parent/View/SkeletonableView.swift @@ -1,7 +1,14 @@ import UIKit import SoraUI +struct SkeletonableViewReplica { + let count: UInt32 + let spacing: CGFloat +} + protocol SkeletonableView: UIView { + var skeletonSpaceSize: CGSize { get } + var skeletonReplica: SkeletonableViewReplica { get } var skeletonView: SkrullableView? { get set } var skeletonSuperview: UIView { get } var hidingViews: [UIView] { get } @@ -17,6 +24,8 @@ protocol SkeletonableViewCell { extension SkeletonableView { func startLoadingIfNeeded() { + hidingViews.forEach { $0.alpha = 0 } + guard skeletonView == nil else { return } @@ -29,6 +38,8 @@ extension SkeletonableView { } func stopLoadingIfNeeded() { + hidingViews.forEach { $0.alpha = 1 } + guard skeletonView != nil else { return } @@ -36,23 +47,34 @@ extension SkeletonableView { skeletonView?.stopSkrulling() skeletonView?.removeFromSuperview() skeletonView = nil + } - hidingViews.forEach { $0.alpha = 1 } + var skeletonSpaceSize: CGSize { frame.size } + + var skeletonReplica: SkeletonableViewReplica { SkeletonableViewReplica(count: 1, spacing: 0) } + + func updateLoadingState() { + setupSkeleton() } private func setupSkeleton() { - let spaceSize = frame.size + let spaceSize = skeletonSpaceSize guard spaceSize.width > 0, spaceSize.height > 0 else { return } - let builder = Skrull( + var builder = Skrull( size: spaceSize, decorations: [], skeletons: createSkeletons(for: spaceSize) ) + let replica = skeletonReplica + if replica.count > 1 { + builder = builder.replicateVertically(count: replica.count, spacing: replica.spacing) + } + let currentSkeletonView: SkrullableView? if let skeletonView = skeletonView { diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanStatusSectionView.swift b/novawallet/Modules/Vote/Parent/View/VoteStatusSectionView.swift similarity index 94% rename from novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanStatusSectionView.swift rename to novawallet/Modules/Vote/Parent/View/VoteStatusSectionView.swift index f95b4975ae..84c5e62e5f 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanStatusSectionView.swift +++ b/novawallet/Modules/Vote/Parent/View/VoteStatusSectionView.swift @@ -1,7 +1,7 @@ import UIKit import SoraUI -final class CrowdloanStatusSectionView: UITableViewHeaderFooterView { +final class VoteStatusSectionView: UITableViewHeaderFooterView { var skeletonView: SkrullableView? private var viewModel: LoadableViewModelState? @@ -45,7 +45,7 @@ final class CrowdloanStatusSectionView: UITableViewHeaderFooterView { } } -extension CrowdloanStatusSectionView { +extension VoteStatusSectionView { struct Model { let title: String let count: Int @@ -64,7 +64,7 @@ extension CrowdloanStatusSectionView { } // swiftlint:disable nesting -extension CrowdloanStatusSectionView { +extension VoteStatusSectionView { private enum Constants { enum TitleLabelInsets { static let top: CGFloat = 24 @@ -81,7 +81,7 @@ extension CrowdloanStatusSectionView { // swiftlint:enable nesting -extension CrowdloanStatusSectionView: SkeletonableView { +extension VoteStatusSectionView: SkeletonableView { var skeletonSuperview: UIView { self } diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanTableHeaderView.swift b/novawallet/Modules/Vote/Parent/View/VoteTableHeaderView.swift similarity index 54% rename from novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanTableHeaderView.swift rename to novawallet/Modules/Vote/Parent/View/VoteTableHeaderView.swift index 0acf8964f9..f1090d562c 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/View/CrowdloanTableHeaderView.swift +++ b/novawallet/Modules/Vote/Parent/View/VoteTableHeaderView.swift @@ -1,6 +1,7 @@ import UIKit +import SoraUI -final class CrowdloanTableHeaderView: UIView { +final class VoteTableHeaderView: UIView { let titleLabel: UILabel = { let label = UILabel() label.textColor = R.color.colorWhite() @@ -10,18 +11,39 @@ final class CrowdloanTableHeaderView: UIView { let walletSwitch = WalletSwitchControl() + let votingTypeSwitch: RoundedSegmentedControl = .create { view in + view.backgroundView.fillColor = R.color.colorBlack48()! + view.selectionColor = R.color.colorWhite16()! + view.titleFont = .regularFootnote + view.selectedTitleColor = R.color.colorWhite()! + view.titleColor = R.color.colorTransparentText()! + } + let chainSelectionView: DetailsTriangularedView = { let view = UIFactory.default.createChainAssetSelectionView() + view.borderWidth = 0.0 + view.actionImage = R.image.iconMore()?.withRenderingMode(.alwaysTemplate) + view.actionView.tintColor = R.color.colorWhite48() return view }() - private var viewModel: CrowdloansChainViewModel? + var locale = Locale.current { + didSet { + if locale != oldValue { + setupLocalization() + } + } + } + + private var viewModel: ChainBalanceViewModel? override init(frame: CGRect) { super.init(frame: frame) backgroundColor = .clear + setupLayout() + setupLocalization() } @available(*, unavailable) @@ -29,23 +51,6 @@ final class CrowdloanTableHeaderView: UIView { fatalError("init(coder:) has not been implemented") } - func bind(viewModel: CrowdloansChainViewModel) { - self.viewModel?.imageViewModel?.cancel(on: chainSelectionView.iconView) - chainSelectionView.iconView.image = nil - - self.viewModel = viewModel - - chainSelectionView.title = viewModel.networkName - chainSelectionView.subtitle = viewModel.balance - - let iconSize = 2 * chainSelectionView.iconRadius - viewModel.imageViewModel?.loadImage( - on: chainSelectionView.iconView, - targetSize: CGSize(width: iconSize, height: iconSize), - animated: true - ) - } - private func setupLayout() { addSubview(walletSwitch) walletSwitch.snp.makeConstraints { make in @@ -61,10 +66,17 @@ final class CrowdloanTableHeaderView: UIView { make.centerY.equalTo(walletSwitch) } + addSubview(votingTypeSwitch) + votingTypeSwitch.snp.makeConstraints { make in + make.top.equalTo(walletSwitch.snp.bottom).offset(16) + make.leading.trailing.equalToSuperview().inset(16) + make.height.equalTo(40.0) + } + let chainBlur = TriangularedBlurView() addSubview(chainBlur) chainBlur.snp.makeConstraints { make in - make.top.equalTo(walletSwitch.snp.bottom).offset(16) + make.top.equalTo(votingTypeSwitch.snp.bottom).offset(8) make.leading.trailing.equalToSuperview().inset(16) make.bottom.equalToSuperview().inset(8) } @@ -75,4 +87,36 @@ final class CrowdloanTableHeaderView: UIView { make.height.equalTo(52.0) } } + + private func setupLocalization() { + let languages = locale.rLanguages + + titleLabel.text = R.string.localizable.tabbarVoteTitle(preferredLanguages: languages) + + votingTypeSwitch.titles = [ + R.string.localizable.tabbarGovernanceTitle(preferredLanguages: languages), + R.string.localizable.tabbarCrowdloanTitle_v190(preferredLanguages: languages) + ] + } +} + +extension VoteTableHeaderView: VoteChainViewProtocol { + func bind(viewModel: ChainBalanceViewModel) { + self.viewModel?.icon.cancel(on: chainSelectionView.iconView) + chainSelectionView.iconView.image = nil + + self.viewModel = viewModel + + chainSelectionView.title = viewModel.name + chainSelectionView.subtitle = viewModel.balance + + let iconSize = 2 * chainSelectionView.iconRadius + viewModel.icon.loadImage( + on: chainSelectionView.iconView, + targetSize: CGSize(width: iconSize, height: iconSize), + animated: true + ) + + setNeedsLayout() + } } diff --git a/novawallet/Modules/Vote/Parent/VoteChildPresenterFactory.swift b/novawallet/Modules/Vote/Parent/VoteChildPresenterFactory.swift new file mode 100644 index 0000000000..64556c738c --- /dev/null +++ b/novawallet/Modules/Vote/Parent/VoteChildPresenterFactory.swift @@ -0,0 +1,202 @@ +import Foundation +import SoraFoundation +import RobinHood +import SubstrateSdk + +protocol VoteChildPresenterFactoryProtocol { + func createCrowdloanPresenter( + from view: CrowdloansViewProtocol, + wallet: MetaAccountModel + ) -> VoteChildPresenterProtocol? + + func createGovernancePresenter( + from view: ReferendumsViewProtocol, + wallet: MetaAccountModel + ) -> VoteChildPresenterProtocol? +} + +final class VoteChildPresenterFactory { + let currencyManager: CurrencyManagerProtocol + let localizationManager: LocalizationManagerProtocol + let repositoryFactory: SubstrateRepositoryFactoryProtocol + let chainRegistry: ChainRegistryProtocol + let walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol + let jsonDataProviderFactory: JsonDataProviderFactoryProtocol + let priceProviderFactory: PriceProviderFactoryProtocol + let applicationHandler: ApplicationHandlerProtocol + let substrateStorageFacade: StorageFacadeProtocol + let eventCenter: EventCenterProtocol + let operationQueue: OperationQueue + let logger: LoggerProtocol + + init( + currencyManager: CurrencyManagerProtocol, + chainRegistry: ChainRegistryProtocol = ChainRegistryFacade.sharedRegistry, + walletLocalSubscriptionFactory: WalletLocalSubscriptionFactoryProtocol = WalletLocalSubscriptionFactory.shared, + jsonDataProviderFactory: JsonDataProviderFactoryProtocol = JsonDataProviderFactory.shared, + priceProviderFactory: PriceProviderFactoryProtocol = PriceProviderFactory.shared, + repositoryFactory: SubstrateRepositoryFactoryProtocol = SubstrateRepositoryFactory(), + applicationHandler: ApplicationHandlerProtocol = ApplicationHandler(), + substrateStorageFacade: StorageFacadeProtocol = SubstrateDataStorageFacade.shared, + eventCenter: EventCenterProtocol = EventCenter.shared, + operationQueue: OperationQueue = OperationManagerFacade.sharedDefaultQueue, + localizationManager: LocalizationManagerProtocol = LocalizationManager.shared, + logger: LoggerProtocol = Logger.shared + ) { + self.currencyManager = currencyManager + self.chainRegistry = chainRegistry + self.walletLocalSubscriptionFactory = walletLocalSubscriptionFactory + self.jsonDataProviderFactory = jsonDataProviderFactory + self.priceProviderFactory = priceProviderFactory + self.repositoryFactory = repositoryFactory + self.applicationHandler = applicationHandler + self.substrateStorageFacade = substrateStorageFacade + self.eventCenter = eventCenter + self.operationQueue = operationQueue + self.localizationManager = localizationManager + self.logger = logger + } + + private func createCrowdloanInteractor( + from state: CrowdloanSharedState, + wallet: MetaAccountModel + ) -> CrowdloanListInteractor { + let repository = repositoryFactory.createChainStorageItemRepository() + + let operationManager = OperationManager(operationQueue: operationQueue) + + let crowdloanRemoteSubscriptionService = CrowdloanRemoteSubscriptionService( + chainRegistry: chainRegistry, + repository: AnyDataProviderRepository(repository), + operationManager: operationManager, + logger: logger + ) + + let storageRequestFactory = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: operationManager + ) + + let crowdloanOperationFactory = CrowdloanOperationFactory( + requestOperationFactory: storageRequestFactory, + operationManager: operationManager + ) + + return CrowdloanListInteractor( + selectedMetaAccount: wallet, + crowdloanState: state, + chainRegistry: chainRegistry, + crowdloanOperationFactory: crowdloanOperationFactory, + crowdloanRemoteSubscriptionService: crowdloanRemoteSubscriptionService, + walletLocalSubscriptionFactory: walletLocalSubscriptionFactory, + jsonDataProviderFactory: jsonDataProviderFactory, + operationManager: operationManager, + applicationHandler: applicationHandler, + currencyManager: currencyManager, + priceLocalSubscriptionFactory: priceProviderFactory, + logger: logger + ) + } + + private func createGovernanceInteractor( + for state: GovernanceSharedState, + wallet: MetaAccountModel + ) -> ReferendumsInteractor { + let serviceFactory = GovernanceServiceFactory( + chainRegisty: chainRegistry, + storageFacade: substrateStorageFacade, + eventCenter: eventCenter, + operationQueue: operationQueue, + logger: logger + ) + + return ReferendumsInteractor( + selectedMetaAccount: wallet, + governanceState: state, + chainRegistry: chainRegistry, + walletLocalSubscriptionFactory: walletLocalSubscriptionFactory, + priceLocalSubscriptionFactory: priceProviderFactory, + serviceFactory: serviceFactory, + applicationHandler: applicationHandler, + operationQueue: operationQueue, + currencyManager: currencyManager + ) + } +} + +extension VoteChildPresenterFactory: VoteChildPresenterFactoryProtocol { + func createCrowdloanPresenter( + from view: CrowdloansViewProtocol, + wallet: MetaAccountModel + ) -> VoteChildPresenterProtocol? { + let state = CrowdloanSharedState() + + let interactor = createCrowdloanInteractor(from: state, wallet: wallet) + let wireframe = CrowdloanListWireframe(state: state) + + let viewModelFactory = CrowdloansViewModelFactory( + amountFormatterFactory: AssetBalanceFormatterFactory(), + balanceViewModelFactoryFacade: BalanceViewModelFactoryFacade( + priceAssetInfoFactory: PriceAssetInfoFactory(currencyManager: currencyManager) + ) + ) + + let presenter = CrowdloanListPresenter( + interactor: interactor, + wireframe: wireframe, + wallet: wallet, + viewModelFactory: viewModelFactory, + localizationManager: localizationManager, + crowdloansCalculator: CrowdloansCalculator(), + accountManagementFilter: AccountManagementFilter(), + logger: Logger.shared + ) + + presenter.view = view + view.presenter = presenter + interactor.presenter = presenter + + return presenter + } + + func createGovernancePresenter( + from view: ReferendumsViewProtocol, + wallet: MetaAccountModel + ) -> VoteChildPresenterProtocol? { + let state = GovernanceSharedState() + let interactor = createGovernanceInteractor(for: state, wallet: wallet) + let wireframe = ReferendumsWireframe(state: state) + + let statusViewModelFactory = ReferendumStatusViewModelFactory() + + let indexFormatter = NumberFormatter.index.localizableResource() + + let assetBalanceFormatterFactory = AssetBalanceFormatterFactory() + + let viewModelFactory = ReferendumsModelFactory( + referendumMetadataViewModelFactory: ReferendumMetadataViewModelFactory(indexFormatter: indexFormatter), + statusViewModelFactory: statusViewModelFactory, + assetBalanceFormatterFactory: assetBalanceFormatterFactory, + percentFormatter: NumberFormatter.referendumPercent.localizableResource(), + indexFormatter: NumberFormatter.index.localizableResource(), + quantityFormatter: NumberFormatter.quantity.localizableResource() + ) + + let presenter = ReferendumsPresenter( + interactor: interactor, + wireframe: wireframe, + viewModelFactory: viewModelFactory, + statusViewModelFactory: statusViewModelFactory, + assetBalanceFormatterFactory: assetBalanceFormatterFactory, + sorting: ReferendumsTimeSortingProvider(), + localizationManager: localizationManager, + logger: logger + ) + + presenter.view = view + view.presenter = presenter + interactor.presenter = presenter + + return presenter + } +} diff --git a/novawallet/Modules/Vote/Parent/VoteInteractor.swift b/novawallet/Modules/Vote/Parent/VoteInteractor.swift new file mode 100644 index 0000000000..948e33808b --- /dev/null +++ b/novawallet/Modules/Vote/Parent/VoteInteractor.swift @@ -0,0 +1,42 @@ +import Foundation + +final class VoteInteractor { + weak var presenter: VoteInteractorOutputProtocol? + + let walletSettings: SelectedWalletSettings + let eventCenter: EventCenterProtocol + + init( + walletSettings: SelectedWalletSettings, + eventCenter: EventCenterProtocol + ) { + self.walletSettings = walletSettings + self.eventCenter = eventCenter + } + + private func provideSelectedWallet() { + guard let selectedWallet = walletSettings.value else { + return + } + + presenter?.didReceiveWallet(selectedWallet) + } +} + +extension VoteInteractor: VoteInteractorInputProtocol { + func setup() { + provideSelectedWallet() + + eventCenter.add(observer: self, dispatchIn: .main) + } +} + +extension VoteInteractor: EventVisitorProtocol { + func processSelectedAccountChanged(event _: SelectedAccountChanged) { + provideSelectedWallet() + } + + func processChainAccountChanged(event _: ChainAccountChanged) { + provideSelectedWallet() + } +} diff --git a/novawallet/Modules/Vote/Parent/VotePresenter.swift b/novawallet/Modules/Vote/Parent/VotePresenter.swift new file mode 100644 index 0000000000..dfa015ba6f --- /dev/null +++ b/novawallet/Modules/Vote/Parent/VotePresenter.swift @@ -0,0 +1,87 @@ +import Foundation + +final class VotePresenter { + weak var view: VoteViewProtocol? + + let interactor: VoteInteractorInputProtocol + let wireframe: VoteWireframeProtocol + let childPresenterFactory: VoteChildPresenterFactoryProtocol + + private var childPresenter: VoteChildPresenterProtocol? + private var wallet: MetaAccountModel? + + private lazy var walletSwitchViewModelFactory = WalletSwitchViewModelFactory() + + init( + interactor: VoteInteractorInputProtocol, + wireframe: VoteWireframeProtocol, + childPresenterFactory: VoteChildPresenterFactoryProtocol + ) { + self.interactor = interactor + self.wireframe = wireframe + self.childPresenterFactory = childPresenterFactory + } + + private func provideWalletViewModel() { + guard let wallet = wallet else { + return + } + + let viewModel = walletSwitchViewModelFactory.createViewModel( + from: wallet.walletIdenticonData(), + walletType: wallet.type + ) + + view?.didSwitchWallet(with: viewModel) + } +} + +extension VotePresenter: VotePresenterProtocol { + func setup() { + interactor.setup() + } + + func becomeOnline() { + childPresenter?.becomeOnline() + } + + func putOffline() { + childPresenter?.putOffline() + } + + func selectChain() { + childPresenter?.selectChain() + } + + func selectWallet() { + wireframe.showWalletSwitch(from: view) + } + + func switchToGovernance(_ view: ReferendumsViewProtocol) { + guard let wallet = wallet else { + return + } + + childPresenter?.putOffline() + childPresenter = childPresenterFactory.createGovernancePresenter(from: view, wallet: wallet) + childPresenter?.setup() + } + + func switchToCrowdloans(_ view: CrowdloansViewProtocol) { + guard let wallet = wallet else { + return + } + + childPresenter?.putOffline() + childPresenter = childPresenterFactory.createCrowdloanPresenter(from: view, wallet: wallet) + childPresenter?.setup() + } +} + +extension VotePresenter: VoteInteractorOutputProtocol { + func didReceiveWallet(_ wallet: MetaAccountModel) { + self.wallet = wallet + + provideWalletViewModel() + } +} diff --git a/novawallet/Modules/Vote/Parent/VoteProtocols.swift b/novawallet/Modules/Vote/Parent/VoteProtocols.swift new file mode 100644 index 0000000000..c7ed65c286 --- /dev/null +++ b/novawallet/Modules/Vote/Parent/VoteProtocols.swift @@ -0,0 +1,48 @@ +import Foundation + +enum VoteType: UInt8 { + case governance + case crowdloan +} + +protocol VoteViewProtocol: ControllerBackedProtocol, LoadableViewProtocol { + func didSwitchWallet(with viewModel: WalletSwitchViewModel) +} + +protocol VoteChainViewProtocol { + func bind(viewModel: ChainBalanceViewModel) +} + +protocol VotePresenterProtocol: AnyObject { + func setup() + func becomeOnline() + func putOffline() + func selectChain() + func selectWallet() + func switchToGovernance(_ view: ReferendumsViewProtocol) + func switchToCrowdloans(_ view: CrowdloansViewProtocol) +} + +protocol VoteInteractorInputProtocol: AnyObject { + func setup() +} + +protocol VoteInteractorOutputProtocol: AnyObject { + func didReceiveWallet(_ wallet: MetaAccountModel) +} + +protocol VoteWireframeProtocol: AlertPresentable, ErrorPresentable, WalletSwitchPresentable {} + +protocol VoteChildViewProtocol: ControllerBackedProtocol { + var locale: Locale { get set } + + func bind() + func unbind() +} + +protocol VoteChildPresenterProtocol: AnyObject { + func setup() + func becomeOnline() + func putOffline() + func selectChain() +} diff --git a/novawallet/Modules/Vote/Parent/VoteViewController.swift b/novawallet/Modules/Vote/Parent/VoteViewController.swift new file mode 100644 index 0000000000..c48f0c5028 --- /dev/null +++ b/novawallet/Modules/Vote/Parent/VoteViewController.swift @@ -0,0 +1,143 @@ +import Foundation +import UIKit +import SoraFoundation + +final class VoteViewController: UIViewController, ViewHolder { + typealias RootViewType = VoteViewLayout + + let presenter: VotePresenterProtocol + + private(set) var childView: VoteChildViewProtocol? + + var selectedType: VoteType { + VoteType(rawValue: UInt8(rootView.headerView.votingTypeSwitch.selectedSegmentIndex)) ?? .governance + } + + init( + presenter: VotePresenterProtocol, + localizationManager: LocalizationManagerProtocol + ) { + self.presenter = presenter + + super.init(nibName: nil, bundle: nil) + + self.localizationManager = localizationManager + } + + @available(*, unavailable) + required init?(coder _: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func loadView() { + view = VoteViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + configure() + setupLocalization() + + presenter.setup() + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + presenter.becomeOnline() + } + + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + + presenter.putOffline() + } + + private func configure() { + rootView.headerView.chainSelectionView.addTarget( + self, + action: #selector(actionSelectChain), + for: .touchUpInside + ) + + rootView.headerView.walletSwitch.addTarget( + self, + action: #selector(actionWalletSwitch), + for: .touchUpInside + ) + + rootView.headerView.votingTypeSwitch.addTarget( + self, + action: #selector(actionVoteTypeChanged), + for: .valueChanged + ) + } + + private func setupLocalization() { + rootView.headerView.locale = selectedLocale + childView?.locale = selectedLocale + } + + @objc func actionSelectChain() { + presenter.selectChain() + } + + @objc func actionWalletSwitch() { + presenter.selectWallet() + } + + @objc func actionVoteTypeChanged() { + setupChildView() + } + + private func setupChildView() { + childView?.unbind() + childView = nil + + switch selectedType { + case .governance: + let governanceChildView = ReferendumsViewManager( + tableView: rootView.tableView, + chainSelectionView: rootView.headerView, + parent: self + ) + + childView = governanceChildView + childView?.bind() + childView?.locale = selectedLocale + + presenter.switchToGovernance(governanceChildView) + case .crowdloan: + let crowdloanChildView = CrowdloanListViewManager( + tableView: rootView.tableView, + chainSelectionView: rootView.headerView, + parent: self + ) + + childView = crowdloanChildView + childView?.bind() + childView?.locale = selectedLocale + + presenter.switchToCrowdloans(crowdloanChildView) + } + } +} + +extension VoteViewController: VoteViewProtocol { + func didSwitchWallet(with viewModel: WalletSwitchViewModel) { + rootView.headerView.walletSwitch.bind(viewModel: viewModel) + + setupChildView() + } +} + +extension VoteViewController: Localizable { + func applyLocalization() { + if isViewLoaded { + setupLocalization() + } + } +} + +extension VoteViewController: HiddableBarWhenPushed {} diff --git a/novawallet/Modules/Vote/Parent/VoteViewFactory.swift b/novawallet/Modules/Vote/Parent/VoteViewFactory.swift new file mode 100644 index 0000000000..728f9edf5e --- /dev/null +++ b/novawallet/Modules/Vote/Parent/VoteViewFactory.swift @@ -0,0 +1,32 @@ +import Foundation +import SoraFoundation + +enum VoteViewFactory { + static func createView() -> VoteViewProtocol? { + guard let currencyManager = CurrencyManager.shared else { + return nil + } + + let interactor = VoteInteractor( + walletSettings: SelectedWalletSettings.shared, + eventCenter: EventCenter.shared + ) + + let wireframe = VoteWireframe() + + let childPresenterFactory = VoteChildPresenterFactory(currencyManager: currencyManager) + + let presenter = VotePresenter( + interactor: interactor, + wireframe: wireframe, + childPresenterFactory: childPresenterFactory + ) + + let view = VoteViewController(presenter: presenter, localizationManager: LocalizationManager.shared) + + presenter.view = view + interactor.presenter = presenter + + return view + } +} diff --git a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListViewLayout.swift b/novawallet/Modules/Vote/Parent/VoteViewLayout.swift similarity index 64% rename from novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListViewLayout.swift rename to novawallet/Modules/Vote/Parent/VoteViewLayout.swift index 905e85ee20..778cc237cb 100644 --- a/novawallet/Modules/Crowdloan/CrowdloanList/CrowdloanListViewLayout.swift +++ b/novawallet/Modules/Vote/Parent/VoteViewLayout.swift @@ -1,16 +1,15 @@ +import Foundation import UIKit -import SnapKit -final class CrowdloanListViewLayout: UIView { +final class VoteViewLayout: UIView, TableHeaderLayoutUpdatable { private let backgroundView = MultigradientView.background - let headerView = CrowdloanTableHeaderView() + let headerView = VoteTableHeaderView() let tableView: UITableView = { let view = UITableView() view.backgroundColor = .clear view.separatorColor = R.color.colorDarkGray() - view.refreshControl = UIRefreshControl() view.tableFooterView = UIView() view.separatorStyle = .none view.contentInset = .init(top: 0, left: 0, bottom: 16, right: 0) @@ -31,18 +30,7 @@ final class CrowdloanListViewLayout: UIView { override func layoutSubviews() { super.layoutSubviews() - let height = headerView.systemLayoutSizeFitting( - CGSize(width: bounds.size.width, height: UIView.layoutFittingExpandedSize.height) - ).height - - var headerFrame = headerView.frame - - // Comparison necessary to avoid infinite loop - if height != headerFrame.size.height { - headerFrame.size.height = height - headerView.frame = headerFrame - tableView.tableHeaderView = headerView - } + updateTableHeaderLayout(headerView) } private func setup() { @@ -54,6 +42,7 @@ final class CrowdloanListViewLayout: UIView { make.top.equalToSuperview() make.leading.bottom.trailing.equalToSuperview() } + tableView.tableHeaderView = headerView } } diff --git a/novawallet/Modules/Vote/Parent/VoteWireframe.swift b/novawallet/Modules/Vote/Parent/VoteWireframe.swift new file mode 100644 index 0000000000..f89d3cd5d3 --- /dev/null +++ b/novawallet/Modules/Vote/Parent/VoteWireframe.swift @@ -0,0 +1,5 @@ +import Foundation + +final class VoteWireframe {} + +extension VoteWireframe: VoteWireframeProtocol {} diff --git a/novawallet/Resources/governanceDApps.json b/novawallet/Resources/governanceDApps.json new file mode 100644 index 0000000000..1eda9cae8a --- /dev/null +++ b/novawallet/Resources/governanceDApps.json @@ -0,0 +1,14 @@ +[ + { + "name": "Polkassembly", + "subtitle": "Comment and react", + "icon": "https://raw.githubusercontent.com/nova-wallet/nova-utils/master/icons/dapps/color/Polkassembly.svg", + "urlTemplate": "https://{network}.polkassembly.io/referendum/{index}" + }, + { + "name": "Subsquare", + "subtitle": "Comment and react", + "icon": "https://raw.githubusercontent.com/nova-wallet/nova-utils/master/icons/chains/color/SubSquare.svg", + "urlTemplate": "https://{network}.subsquare.io/democracy/referendum/{index}" + } +] diff --git a/novawallet/en.lproj/Localizable.strings b/novawallet/en.lproj/Localizable.strings index 2c9a8a70cc..58f15f31cb 100644 --- a/novawallet/en.lproj/Localizable.strings +++ b/novawallet/en.lproj/Localizable.strings @@ -288,7 +288,6 @@ "common.available.format" = "Available: %@"; "staking.rewards.learn.more" = "Learn more about rewards"; "common.error.no.data.retrieved" = "No data retrieved."; -"common.error.no.data.retrieved_v3_9_1" = "No data retrieved"; "staking.reward.payouts.empty.rewards" = "Perfect! All rewards are paid."; "staking.reward.details.validator" = "Validator"; "common.insufficient.balance" = "Insufficient balance"; @@ -540,6 +539,7 @@ "import.json.unsupported.ethereum.crypto.message" = "Cannot import account with Substrate secret into the network with Ethereum encryption"; "import.json.unsupported.substrate.crypto.message" = "Cannot import account with Ethereum secret into the network with Substrate encryption"; "common.tx.details" = "Transaction details"; +"common.unknown" = "Unknown"; "staking.month.period.title" = "Monthly"; "staking.year.period.title" = "Yearly"; "qr.scan.error.no.info" = "QR can't be decoded"; @@ -576,7 +576,6 @@ "account.create.details_v2_2_0" = "Do not use clipboard or screenshots on your mobile device, try to find secure methods for backup (e.g. paper)"; "crowdloan.list.section.format_v2_2_0" = "Choose parachains to contribute your %@. You'll get back your contributed tokens, and if parachain wins a slot, you'll receive rewards after the end of the auction"; "crowdloan.empty.message_v2_2_0" = "Crowdloans will be displayed here"; -"crowdloan.empty.message_v3_9_1" = "Crowdloans information\nwill appear here when they start"; "common.existential.warning.message_v2_2_0" = "Your account will be removed from blockchain after this operation cause it makes total balance lower than minimal"; "wallet.send.existential.warning_v2_2_0" = "Your account will be removed from blockchain after transfer cause it makes total balance lower than minimal"; "account.backup.mnemonic.title" = "Write down the phrase and store it in a safe place"; @@ -977,3 +976,107 @@ "yield.boost.task.not.found.message" = "Yield boost already disabled for the selected collator"; "common.not.available" = "N/A"; "wallet.account.locks.crowdloans" = "Crowdloans"; +"common.unlock" = "Unlock"; +"gov.voters.empty" = "List of voters will appear here"; +"tabbar.vote.title" = "Vote"; +"gov.common.amount.conviction.format" = "%@ × %@x"; +"gov.referendum.description.fallback" = "Only the proposer can edit this description and the title. If you own proposer\'s account, visit Polkassembly and fill in information about your proposal"; +"gov.voters.nay" = "Nay votes"; +"gov.voters.aye" = "Aye votes"; +"gov.support.curve" = "Support curve"; +"gov.approve.curve" = "Approve curve"; +"gov.call.hash" = "Call hash"; +"gov.electorate" = "Electorate"; +"gov.turnout" = "Turnout"; +"gov.vote.threshold" = "Vote threshold"; +"gov.beneficiary" = "Beneficiary"; +"gov.deposit" = "Deposit"; +"gov.proposer" = "Proposer"; +"common.too.long.preview" = "Too long for preview"; +"gov.parameters.json" = "Parameters JSON"; +"common.requested.amount" = "Requested amount"; +"gov.details.voting.status" = "Voting status"; +"gov.full.details" = "Full details"; +"gov.vote" = "Vote"; +"gov.referendum.details.timeline.title" = "Timeline"; +"governance.nay" = "Nay"; +"governance.aye" = "Aye"; +"gov.track.big.spender" = "Treasury: big spend"; +"gov.track.medium.spender" = "Treasury: medium spend"; +"gov.track.small.spender" = "Treasury: Small spend"; +"gov.track.big.tipper" = "Treasury: big tips"; +"gov.track.small.tipper" = "Treasury: small tips"; +"gov.track.referendum.killer" = "governance: killer"; +"gov.track.referendum.canceller" = "governance: canceller"; +"gov.track.auction.admin" = "crowdloans"; +"gov.track.general.admin" = "governance: registrar"; +"gov.track.fellowship.admin" = "fellowship: admin"; +"gov.track.lease.admin" = "Governance: lease"; +"gov.track.treasurer" = "Treasury: ANY"; +"gov.track.staking.admin" = "staking"; +"gov.track.whitelisted.caller" = "fellowship: whitelist"; +"gov.track.root" = "main agenda"; +"governance.referendums.time.execute" = "Execute in %@"; +"governance.referendums.time.approve" = "Approve in %@"; +"governance.referendums.time.reject" = "Reject in %@"; +"governance.referendums.time.timeout" = "Time out in %@"; +"governance.referendums.time.waiting.deposit" = "Waiting for deposit"; +"governance.referendums.time.deciding" = "Deciding in %@"; +"governance.referendums.status.killed" = "Killed"; +"governance.referendums.status.executed" = "Executed"; +"governance.referendums.status.preparing" = "Preparing"; +"governance.referendums.status.rejected" = "Rejected"; +"governance.referendums.status.not.passing" = "Not passing"; +"governance.referendums.status.passing" = "Passing"; +"governance.referendums.status.cancelled" = "Cancelled"; +"governance.referendums.status.timedOut" = "Timed out"; +"governance.referendums.status.approved" = "Approved"; +"governance.referendums.your.vote" = "Your vote: %@ votes"; +"governance.referendums.threshold" = "Threshold: %@ of %@"; +"gov.referendum.title.fallback" = "Referendum %@"; +"tabbar.governance.title" = "Governance"; +"governance.to.pass.format" = "To pass: %@"; +"governance.nays.format" = "Nay: %@"; +"governance.ayes.format" = "Aye: %@"; +"common.completed" = "Completed"; +"governance.referendums.active" = "Ongoing"; +"common.read.more" = "Read more"; +"gov.common.votes.format" = "%@ votes"; +"gov.timeline.created" = "Created"; +"gov.vote.conviction.title" = "Multiply votes by increasing locking period"; +"gov.vote.setup.title.format" = "Vote for %@"; +"common.locking.period" = "Locking period"; +"common.gov.lock" = "Governance lock"; +"common. maximum" = "%@ maximum"; +"gov.vote.setup.hint" = "After locking period don’t forget to unlock your tokens"; +"gov.revote" = "Revote"; +"gov.max.votes.reached.message" = "You have reached a maximum of %@ votes for track"; +"gov.max.votes.reached.title" = "Maximum number of votes reached"; +"gov.already.delegating.votes.message" = "You are delegating votes for selected referendum’s track. Please either ask your delegatee to vote or remove delegation to be able to vote directly."; +"gov.already.delegating.votes.title" = "Already delegating votes"; +"gov.referendum.completed.message" = "Referendum is completed and voting has finished"; +"gov.referendum.completed.title" = "Referendum is completed"; +"gov.not.enough.vote.tokens" = "You don’t have enough available tokens to vote. Available to vote: %@."; +"common.amount.too.big" = "Amount is too big"; +"gov.reuse.all.locks" = "Reuse all locks: %@"; +"gov.reuse.governance.locks" = "Reuse governance lock: %@"; +"common.unlockable" = "Unlockable"; +"gov.remains.locked.suffix" = "remains locked in %@"; +"governance.referendums.status.preparing.inqueue" = "in queue"; +"common.available.prefix" = "Available:"; +"gov.your.vote" = "Your vote"; +"common.use.dapp" = "Use Nova Featured websites"; +"gov.timeline.voting.format" = "Voting: %@"; +"gov.timeline.voted.format" = "Voted: %@"; +"gov.linear.decreasing" = "Linear Decreasing"; +"gov.stepped.decreasing" = "Stepped Decreasing"; +"gov.reciprocal" = "Reciprocal"; +"gov.in.queue.counter" = "(%@ of %@)"; +"gov.vote.treshold.function.simpleMajority" = "Simple Majority"; +"gov.vote.treshold.function.superMajorityAgainst" = "Super Majority Against"; +"gov.vote.treshold.function.superMajorityApprove" = "Super Majority Approve"; +"common.days.fraction.format" = "%@ days"; +"gov.empty.list" = "Referenda information\nwill appear here when they start"; +"common.copy" = "Copy"; +"crowdloan.empty.message_v3_9_1" = "Crowdloans information\nwill appear here when they start"; +"common.error.no.data.retrieved_v3_9_1" = "No data retrieved"; \ No newline at end of file diff --git a/novawallet/ru.lproj/Localizable.strings b/novawallet/ru.lproj/Localizable.strings index 62af0c73c2..8f3136de32 100644 --- a/novawallet/ru.lproj/Localizable.strings +++ b/novawallet/ru.lproj/Localizable.strings @@ -288,7 +288,6 @@ "common.available.format" = "Доступно: %@"; "staking.rewards.learn.more" = "Подробнее о вознаграждениях"; "common.error.no.data.retrieved" = "Данные не получены."; -"common.error.no.data.retrieved_v3_9_1" = "Данные не получены"; "staking.reward.payouts.empty.rewards" = "Прекрасно! Все вознаграждения выплачены."; "staking.reward.details.validator" = "Валидатор"; "common.insufficient.balance" = "Недостаточный баланс"; @@ -540,6 +539,7 @@ "import.json.unsupported.ethereum.crypto.message" = "Не поддерживается импорт аккаунта с Substrate секретом в сеть с Ethereum шифрованием"; "import.json.unsupported.substrate.crypto.message" = "Не поддерживается импорт аккаунта с Ethereum секретом в сеть с Substrate шифрованием"; "common.tx.details" = "Детали транзакции"; +"common.unknown" = "Неизвестно"; "staking.month.period.title" = "Eжемесячно"; "staking.year.period.title" = "Eжегодно"; "qr.scan.error.no.info" = "Не удается декодировать QR"; @@ -576,7 +576,6 @@ "account.create.details_v2_2_0" = "Не используйте буфер обмена или скриншоты на вашем мобильном устройстве, постарайтесь найти безопасные способы резервного копирования (например на бумагу)"; "crowdloan.list.section.format_v2_2_0" = "Выберите парачейны для внесения своих %@. Вы получите внесенные токены обратно, и если парачейн выиграет слот вы получите награду после окончания аукциона"; "crowdloan.empty.message_v2_2_0" = "Краудлоуны появятся здесь"; -"crowdloan.empty.message_v3_9_1" = "Информация о краудлоунах\nпоявится здесь, когда они начнутся"; "common.existential.warning.message_v2_2_0" = "Ваша учетная запись будет удалена из сети после операции, так как ваш баланс опустится ниже минимального"; "wallet.send.existential.warning_v2_2_0" = "Ваша учетная запись будет удалена из сети после перевода, так как опустит общий баланс ниже минимального"; "account.backup.mnemonic.title" = "Запишите фразу и храните её в надежном месте"; @@ -977,3 +976,107 @@ "yield.boost.task.not.found.message" = "Yield boost уже отключен для выбранного коллатора"; "common.not.available" = "N/A"; "wallet.account.locks.crowdloans" = "Краудлоуны"; +"common.unlock" = "Разблокировать"; +"gov.voters.empty" = "Список голосовавших появится здесь"; +"tabbar.vote.title" = "Голосование"; +"gov.common.amount.conviction.format" = "%@ × %@x"; +"gov.referendum.description.fallback" = "Только автор референдума может редактировать это описание и заголовок. Если у вас есть доступ к аккаунту автора, посетите Polkassembly и заполните информацию о вашем референдуме"; +"gov.voters.nay" = "Голоса \"против\""; +"gov.voters.aye" = "Голоса \"за\""; +"gov.support.curve" = "Кривая поддержки"; +"gov.approve.curve" = "Кривая одобрения"; +"gov.call.hash" = "Хэш вызова"; +"gov.electorate" = "Электорат"; +"gov.turnout" = "Явка"; +"gov.vote.threshold" = "Порог голосования"; +"gov.beneficiary" = "Получатель"; +"gov.deposit" = "Депозит"; +"gov.proposer" = "Автор"; +"common.too.long.preview" = "Слишком большая длина для просмотра"; +"gov.parameters.json" = "Параметры JSON"; +"common.requested.amount" = "Запрашиваемая сумма"; +"gov.details.voting.status" = "Статус голосования"; +"gov.full.details" = "Полная информация"; +"gov.vote" = "Голосовать"; +"gov.referendum.details.timeline.title" = "Временная шкала"; +"governance.nay" = "Против"; +"governance.aye" = "За"; +"gov.track.big.spender" = "Казна: большие траты"; +"gov.track.medium.spender" = "Казна: средние траты"; +"gov.track.small.spender" = "Казна: мелкие траты"; +"gov.track.big.tipper" = "Казна: большие чаевые"; +"gov.track.small.tipper" = "Казна: мелкие чаевые"; +"gov.track.referendum.killer" = "Управление: удаление"; +"gov.track.referendum.canceller" = "Управление: отмена"; +"gov.track.auction.admin" = "Краудлоуны"; +"gov.track.general.admin" = "Управление: регистратор"; +"gov.track.fellowship.admin" = "fellowship: управление"; +"gov.track.lease.admin" = "Управление: аренда"; +"gov.track.treasurer" = "Казна: любое"; +"gov.track.staking.admin" = "Стейкинг"; +"gov.track.whitelisted.caller" = "fellowship: белый список"; +"gov.track.root" = "основная повестка"; +"governance.referendums.time.execute" = "Выполнение через %@"; +"governance.referendums.time.approve" = "Одобрение через %@"; +"governance.referendums.time.reject" = "Отклонение через %@"; +"governance.referendums.time.timeout" = "Тайм-аут через %@"; +"governance.referendums.time.waiting.deposit" = "Ожидание депозита"; +"governance.referendums.time.deciding" = "Начнёт решаться через %@"; +"governance.referendums.status.killed" = "Удалён"; +"governance.referendums.status.executed" = "Выполнен"; +"governance.referendums.status.preparing" = "Подготовка"; +"governance.referendums.status.rejected" = "Отклонён"; +"governance.referendums.status.not.passing" = "Не проходит"; +"governance.referendums.status.passing" = "Проходит"; +"governance.referendums.status.cancelled" = "Отменен"; +"governance.referendums.status.timedOut" = "Тайм-аут"; +"governance.referendums.status.approved" = "Одобрен"; +"governance.referendums.your.vote" = "Ваш голос: %@ голосов"; +"governance.referendums.threshold" = "Порог: %@ из %@"; +"gov.referendum.title.fallback" = "Референдум %@"; +"tabbar.governance.title" = "Демократия"; +"governance.to.pass.format" = "Для принятия: %@"; +"governance.nays.format" = "Против: %@"; +"governance.ayes.format" = "За: %@"; +"common.completed" = "Завершённые"; +"governance.referendums.active" = "На голосовании"; +"common.read.more" = "Подробнее"; +"gov.common.votes.format" = "%@ голосов"; +"gov.timeline.created" = "Создан"; +"gov.vote.conviction.title" = "Умножьте количество голосов, увеличив период блокировки"; +"gov.vote.setup.title.format" = "Проголосовать за %@"; +"common.locking.period" = "Период блокировки"; +"common.gov.lock" = "Заблокировано в демократии"; +"common. maximum" = "%@ максимум"; +"gov.vote.setup.hint" = "По истечении периода блокировки не забудьте разблокировать свои токены"; +"gov.revote" = "Переголосовать"; +"gov.max.votes.reached.message" = "Вы набрали максимальное количество голосов за трек: %@"; +"gov.max.votes.reached.title" = "Достигнуто максимальное количество голосов"; +"gov.already.delegating.votes.message" = "Вы делегируете голоса в треке данного референдума. Пожалуйста, либо попросите делегата проголосовать, либо удалите делегирование, чтобы иметь возможность голосовать напрямую."; +"gov.already.delegating.votes.title" = "Вы уже делегируете голоса"; +"gov.referendum.completed.message" = "Референдум завершен, голосовать больше нельзя"; +"gov.referendum.completed.title" = "Референдум завершен"; +"gov.not.enough.vote.tokens" = "У вас недостаточно токенов для голосования. Доступно для голосования: %@."; +"common.amount.too.big" = "Сумма слишком большая"; +"gov.reuse.all.locks" = "Уже заблокировано: %@"; +"gov.reuse.governance.locks" = "Уже в демократии: %@"; +"common.unlockable" = "Можно разблокировать"; +"gov.remains.locked.suffix" = "остаются заблокированными в %@"; +"governance.referendums.status.preparing.inqueue" = "в очереди"; +"common.available.prefix" = "Доступно:"; +"gov.your.vote" = "Ваш голос"; +"common.use.dapp" = "Популярные вебсайты в Nova Wallet"; +"gov.timeline.voting.format" = "Голосование: %@"; +"gov.timeline.voted.format" = "Результат: %@"; +"gov.linear.decreasing" = "Линейное убывание"; +"gov.stepped.decreasing" = "Ступенчатое убывание"; +"gov.reciprocal" = "Обратное линейное убывание"; +"gov.in.queue.counter" = "(%@ из %@)"; +"gov.vote.treshold.function.simpleMajority" = "Простое большинство"; +"gov.vote.treshold.function.superMajorityAgainst" = "Супербольшинство против"; +"gov.vote.treshold.function.superMajorityApprove" = "Супербольшинство за"; +"common.days.fraction.format" = "%@ дней"; +"gov.empty.list" = "Информация о референдумах\nпоявится здесь, когда они начнутся"; +"common.copy" = "Копировать"; +"crowdloan.empty.message_v3_9_1" = "Информация о краудлоунах\nпоявится здесь, когда они начнутся"; +"common.error.no.data.retrieved_v3_9_1" = "Данные не получены"; \ No newline at end of file diff --git a/novawalletIntegrationTests/ConvictionVotesFetchTests.swift b/novawalletIntegrationTests/ConvictionVotesFetchTests.swift new file mode 100644 index 0000000000..b218e34243 --- /dev/null +++ b/novawalletIntegrationTests/ConvictionVotesFetchTests.swift @@ -0,0 +1,113 @@ +import XCTest +@testable import novawallet +import SubstrateSdk +import RobinHood + +class ConvictionVotesFetchTests: XCTestCase { + func testConvictionVotesFetch() throws { + // given + + let storageFacade = SubstrateStorageTestFacade() + let chainRegistry = ChainRegistryFacade.setupForIntegrationTest(with: storageFacade) + let chainId = "ea5af80801ea4579cedd029eaaa74938f0ea8dcaf507c8af96f2813d27d071ca" + let accountId = try "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY".toAccountId() + let operationQueue = OperationQueue() + + let requestFactory = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: OperationManager(operationQueue: operationQueue) + ) + + guard let connection = chainRegistry.getConnection(for: chainId) else { + XCTFail("Can't get connection for chain id \(chainId)") + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + XCTFail("Can't get runtime provider for chain id \(chainId)") + return + } + + // when + + let request = MapRemoteStorageRequest(storagePath: ConvictionVoting.votingFor) { + BytesCodable(wrappedValue: accountId) + } + + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let wrapper: CompoundOperationWrapper<[ConvictionVoting.VotingForKey: ConvictionVoting.Voting]> = + requestFactory.queryByPrefix( + engine: connection, + request: request, + storagePath: ConvictionVoting.votingFor, + factory: { try codingFactoryOperation.extractNoCancellableResultData() } + ) + + wrapper.addDependency(operations: [codingFactoryOperation]) + + operationQueue.addOperations([codingFactoryOperation] + wrapper.allOperations, waitUntilFinished: true) + + // then + + do { + let voting = try wrapper.targetOperation.extractNoCancellableResultData() + Logger.shared.info("Did receive voting: \(voting)") + } catch { + XCTFail("Unexpected error: \(error)") + } + } + + func testConvictionLocksFetch() throws { + // given + + let storageFacade = SubstrateStorageTestFacade() + let chainRegistry = ChainRegistryFacade.setupForIntegrationTest(with: storageFacade) + let chainId = "ea5af80801ea4579cedd029eaaa74938f0ea8dcaf507c8af96f2813d27d071ca" + let accountId = try "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY".toAccountId() + let operationQueue = OperationQueue() + + let requestFactory = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: OperationManager(operationQueue: operationQueue) + ) + + guard let connection = chainRegistry.getConnection(for: chainId) else { + XCTFail("Can't get connection for chain id \(chainId)") + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + XCTFail("Can't get runtime provider for chain id \(chainId)") + return + } + + // when + + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let wrapper: CompoundOperationWrapper<[StorageResponse<[ConvictionVoting.ClassLock]>]> = + requestFactory.queryItems( + engine: connection, + keyParams: { + [BytesCodable(wrappedValue: accountId)] + }, + factory: { try codingFactoryOperation.extractNoCancellableResultData() }, + storagePath: ConvictionVoting.trackLocksFor + ) + + wrapper.addDependency(operations: [codingFactoryOperation]) + + operationQueue.addOperations([codingFactoryOperation] + wrapper.allOperations, waitUntilFinished: true) + + // then + + do { + let locks = try wrapper.targetOperation.extractNoCancellableResultData() + + Logger.shared.info("Did receive locks: \(locks)") + } catch { + XCTFail("Unexpected error: \(error)") + } + } +} diff --git a/novawalletIntegrationTests/Gov2OperationFactoryTests.swift b/novawalletIntegrationTests/Gov2OperationFactoryTests.swift new file mode 100644 index 0000000000..f2e846f6b4 --- /dev/null +++ b/novawalletIntegrationTests/Gov2OperationFactoryTests.swift @@ -0,0 +1,164 @@ +import XCTest +@testable import novawallet +import SubstrateSdk +import RobinHood + +class Gov2OperationFactoryTests: XCTestCase { + let chainId = "a2ee5a1f55a23dccd0c35e36512f9009e6e50a5654e8e5e469445d0748632aa8" + + var chainRegistry: ChainRegistryProtocol! + var connection: JSONRPCEngine! + var runtimeProvider: RuntimeProviderProtocol! + var operationQueue: OperationQueue! + var requestFactory: StorageRequestFactoryProtocol! + + override func setUpWithError() throws { + try super.setUpWithError() + + let storageFacade = SubstrateStorageTestFacade() + + chainRegistry = ChainRegistryFacade.setupForIntegrationTest(with: storageFacade) + + guard let connection = chainRegistry.getConnection(for: chainId) else { + throw ChainRegistryError.connectionUnavailable + } + + self.connection = connection + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + throw ChainRegistryError.runtimeMetadaUnavailable + } + + self.runtimeProvider = runtimeProvider + + let operationQueue = OperationQueue() + self.operationQueue = operationQueue + + self.requestFactory = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: OperationManager(operationQueue: operationQueue) + ) + } + + func testLocalReferendumsFetch() { + do { + let referendums = try fetchAllReferendums(for: chainRegistry) + Logger.shared.info("Referendums: \(referendums)") + } catch { + XCTFail("Unexpected error: \(error)") + } + } + + func testFetchLocalVotes() throws { + // given + let accountId = try "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY".toAccountId() + + // when + + let operationFactory = Gov2OperationFactory(requestFactory: requestFactory, operationQueue: operationQueue) + + let wrapper = operationFactory.fetchAccountVotesWrapper( + for: accountId, + from: connection, + runtimeProvider: runtimeProvider, + blockHash: nil + ) + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: true) + + // then + + do { + let votes = try wrapper.targetOperation.extractNoCancellableResultData() + Logger.shared.info("Votes: \(votes)") + } catch { + XCTFail("Unexpected error: \(error)") + } + } + + func testVotersFetch() throws { + // given + + let referendumIndex: Referenda.ReferendumIndex = 0 + + // when + + let operationFactory = Gov2OperationFactory(requestFactory: requestFactory, operationQueue: operationQueue) + + let wrapper = operationFactory.fetchVotersWrapper( + for: ReferendumIdLocal(referendumIndex), + from: connection, + runtimeProvider: runtimeProvider + ) + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: true) + + // then + + do { + let votes = try wrapper.targetOperation.extractNoCancellableResultData() + Logger.shared.info("Voters: \(votes)") + } catch { + XCTFail("Unexpected error: \(error)") + } + } + + func testActionDetails() { + do { + let referendums = try fetchAllReferendums(for: chainRegistry) + + let operationFactory = Gov2ActionOperationFactory( + requestFactory: requestFactory, + operationQueue: operationQueue + ) + + let wrappers = referendums.map { referendum in + operationFactory.fetchActionWrapper( + for: referendum, + connection: connection, + runtimeProvider: runtimeProvider + ) + } + + let operations = wrappers.flatMap { $0.allOperations } + + operationQueue.addOperations(operations, waitUntilFinished: true) + + let details = try wrappers.map { try $0.targetOperation.extractNoCancellableResultData() } + + Logger.shared.info("Did receive details: \(details)") + } catch { + XCTFail("Unexpected error: \(error)") + } + } + + // MARK: Private + + private func fetchAllReferendums(for chainRegistry: ChainRegistryProtocol) throws -> [ReferendumLocal] { + let operationQueue = OperationQueue() + + let requestFactory = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: OperationManager(operationQueue: operationQueue) + ) + + guard let connection = chainRegistry.getConnection(for: chainId) else { + throw ChainRegistryError.connectionUnavailable + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + throw ChainRegistryError.runtimeMetadaUnavailable + } + + let operationFactory = Gov2OperationFactory(requestFactory: requestFactory, operationQueue: operationQueue) + + let wrapper = operationFactory.fetchAllReferendumsWrapper( + from: connection, + runtimeProvider: runtimeProvider + ) + + operationQueue.addOperations(wrapper.allOperations, waitUntilFinished: true) + + return try wrapper.targetOperation.extractNoCancellableResultData() + } +} diff --git a/novawalletIntegrationTests/ReferendumFetchTests.swift b/novawalletIntegrationTests/ReferendumFetchTests.swift new file mode 100644 index 0000000000..d4d6c051dc --- /dev/null +++ b/novawalletIntegrationTests/ReferendumFetchTests.swift @@ -0,0 +1,101 @@ +import XCTest +@testable import novawallet +import SubstrateSdk +import RobinHood + +class ReferendumFetchTests: XCTestCase { + func testFetchAllOnchainReferendums() { + // given + + let storageFacade = SubstrateStorageTestFacade() + let chainRegistry = ChainRegistryFacade.setupForIntegrationTest(with: storageFacade) + let chainId = "ea5af80801ea4579cedd029eaaa74938f0ea8dcaf507c8af96f2813d27d071ca" + let operationQueue = OperationQueue() + + let requestFactory = StorageRequestFactory( + remoteFactory: StorageKeyFactory(), + operationManager: OperationManager(operationQueue: operationQueue) + ) + + guard let connection = chainRegistry.getConnection(for: chainId) else { + XCTFail("Can't get connection for chain id \(chainId)") + return + } + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + XCTFail("Can't get runtime provider for chain id \(chainId)") + return + } + + // when + + let request = UnkeyedRemoteStorageRequest(storagePath: Referenda.referendumInfo) + + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let wrapper: CompoundOperationWrapper<[ReferendumIndexKey: ReferendumInfo]> = requestFactory.queryByPrefix( + engine: connection, + request: request, + storagePath: request.storagePath, + factory: { + try codingFactoryOperation.extractNoCancellableResultData() + }, + at: nil + ) + + wrapper.addDependency(operations: [codingFactoryOperation]) + + let operations = [codingFactoryOperation] + wrapper.allOperations + operationQueue.addOperations(operations, waitUntilFinished: true) + + // then + + do { + let referendums = try wrapper.targetOperation.extractNoCancellableResultData() + Logger.shared.info("Referendums: \(referendums)") + } catch { + XCTFail("Unexpected error \(error)") + } + } + + func testFetchAllTracks() { + // given + + let storageFacade = SubstrateStorageTestFacade() + let chainRegistry = ChainRegistryFacade.setupForIntegrationTest(with: storageFacade) + let chainId = "ea5af80801ea4579cedd029eaaa74938f0ea8dcaf507c8af96f2813d27d071ca" + let operationQueue = OperationQueue() + + guard let runtimeProvider = chainRegistry.getRuntimeProvider(for: chainId) else { + XCTFail("Can't get runtime provider for chain id \(chainId)") + return + } + + // when + + let codingFactoryOperation = runtimeProvider.fetchCoderFactoryOperation() + + let constantOperation = StorageConstantOperation<[Referenda.Track]>(path: Referenda.tracks) + + constantOperation.configurationBlock = { + do { + constantOperation.codingFactory = try codingFactoryOperation.extractNoCancellableResultData() + } catch { + constantOperation.result = .failure(error) + } + } + + constantOperation.addDependency(codingFactoryOperation) + + operationQueue.addOperations([codingFactoryOperation, constantOperation], waitUntilFinished: true) + + // then + + do { + let tracks = try constantOperation.extractNoCancellableResultData() + Logger.shared.info("Tracks: \(tracks)") + } catch { + XCTFail("Unexpected error: \(error)") + } + } +} diff --git a/novawalletTests/Common/Extensions/DecimalTests.swift b/novawalletTests/Common/Extensions/DecimalTests.swift new file mode 100644 index 0000000000..2158aedb66 --- /dev/null +++ b/novawalletTests/Common/Extensions/DecimalTests.swift @@ -0,0 +1,21 @@ +import XCTest +@testable import novawallet + +class DecimalTests: XCTestCase { + + func testDecimalFloor() { + XCTAssertEqual(Decimal(0.1).floor(), 0.0) + XCTAssertEqual(Decimal(0.5).floor(), 0.0) + XCTAssertEqual(Decimal(0.9).floor(), 0.0) + XCTAssertEqual(Decimal(5.1).floor(), 5.0) + XCTAssertEqual(Decimal(5.5).floor(), 5.0) + XCTAssertEqual(Decimal(5.9).floor(), 5.0) + + XCTAssertEqual(Decimal(-0.1).floor(), -1.0) + XCTAssertEqual(Decimal(-0.5).floor(), -1.0) + XCTAssertEqual(Decimal(-0.9).floor(), -1.0) + XCTAssertEqual(Decimal(-5.1).floor(), -6.0) + XCTAssertEqual(Decimal(-5.5).floor(), -6.0) + XCTAssertEqual(Decimal(-5.9).floor(), -6.0) + } +} diff --git a/novawalletTests/Common/Migration/Mappers/ChainModelMapperV2V3.swift b/novawalletTests/Common/Migration/Mappers/ChainModelMapperV2V3.swift new file mode 100644 index 0000000000..8e8827d43b --- /dev/null +++ b/novawalletTests/Common/Migration/Mappers/ChainModelMapperV2V3.swift @@ -0,0 +1,316 @@ +import Foundation +@testable import novawallet +import CoreData +import RobinHood +import SubstrateSdk + +final class ChainModelMapperV2V5 { + var entityIdentifierFieldName: String { #keyPath(CDChain.chainId) } + + typealias DataProviderModel = ChainModel + typealias CoreDataEntity = CDChain + + private lazy var jsonEncoder = JSONEncoder() + private lazy var jsonDecoder = JSONDecoder() + + private func createAsset(from entity: CDAsset) throws -> AssetModel { + let typeExtras: JSON? + + if let data = entity.typeExtras { + typeExtras = try jsonDecoder.decode(JSON.self, from: data) + } else { + typeExtras = nil + } + + let buyProviders: JSON? + + if let data = entity.buyProviders { + buyProviders = try jsonDecoder.decode(JSON.self, from: data) + } else { + buyProviders = nil + } + + return AssetModel( + assetId: UInt32(bitPattern: entity.assetId), + icon: entity.icon, + name: entity.name, + symbol: entity.symbol!, + precision: UInt16(bitPattern: entity.precision), + priceId: entity.priceId, + staking: entity.staking, + type: entity.type, + typeExtras: typeExtras, + buyProviders: buyProviders + ) + } + + private func createChainNode(from entity: CDChainNode) -> ChainNodeModel { + let apiKey: ChainNodeModel.ApiKey? + + if let queryName = entity.apiQueryName, let keyName = entity.apiKeyName { + apiKey = ChainNodeModel.ApiKey(queryName: queryName, keyName: keyName) + } else { + apiKey = nil + } + + return ChainNodeModel( + url: entity.url!, + name: entity.name!, + apikey: apiKey, + order: entity.order + ) + } + + private func updateEntityAssets( + for entity: CDChain, + from model: ChainModel, + context: NSManagedObjectContext + ) throws { + let assetEntities: [CDAsset] = try model.assets.map { asset in + let assetEntity: CDAsset + let assetEntityId = Int32(bitPattern: asset.assetId) + + let maybeExistingEntity = entity.assets? + .first { ($0 as? CDAsset)?.assetId == assetEntityId } as? CDAsset + + if let existingEntity = maybeExistingEntity { + assetEntity = existingEntity + } else { + assetEntity = CDAsset(context: context) + } + + assetEntity.assetId = assetEntityId + assetEntity.name = asset.name + assetEntity.precision = Int16(bitPattern: asset.precision) + assetEntity.icon = asset.icon + assetEntity.symbol = asset.symbol + assetEntity.priceId = asset.priceId + assetEntity.staking = asset.staking + assetEntity.type = asset.type + + if let json = asset.typeExtras { + assetEntity.typeExtras = try jsonEncoder.encode(json) + } else { + assetEntity.typeExtras = nil + } + + if let json = asset.buyProviders { + assetEntity.buyProviders = try jsonEncoder.encode(json) + } else { + assetEntity.buyProviders = nil + } + + return assetEntity + } + + let existingAssetIds = Set(model.assets.map(\.assetId)) + + if let oldAssets = entity.assets as? Set { + for oldAsset in oldAssets { + if !existingAssetIds.contains(UInt32(bitPattern: oldAsset.assetId)) { + context.delete(oldAsset) + } + } + } + + entity.assets = Set(assetEntities) as NSSet + } + + private func updateEntityNodes( + for entity: CDChain, + from model: ChainModel, + context: NSManagedObjectContext + ) { + let nodeEntities: [CDChainNode] = model.nodes.map { node in + let nodeEntity: CDChainNode + + let maybeExistingEntity = entity.nodes? + .first { ($0 as? CDChainNode)?.url == node.url } as? CDChainNode + + if let existingEntity = maybeExistingEntity { + nodeEntity = existingEntity + } else { + nodeEntity = CDChainNode(context: context) + } + + nodeEntity.url = node.url + nodeEntity.name = node.name + nodeEntity.apiQueryName = node.apikey?.queryName + nodeEntity.apiKeyName = node.apikey?.keyName + nodeEntity.order = node.order + + return nodeEntity + } + + let existingNodeIds = Set(model.nodes.map(\.url)) + + if let oldNodes = entity.nodes as? Set { + for oldNode in oldNodes { + if !existingNodeIds.contains(oldNode.url!) { + context.delete(oldNode) + } + } + } + + entity.nodes = Set(nodeEntities) as NSSet + } + + private func createExplorers(from chain: CDChain) -> [ChainModel.Explorer]? { + guard let data = chain.explorers else { + return nil + } + + return try? JSONDecoder().decode([ChainModel.Explorer].self, from: data) + } + + private func updateExplorers(for entity: CDChain, from explorers: [ChainModel.Explorer]?) { + if let explorers = explorers { + entity.explorers = try? JSONEncoder().encode(explorers) + } else { + entity.explorers = nil + } + } + + private func createExternalApi(from entity: CDChain) -> ChainModel.ExternalApiSet? { + let staking: ChainModel.ExternalApi? + + if let type = entity.stakingApiType, let url = entity.stakingApiUrl { + staking = ChainModel.ExternalApi(type: type, url: url) + } else { + staking = nil + } + + let history: ChainModel.ExternalApi? + + if let type = entity.historyApiType, let url = entity.historyApiUrl { + history = ChainModel.ExternalApi(type: type, url: url) + } else { + history = nil + } + + let crowdloans: ChainModel.ExternalApi? + + if let type = entity.crowdloansApiType, let url = entity.crowdloansApiUrl { + crowdloans = ChainModel.ExternalApi(type: type, url: url) + } else { + crowdloans = nil + } + + if staking != nil || history != nil || crowdloans != nil { + return ChainModel.ExternalApiSet( + staking: staking, + history: history, + crowdloans: crowdloans, + governance: nil + ) + } else { + return nil + } + } + + private func updateExternalApis(in entity: CDChain, from apis: ChainModel.ExternalApiSet?) { + entity.stakingApiType = apis?.staking?.type + entity.stakingApiUrl = apis?.staking?.url + + entity.historyApiType = apis?.history?.type + entity.historyApiUrl = apis?.history?.url + + entity.crowdloansApiType = apis?.crowdloans?.type + entity.crowdloansApiUrl = apis?.crowdloans?.url + } +} + +extension ChainModelMapperV2V5: CoreDataMapperProtocol { + func transform(entity: CDChain) throws -> ChainModel { + let assets: [AssetModel] = try entity.assets?.compactMap { anyAsset in + guard let asset = anyAsset as? CDAsset else { + return nil + } + + return try createAsset(from: asset) + } ?? [] + + let nodes: [ChainNodeModel] = entity.nodes?.compactMap { anyNode in + guard let node = anyNode as? CDChainNode else { + return nil + } + + return createChainNode(from: node) + } ?? [] + + let types: ChainModel.TypesSettings? + + if let url = entity.types, let overridesCommon = entity.typesOverrideCommon { + types = .init(url: url, overridesCommon: overridesCommon.boolValue) + } else { + types = nil + } + + var options: [ChainOptions] = [] + + if entity.isEthereumBased { + options.append(.ethereumBased) + } + + if entity.isTestnet { + options.append(.testnet) + } + + if entity.hasCrowdloans { + options.append(.crowdloans) + } + + let externalApiSet = createExternalApi(from: entity) + let explorers = createExplorers(from: entity) + + let additional: JSON? = try entity.additional.map { + try jsonDecoder.decode(JSON.self, from: $0) + } + + return ChainModel( + chainId: entity.chainId!, + parentId: entity.parentId, + name: entity.name!, + assets: Set(assets), + nodes: Set(nodes), + addressPrefix: UInt16(bitPattern: entity.addressPrefix), + types: types, + icon: entity.icon!, + options: options.isEmpty ? nil : options, + externalApi: externalApiSet, + explorers: explorers, + order: entity.order, + additional: additional + ) + } + + func populate( + entity: CDChain, + from model: ChainModel, + using context: NSManagedObjectContext + ) throws { + entity.chainId = model.chainId + entity.parentId = model.parentId + entity.name = model.name + entity.types = model.types?.url + entity.typesOverrideCommon = model.types.map { NSNumber(value: $0.overridesCommon) } + + entity.addressPrefix = Int16(bitPattern: model.addressPrefix) + entity.icon = model.icon + entity.isEthereumBased = model.isEthereumBased + entity.isTestnet = model.isTestnet + entity.hasCrowdloans = model.hasCrowdloans + entity.order = model.order + entity.additional = try model.additional.map { + try jsonEncoder.encode($0) + } + + try updateEntityAssets(for: entity, from: model, context: context) + + updateEntityNodes(for: entity, from: model, context: context) + + updateExternalApis(in: entity, from: model.externalApi) + + updateExplorers(for: entity, from: model.explorers) + } +} diff --git a/novawalletTests/Common/Migration/SubstrateStorageMigrationTests.swift b/novawalletTests/Common/Migration/SubstrateStorageMigrationTests.swift index a8edf0bdcb..d04ef3931d 100644 --- a/novawalletTests/Common/Migration/SubstrateStorageMigrationTests.swift +++ b/novawalletTests/Common/Migration/SubstrateStorageMigrationTests.swift @@ -15,6 +15,7 @@ final class SubstrateStorageMigrationTests: XCTestCase { let databaseName = SubstrateStorageParams.databaseName let modelDirectory = SubstrateStorageParams.modelDirectory var storeURL: URL { databaseDirectoryURL.appendingPathComponent(databaseName) } + let oldMapper = ChainModelMapperV2V5() let mapper = ChainModelMapper() override func setUpWithError() throws { @@ -30,14 +31,14 @@ final class SubstrateStorageMigrationTests: XCTestCase { try removeDirectory(at: databaseDirectoryURL) } - func testMigrationVersion1ToVersion2() { + func testMigrationVersion4ToVersion5() { let timeout: TimeInterval = 5 let generatedChains = generateChainsWithTimeout(timeout) XCTAssertGreaterThan(generatedChains.count, 0) let migrator = SubstrateStorageMigrator(storeURL: storeURL, modelDirectory: modelDirectory, - model: .version2, + model: .version5, fileManager: FileManager.default) XCTAssertTrue(migrator.requiresMigration(), "Migration is not required") @@ -94,7 +95,7 @@ final class SubstrateStorageMigrationTests: XCTestCase { private func generateChains(completion: @escaping (Result<[ChainModel], Error>) -> Void) { let chains = ChainModelGenerator.generate(count: 5) - let dbService = createCoreDataService(for: .version1) + let dbService = createCoreDataService(for: .version4) dbService.performAsync { [unowned self] (context, error) in if let error = error { @@ -115,9 +116,9 @@ final class SubstrateStorageMigrationTests: XCTestCase { throw TestError.unexpectedEntity } - try mapper.populate(entity: newChain, - from: $0, - using: context) + try oldMapper.populate(entity: newChain, + from: $0, + using: context) } @@ -131,7 +132,7 @@ final class SubstrateStorageMigrationTests: XCTestCase { } private func fetchChains(completion: @escaping (Result<[ChainModel], Error>) -> Void) { - let dbService = createCoreDataService(for: .version2) + let dbService = createCoreDataService(for: .version5) dbService.performAsync { [unowned self] (context, error) in if let error = error { diff --git a/novawalletTests/Common/Services/ChainRegistry/ChainRegistryTests.swift b/novawalletTests/Common/Services/ChainRegistry/ChainRegistryTests.swift index fe694270cc..bd72a7c87b 100644 --- a/novawalletTests/Common/Services/ChainRegistry/ChainRegistryTests.swift +++ b/novawalletTests/Common/Services/ChainRegistry/ChainRegistryTests.swift @@ -103,7 +103,8 @@ class ChainRegistryTests: XCTestCase { runtimeSyncService: runtimeSyncService, commonTypesSyncService: commonTypesSyncService, chainProvider: chainProvider, - specVersionSubscriptionFactory: specVersionSubscriptionFactory + specVersionSubscriptionFactory: specVersionSubscriptionFactory, + logger: Logger.shared ) registry.syncUp() diff --git a/novawalletTests/Helper/ChainModelGenerator.swift b/novawalletTests/Helper/ChainModelGenerator.swift index b90335453a..90f48ea8f3 100644 --- a/novawalletTests/Helper/ChainModelGenerator.swift +++ b/novawalletTests/Helper/ChainModelGenerator.swift @@ -7,7 +7,8 @@ enum ChainModelGenerator { count: Int, withTypes: Bool = true, hasStaking: Bool = false, - hasCrowdloans: Bool = false + hasCrowdloans: Bool = false, + hasGovernance: Bool = false ) -> [ChainModel] { (0..(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockAssetSelectionWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockAssetSelectionWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - } struct __VerificationProxy_AssetSelectionWireframeProtocol: Cuckoo.VerificationProxy { @@ -6868,18 +6828,6 @@ import BigInt return cuckoo_manager.verify("complete(on: AssetSelectionViewProtocol, selecting: ChainAsset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - } } @@ -6895,18 +6843,6 @@ import BigInt return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - } @@ -7918,65 +7854,75 @@ import Cuckoo import Cuckoo @testable import novawallet -import BigInt -import Foundation - - class MockCrowdloanContributionInteractorInputProtocol: CrowdloanContributionInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockDAppAuthConfirmViewProtocol: DAppAuthConfirmViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionInteractorInputProtocol + typealias MocksType = DAppAuthConfirmViewProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionInteractorInputProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionInteractorInputProtocol + typealias Stubbing = __StubbingProxy_DAppAuthConfirmViewProtocol + typealias Verification = __VerificationProxy_DAppAuthConfirmViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionInteractorInputProtocol? + private var __defaultImplStub: DAppAuthConfirmViewProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: DAppAuthConfirmViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } + + + - func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { + + func didReceive(viewModel: DAppAuthViewModel) { - return cuckoo_manager.call("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", - parameters: (amount, bonusService), - escapingParameters: (amount, bonusService), + return cuckoo_manager.call("didReceive(viewModel: DAppAuthViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee(for: amount, bonusService: bonusService)) + defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) } - struct __StubbingProxy_CrowdloanContributionInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppAuthConfirmViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -7984,19 +7930,24 @@ import Foundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt, CrowdloanBonusServiceProtocol?)> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorInputProtocol.self, method: "estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") + } + + + func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthViewModel)> where M1.MatchedType == DAppAuthViewModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmViewProtocol.self, method: "didReceive(viewModel: DAppAuthViewModel)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppAuthConfirmViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -8008,38 +7959,54 @@ import Foundation } - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + @discardableResult - func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.__DoNotUse<(BigUInt, CrowdloanBonusServiceProtocol?), Void> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] - return cuckoo_manager.verify("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(DAppAuthViewModel), Void> where M1.MatchedType == DAppAuthViewModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceive(viewModel: DAppAuthViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionInteractorInputProtocolStub: CrowdloanContributionInteractorInputProtocol { - - + class DAppAuthConfirmViewProtocolStub: DAppAuthConfirmViewProtocol { + - + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + + - func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { + + + func didReceive(viewModel: DAppAuthViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -8047,19 +8014,19 @@ import Foundation - class MockCrowdloanContributionInteractorOutputProtocol: CrowdloanContributionInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockDAppAuthConfirmPresenterProtocol: DAppAuthConfirmPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionInteractorOutputProtocol + typealias MocksType = DAppAuthConfirmPresenterProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionInteractorOutputProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_DAppAuthConfirmPresenterProtocol + typealias Verification = __VerificationProxy_DAppAuthConfirmPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionInteractorOutputProtocol? + private var __defaultImplStub: DAppAuthConfirmPresenterProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: DAppAuthConfirmPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -8072,171 +8039,51 @@ import Foundation - func didReceiveCrowdloan(result: Result) { - - return cuckoo_manager.call("didReceiveCrowdloan(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveCrowdloan(result: result)) - - } - - - - func didReceiveDisplayInfo(result: Result) { - - return cuckoo_manager.call("didReceiveDisplayInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveDisplayInfo(result: result)) - - } - - - - func didReceiveAccountInfo(result: Result) { - - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) - - } - - - - func didReceiveBlockNumber(result: Result) { - - return cuckoo_manager.call("didReceiveBlockNumber(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBlockNumber(result: result)) - - } - - - - func didReceiveBlockDuration(result: Result) { - - return cuckoo_manager.call("didReceiveBlockDuration(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBlockDuration(result: result)) - - } - - - - func didReceiveLeasingPeriod(result: Result) { - - return cuckoo_manager.call("didReceiveLeasingPeriod(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(result: result)) - - } - - - - func didReceiveLeasingOffset(result: Result) { - - return cuckoo_manager.call("didReceiveLeasingOffset(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingOffset(result: result)) - - } - - - - func didReceiveMinimumBalance(result: Result) { - - return cuckoo_manager.call("didReceiveMinimumBalance(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveMinimumBalance(result: result)) - - } - - - - func didReceiveMinimumContribution(result: Result) { + func setup() { - return cuckoo_manager.call("didReceiveMinimumContribution(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMinimumContribution(result: result)) + defaultCall: __defaultImplStub!.setup()) } - func didReceivePriceData(result: Result) { + func allow() { - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("allow()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + defaultCall: __defaultImplStub!.allow()) } - func didReceiveFee(result: Result) { + func deny() { - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("deny()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + defaultCall: __defaultImplStub!.deny()) } - struct __StubbingProxy_CrowdloanContributionInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppAuthConfirmPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -8244,64 +8091,24 @@ import Foundation } - func didReceiveCrowdloan(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveCrowdloan(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveDisplayInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveDisplayInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveBlockNumber(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveBlockNumber(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveBlockDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveBlockDuration(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveLeasingPeriod(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveLeasingOffset(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveMinimumBalance(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveMinimumBalance(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveMinimumContribution(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveMinimumContribution(result: Result)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + func allow() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmPresenterProtocol.self, method: "allow()", parameterMatchers: matchers)) } - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + func deny() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmPresenterProtocol.self, method: "deny()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppAuthConfirmPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -8316,75 +8123,27 @@ import Foundation @discardableResult - func didReceiveCrowdloan(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveCrowdloan(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveDisplayInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveDisplayInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBlockNumber(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBlockNumber(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBlockDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBlockDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveLeasingPeriod(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingPeriod(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveLeasingOffset(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingOffset(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveMinimumBalance(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinimumBalance(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveMinimumContribution(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinimumContribution(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func allow() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("allow()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func deny() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("deny()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionInteractorOutputProtocolStub: CrowdloanContributionInteractorOutputProtocol { + class DAppAuthConfirmPresenterProtocolStub: DAppAuthConfirmPresenterProtocol { @@ -8392,67 +8151,205 @@ import Foundation - func didReceiveCrowdloan(result: Result) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveDisplayInfo(result: Result) { + func allow() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveAccountInfo(result: Result) { + func deny() { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockDAppAuthConfirmWireframeProtocol: DAppAuthConfirmWireframeProtocol, Cuckoo.ProtocolMock { + typealias MocksType = DAppAuthConfirmWireframeProtocol - func didReceiveBlockNumber(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + typealias Stubbing = __StubbingProxy_DAppAuthConfirmWireframeProtocol + typealias Verification = __VerificationProxy_DAppAuthConfirmWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: DAppAuthConfirmWireframeProtocol? + + func enableDefaultImplementation(_ stub: DAppAuthConfirmWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didReceiveBlockDuration(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceiveLeasingPeriod(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func close(from view: DAppAuthConfirmViewProtocol?) { + + return cuckoo_manager.call("close(from: DAppAuthConfirmViewProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.close(from: view)) + } + + struct __StubbingProxy_DAppAuthConfirmWireframeProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func close(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthConfirmViewProtocol?)> where M1.OptionalMatchedType == DAppAuthConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmWireframeProtocol.self, method: "close(from: DAppAuthConfirmViewProtocol?)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_DAppAuthConfirmWireframeProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func close(from view: M1) -> Cuckoo.__DoNotUse<(DAppAuthConfirmViewProtocol?), Void> where M1.OptionalMatchedType == DAppAuthConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(from: DAppAuthConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class DAppAuthConfirmWireframeProtocolStub: DAppAuthConfirmWireframeProtocol { + - func didReceiveLeasingOffset(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceiveMinimumBalance(result: Result) { + func close(from view: DAppAuthConfirmViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockDAppAuthDelegate: DAppAuthDelegate, Cuckoo.ProtocolMock { + + typealias MocksType = DAppAuthDelegate + typealias Stubbing = __StubbingProxy_DAppAuthDelegate + typealias Verification = __VerificationProxy_DAppAuthDelegate + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func didReceiveMinimumContribution(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + private var __defaultImplStub: DAppAuthDelegate? + + func enableDefaultImplementation(_ stub: DAppAuthDelegate) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didReceivePriceData(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + + + + + func didReceiveAuthResponse(_ response: DAppAuthResponse, for request: DAppAuthRequest) { + + return cuckoo_manager.call("didReceiveAuthResponse(_: DAppAuthResponse, for: DAppAuthRequest)", + parameters: (response, request), + escapingParameters: (response, request), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAuthResponse(response, for: request)) + } + + struct __StubbingProxy_DAppAuthDelegate: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func didReceiveAuthResponse(_ response: M1, for request: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthResponse, DAppAuthRequest)> where M1.MatchedType == DAppAuthResponse, M2.MatchedType == DAppAuthRequest { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthResponse, DAppAuthRequest)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: request) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthDelegate.self, method: "didReceiveAuthResponse(_: DAppAuthResponse, for: DAppAuthRequest)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_DAppAuthDelegate: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didReceiveAuthResponse(_ response: M1, for request: M2) -> Cuckoo.__DoNotUse<(DAppAuthResponse, DAppAuthRequest), Void> where M1.MatchedType == DAppAuthResponse, M2.MatchedType == DAppAuthRequest { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthResponse, DAppAuthRequest)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: request) { $0.1 }] + return cuckoo_manager.verify("didReceiveAuthResponse(_: DAppAuthResponse, for: DAppAuthRequest)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class DAppAuthDelegateStub: DAppAuthDelegate { + + + - func didReceiveFee(result: Result) { + + + func didReceiveAuthResponse(_ response: DAppAuthResponse, for request: DAppAuthRequest) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -8462,23 +8359,23 @@ import Foundation import Cuckoo @testable import novawallet -import BigInt -import SoraFoundation +import Foundation +import RobinHood - class MockCrowdloanContributionConfirmViewProtocol: CrowdloanContributionConfirmViewProtocol, Cuckoo.ProtocolMock { + class MockDAppBrowserViewProtocol: DAppBrowserViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionConfirmViewProtocol + typealias MocksType = DAppBrowserViewProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmViewProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionConfirmViewProtocol + typealias Stubbing = __StubbingProxy_DAppBrowserViewProtocol + typealias Verification = __VerificationProxy_DAppBrowserViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionConfirmViewProtocol? + private var __defaultImplStub: DAppBrowserViewProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmViewProtocol) { + func enableDefaultImplementation(_ stub: DAppBrowserViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -8513,199 +8410,72 @@ import SoraFoundation } - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } - - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - - } - - - - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } - - } - - func didReceiveAsset(viewModel: AssetBalanceViewModelProtocol) { - - return cuckoo_manager.call("didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) - - } - - - - func didReceiveFee(viewModel: BalanceViewModelProtocol?) { - - return cuckoo_manager.call("didReceiveFee(viewModel: BalanceViewModelProtocol?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) - - } - - - - func didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel) { - - return cuckoo_manager.call("didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveCrowdloan(viewModel: viewModel)) - - } - - - - func didReceiveEstimatedReward(viewModel: String?) { - - return cuckoo_manager.call("didReceiveEstimatedReward(viewModel: String?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveEstimatedReward(viewModel: viewModel)) - - } - - - - func didReceiveBonus(viewModel: String?) { - - return cuckoo_manager.call("didReceiveBonus(viewModel: String?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBonus(viewModel: viewModel)) - - } - - - - func didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM) { + func didReceive(viewModel: DAppBrowserModel) { - return cuckoo_manager.call("didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", + return cuckoo_manager.call("didReceive(viewModel: DAppBrowserModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveRewardDestination(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) } - public func applyLocalization() { + func didReceive(response: DAppScriptResponse, forTransport name: String) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(response: DAppScriptResponse, forTransport: String)", + parameters: (response, name), + escapingParameters: (response, name), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.didReceive(response: response, forTransport: name)) } - func didStartLoading() { + func didReceiveReplacement(transports: [DAppTransportModel], postExecution script: DAppScriptResponse) { - return cuckoo_manager.call("didStartLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", + parameters: (transports, script), + escapingParameters: (transports, script), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.didReceiveReplacement(transports: transports, postExecution: script)) } - func didStopLoading() { + func didReceiveFavorite(flag: Bool) { - return cuckoo_manager.call("didStopLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveFavorite(flag: Bool)", + parameters: (flag), + escapingParameters: (flag), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.didReceiveFavorite(flag: flag)) } - struct __StubbingProxy_CrowdloanContributionConfirmViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppBrowserViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -8713,79 +8483,39 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") - } - - - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") - } - - - func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AssetBalanceViewModelProtocol)> where M1.MatchedType == AssetBalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AssetBalanceViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", parameterMatchers: matchers)) - } - - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BalanceViewModelProtocol?)> where M1.OptionalMatchedType == BalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveFee(viewModel: BalanceViewModelProtocol?)", parameterMatchers: matchers)) - } - - func didReceiveCrowdloan(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributeConfirmViewModel)> where M1.MatchedType == CrowdloanContributeConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributeConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel)", parameterMatchers: matchers)) - } - - func didReceiveEstimatedReward(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveEstimatedReward(viewModel: String?)", parameterMatchers: matchers)) - } - - func didReceiveBonus(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveBonus(viewModel: String?)", parameterMatchers: matchers)) - } - - func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanRewardDestinationVM)> where M1.MatchedType == CrowdloanRewardDestinationVM { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanRewardDestinationVM)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", parameterMatchers: matchers)) + func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserModel)> where M1.MatchedType == DAppBrowserModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceive(viewModel: DAppBrowserModel)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func didReceive(response: M1, forTransport name: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppScriptResponse, String)> where M1.MatchedType == DAppScriptResponse, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(DAppScriptResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceive(response: DAppScriptResponse, forTransport: String)", parameterMatchers: matchers)) } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + func didReceiveReplacement(transports: M1, postExecution script: M2) -> Cuckoo.ProtocolStubNoReturnFunction<([DAppTransportModel], DAppScriptResponse)> where M1.MatchedType == [DAppTransportModel], M2.MatchedType == DAppScriptResponse { + let matchers: [Cuckoo.ParameterMatcher<([DAppTransportModel], DAppScriptResponse)>] = [wrap(matchable: transports) { $0.0 }, wrap(matchable: script) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", parameterMatchers: matchers)) } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + func didReceiveFavorite(flag: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: flag) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceiveFavorite(flag: Bool)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionConfirmViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppBrowserViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -8807,81 +8537,36 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(AssetBalanceViewModelProtocol), Void> where M1.MatchedType == AssetBalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AssetBalanceViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(BalanceViewModelProtocol?), Void> where M1.OptionalMatchedType == BalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: BalanceViewModelProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveCrowdloan(viewModel: M1) -> Cuckoo.__DoNotUse<(CrowdloanContributeConfirmViewModel), Void> where M1.MatchedType == CrowdloanContributeConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributeConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveEstimatedReward(viewModel: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveEstimatedReward(viewModel: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBonus(viewModel: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveBonus(viewModel: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.__DoNotUse<(CrowdloanRewardDestinationVM), Void> where M1.MatchedType == CrowdloanRewardDestinationVM { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanRewardDestinationVM)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(DAppBrowserModel), Void> where M1.MatchedType == DAppBrowserModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceive(viewModel: DAppBrowserModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(response: M1, forTransport name: M2) -> Cuckoo.__DoNotUse<(DAppScriptResponse, String), Void> where M1.MatchedType == DAppScriptResponse, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(DAppScriptResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] + return cuckoo_manager.verify("didReceive(response: DAppScriptResponse, forTransport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveReplacement(transports: M1, postExecution script: M2) -> Cuckoo.__DoNotUse<([DAppTransportModel], DAppScriptResponse), Void> where M1.MatchedType == [DAppTransportModel], M2.MatchedType == DAppScriptResponse { + let matchers: [Cuckoo.ParameterMatcher<([DAppTransportModel], DAppScriptResponse)>] = [wrap(matchable: transports) { $0.0 }, wrap(matchable: script) { $0.1 }] + return cuckoo_manager.verify("didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFavorite(flag: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: flag) { $0 }] + return cuckoo_manager.verify("didReceiveFavorite(flag: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionConfirmViewProtocolStub: CrowdloanContributionConfirmViewProtocol { + class DAppBrowserViewProtocolStub: DAppBrowserViewProtocol { @@ -8900,35 +8585,6 @@ import SoraFoundation } } - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - - } - - - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } @@ -8936,75 +8592,45 @@ import SoraFoundation - func didReceiveAsset(viewModel: AssetBalanceViewModelProtocol) { + func didReceive(viewModel: DAppBrowserModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFee(viewModel: BalanceViewModelProtocol?) { + func didReceive(response: DAppScriptResponse, forTransport name: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel) { + func didReceiveReplacement(transports: [DAppTransportModel], postExecution script: DAppScriptResponse) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveEstimatedReward(viewModel: String?) { + func didReceiveFavorite(flag: Bool) { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockDAppBrowserPresenterProtocol: DAppBrowserPresenterProtocol, Cuckoo.ProtocolMock { + typealias MocksType = DAppBrowserPresenterProtocol - func didReceiveBonus(viewModel: String?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - public func applyLocalization() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didStartLoading() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didStopLoading() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - - - class MockCrowdloanContributionConfirmPresenterProtocol: CrowdloanContributionConfirmPresenterProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = CrowdloanContributionConfirmPresenterProtocol - - typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmPresenterProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionConfirmPresenterProtocol + typealias Stubbing = __StubbingProxy_DAppBrowserPresenterProtocol + typealias Verification = __VerificationProxy_DAppBrowserPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionConfirmPresenterProtocol? + private var __defaultImplStub: DAppBrowserPresenterProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmPresenterProtocol) { + func enableDefaultImplementation(_ stub: DAppBrowserPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -9032,51 +8658,81 @@ import SoraFoundation - func confirm() { + func process(page: DAppBrowserPage) { - return cuckoo_manager.call("confirm()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("process(page: DAppBrowserPage)", + parameters: (page), + escapingParameters: (page), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.confirm()) + defaultCall: __defaultImplStub!.process(page: page)) } - func presentAccountOptions() { + func process(message: Any, host: String, transport name: String) { - return cuckoo_manager.call("presentAccountOptions()", + return cuckoo_manager.call("process(message: Any, host: String, transport: String)", + parameters: (message, host, name), + escapingParameters: (message, host, name), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.process(message: message, host: host, transport: name)) + + } + + + + func activateSearch(with query: String?) { + + return cuckoo_manager.call("activateSearch(with: String?)", + parameters: (query), + escapingParameters: (query), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.activateSearch(with: query)) + + } + + + + func toggleFavorite() { + + return cuckoo_manager.call("toggleFavorite()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentAccountOptions()) + defaultCall: __defaultImplStub!.toggleFavorite()) } - func presentRewardDestination() { + func close() { - return cuckoo_manager.call("presentRewardDestination()", + return cuckoo_manager.call("close()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentRewardDestination()) + defaultCall: __defaultImplStub!.close()) } - struct __StubbingProxy_CrowdloanContributionConfirmPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppBrowserPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -9086,27 +8742,37 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + func process(page: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserPage)> where M1.MatchedType == DAppBrowserPage { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserPage)>] = [wrap(matchable: page) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "process(page: DAppBrowserPage)", parameterMatchers: matchers)) } - func presentAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func process(message: M1, host: M2, transport name: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(Any, String, String)> where M1.MatchedType == Any, M2.MatchedType == String, M3.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(Any, String, String)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: host) { $0.1 }, wrap(matchable: name) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "process(message: Any, host: String, transport: String)", parameterMatchers: matchers)) + } + + func activateSearch(with query: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: query) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "activateSearch(with: String?)", parameterMatchers: matchers)) + } + + func toggleFavorite() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmPresenterProtocol.self, method: "presentAccountOptions()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "toggleFavorite()", parameterMatchers: matchers)) } - func presentRewardDestination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func close() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmPresenterProtocol.self, method: "presentRewardDestination()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "close()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionConfirmPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppBrowserPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -9127,27 +8793,39 @@ import SoraFoundation } @discardableResult - func confirm() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func process(page: M1) -> Cuckoo.__DoNotUse<(DAppBrowserPage), Void> where M1.MatchedType == DAppBrowserPage { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserPage)>] = [wrap(matchable: page) { $0 }] + return cuckoo_manager.verify("process(page: DAppBrowserPage)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { + func process(message: M1, host: M2, transport name: M3) -> Cuckoo.__DoNotUse<(Any, String, String), Void> where M1.MatchedType == Any, M2.MatchedType == String, M3.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(Any, String, String)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: host) { $0.1 }, wrap(matchable: name) { $0.2 }] + return cuckoo_manager.verify("process(message: Any, host: String, transport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func activateSearch(with query: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: query) { $0 }] + return cuckoo_manager.verify("activateSearch(with: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func toggleFavorite() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("toggleFavorite()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentRewardDestination() -> Cuckoo.__DoNotUse<(), Void> { + func close() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentRewardDestination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("close()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionConfirmPresenterProtocolStub: CrowdloanContributionConfirmPresenterProtocol { + class DAppBrowserPresenterProtocolStub: DAppBrowserPresenterProtocol { @@ -9161,19 +8839,31 @@ import SoraFoundation - func confirm() { + func process(page: DAppBrowserPage) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentAccountOptions() { + func process(message: Any, host: String, transport name: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentRewardDestination() { + func activateSearch(with query: String?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func toggleFavorite() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func close() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -9181,19 +8871,19 @@ import SoraFoundation - class MockCrowdloanContributionConfirmInteractorInputProtocol: CrowdloanContributionConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockDAppBrowserInteractorInputProtocol: DAppBrowserInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionConfirmInteractorInputProtocol + typealias MocksType = DAppBrowserInteractorInputProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmInteractorInputProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionConfirmInteractorInputProtocol + typealias Stubbing = __StubbingProxy_DAppBrowserInteractorInputProtocol + typealias Verification = __VerificationProxy_DAppBrowserInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionConfirmInteractorInputProtocol? + private var __defaultImplStub: DAppBrowserInteractorInputProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: DAppBrowserInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -9206,66 +8896,126 @@ import SoraFoundation - func estimateFee(for contribution: BigUInt) { + func setup() { - return cuckoo_manager.call("estimateFee(for: BigUInt)", - parameters: (contribution), - escapingParameters: (contribution), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee(for: contribution)) + defaultCall: __defaultImplStub!.setup()) } - func submit(contribution: BigUInt) { + func process(host: String) { - return cuckoo_manager.call("submit(contribution: BigUInt)", - parameters: (contribution), - escapingParameters: (contribution), + return cuckoo_manager.call("process(host: String)", + parameters: (host), + escapingParameters: (host), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.submit(contribution: contribution)) + defaultCall: __defaultImplStub!.process(host: host)) } - func setup() { + func process(message: Any, host: String, transport name: String) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("process(message: Any, host: String, transport: String)", + parameters: (message, host, name), + escapingParameters: (message, host, name), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.process(message: message, host: host, transport: name)) } - func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { + func processConfirmation(response: DAppOperationResponse, forTransport name: String) { - return cuckoo_manager.call("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", - parameters: (amount, bonusService), - escapingParameters: (amount, bonusService), + return cuckoo_manager.call("processConfirmation(response: DAppOperationResponse, forTransport: String)", + parameters: (response, name), + escapingParameters: (response, name), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee(for: amount, bonusService: bonusService)) + defaultCall: __defaultImplStub!.processConfirmation(response: response, forTransport: name)) + + } + + + + func process(newQuery: DAppSearchResult) { + + return cuckoo_manager.call("process(newQuery: DAppSearchResult)", + parameters: (newQuery), + escapingParameters: (newQuery), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.process(newQuery: newQuery)) + + } + + + + func processAuth(response: DAppAuthResponse, forTransport name: String) { + + return cuckoo_manager.call("processAuth(response: DAppAuthResponse, forTransport: String)", + parameters: (response, name), + escapingParameters: (response, name), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.processAuth(response: response, forTransport: name)) + + } + + + + func removeFromFavorites(record: DAppFavorite) { + + return cuckoo_manager.call("removeFromFavorites(record: DAppFavorite)", + parameters: (record), + escapingParameters: (record), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.removeFromFavorites(record: record)) + + } + + + + func reload() { + + return cuckoo_manager.call("reload()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.reload()) } - struct __StubbingProxy_CrowdloanContributionConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppBrowserInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -9273,29 +9023,49 @@ import SoraFoundation } - func estimateFee(for contribution: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt)> where M1.MatchedType == BigUInt { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt)>] = [wrap(matchable: contribution) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorInputProtocol.self, method: "estimateFee(for: BigUInt)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func submit(contribution: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt)> where M1.MatchedType == BigUInt { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt)>] = [wrap(matchable: contribution) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorInputProtocol.self, method: "submit(contribution: BigUInt)", parameterMatchers: matchers)) + func process(host: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: host) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "process(host: String)", parameterMatchers: matchers)) } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + func process(message: M1, host: M2, transport name: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(Any, String, String)> where M1.MatchedType == Any, M2.MatchedType == String, M3.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(Any, String, String)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: host) { $0.1 }, wrap(matchable: name) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "process(message: Any, host: String, transport: String)", parameterMatchers: matchers)) } - func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt, CrowdloanBonusServiceProtocol?)> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorInputProtocol.self, method: "estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) + func processConfirmation(response: M1, forTransport name: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationResponse, String)> where M1.MatchedType == DAppOperationResponse, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "processConfirmation(response: DAppOperationResponse, forTransport: String)", parameterMatchers: matchers)) + } + + func process(newQuery: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppSearchResult)> where M1.MatchedType == DAppSearchResult { + let matchers: [Cuckoo.ParameterMatcher<(DAppSearchResult)>] = [wrap(matchable: newQuery) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "process(newQuery: DAppSearchResult)", parameterMatchers: matchers)) + } + + func processAuth(response: M1, forTransport name: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthResponse, String)> where M1.MatchedType == DAppAuthResponse, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "processAuth(response: DAppAuthResponse, forTransport: String)", parameterMatchers: matchers)) + } + + func removeFromFavorites(record: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppFavorite)> where M1.MatchedType == DAppFavorite { + let matchers: [Cuckoo.ParameterMatcher<(DAppFavorite)>] = [wrap(matchable: record) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "removeFromFavorites(record: DAppFavorite)", parameterMatchers: matchers)) + } + + func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "reload()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppBrowserInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -9310,33 +9080,57 @@ import SoraFoundation @discardableResult - func estimateFee(for contribution: M1) -> Cuckoo.__DoNotUse<(BigUInt), Void> where M1.MatchedType == BigUInt { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt)>] = [wrap(matchable: contribution) { $0 }] - return cuckoo_manager.verify("estimateFee(for: BigUInt)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func submit(contribution: M1) -> Cuckoo.__DoNotUse<(BigUInt), Void> where M1.MatchedType == BigUInt { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt)>] = [wrap(matchable: contribution) { $0 }] - return cuckoo_manager.verify("submit(contribution: BigUInt)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func process(host: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: host) { $0 }] + return cuckoo_manager.verify("process(host: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func process(message: M1, host: M2, transport name: M3) -> Cuckoo.__DoNotUse<(Any, String, String), Void> where M1.MatchedType == Any, M2.MatchedType == String, M3.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(Any, String, String)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: host) { $0.1 }, wrap(matchable: name) { $0.2 }] + return cuckoo_manager.verify("process(message: Any, host: String, transport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.__DoNotUse<(BigUInt, CrowdloanBonusServiceProtocol?), Void> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] - return cuckoo_manager.verify("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func processConfirmation(response: M1, forTransport name: M2) -> Cuckoo.__DoNotUse<(DAppOperationResponse, String), Void> where M1.MatchedType == DAppOperationResponse, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] + return cuckoo_manager.verify("processConfirmation(response: DAppOperationResponse, forTransport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func process(newQuery: M1) -> Cuckoo.__DoNotUse<(DAppSearchResult), Void> where M1.MatchedType == DAppSearchResult { + let matchers: [Cuckoo.ParameterMatcher<(DAppSearchResult)>] = [wrap(matchable: newQuery) { $0 }] + return cuckoo_manager.verify("process(newQuery: DAppSearchResult)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func processAuth(response: M1, forTransport name: M2) -> Cuckoo.__DoNotUse<(DAppAuthResponse, String), Void> where M1.MatchedType == DAppAuthResponse, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] + return cuckoo_manager.verify("processAuth(response: DAppAuthResponse, forTransport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func removeFromFavorites(record: M1) -> Cuckoo.__DoNotUse<(DAppFavorite), Void> where M1.MatchedType == DAppFavorite { + let matchers: [Cuckoo.ParameterMatcher<(DAppFavorite)>] = [wrap(matchable: record) { $0 }] + return cuckoo_manager.verify("removeFromFavorites(record: DAppFavorite)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func reload() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionConfirmInteractorInputProtocolStub: CrowdloanContributionConfirmInteractorInputProtocol { + class DAppBrowserInteractorInputProtocolStub: DAppBrowserInteractorInputProtocol { @@ -9344,25 +9138,49 @@ import SoraFoundation - func estimateFee(for contribution: BigUInt) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func submit(contribution: BigUInt) { + func process(host: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func setup() { + func process(message: Any, host: String, transport name: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { + func processConfirmation(response: DAppOperationResponse, forTransport name: String) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func process(newQuery: DAppSearchResult) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func processAuth(response: DAppAuthResponse, forTransport name: String) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func removeFromFavorites(record: DAppFavorite) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func reload() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -9370,19 +9188,19 @@ import SoraFoundation - class MockCrowdloanContributionConfirmInteractorOutputProtocol: CrowdloanContributionConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockDAppBrowserInteractorOutputProtocol: DAppBrowserInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionConfirmInteractorOutputProtocol + typealias MocksType = DAppBrowserInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmInteractorOutputProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionConfirmInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_DAppBrowserInteractorOutputProtocol + typealias Verification = __VerificationProxy_DAppBrowserInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionConfirmInteractorOutputProtocol? + private var __defaultImplStub: DAppBrowserInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: DAppBrowserInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -9395,216 +9213,126 @@ import SoraFoundation - func didSubmitContribution(result: Result) { + func didReceive(error: Error) { - return cuckoo_manager.call("didSubmitContribution(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceive(error: Error)", + parameters: (error), + escapingParameters: (error), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSubmitContribution(result: result)) + defaultCall: __defaultImplStub!.didReceive(error: error)) } - func didReceiveDisplayAddress(result: Result) { + func didReceiveDApp(model: DAppBrowserModel) { - return cuckoo_manager.call("didReceiveDisplayAddress(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveDApp(model: DAppBrowserModel)", + parameters: (model), + escapingParameters: (model), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveDisplayAddress(result: result)) + defaultCall: __defaultImplStub!.didReceiveDApp(model: model)) } - func didReceiveRewardDestinationAddress(_ address: AccountAddress) { + func didReceiveReplacement(transports: [DAppTransportModel], postExecution script: DAppScriptResponse) { - return cuckoo_manager.call("didReceiveRewardDestinationAddress(_: AccountAddress)", - parameters: (address), - escapingParameters: (address), + return cuckoo_manager.call("didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", + parameters: (transports, script), + escapingParameters: (transports, script), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveRewardDestinationAddress(address)) + defaultCall: __defaultImplStub!.didReceiveReplacement(transports: transports, postExecution: script)) } - func didReceiveCrowdloan(result: Result) { + func didReceive(response: DAppScriptResponse, forTransport name: String) { - return cuckoo_manager.call("didReceiveCrowdloan(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceive(response: DAppScriptResponse, forTransport: String)", + parameters: (response, name), + escapingParameters: (response, name), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveCrowdloan(result: result)) + defaultCall: __defaultImplStub!.didReceive(response: response, forTransport: name)) } - func didReceiveDisplayInfo(result: Result) { + func didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType) { - return cuckoo_manager.call("didReceiveDisplayInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType)", + parameters: (request, type), + escapingParameters: (request, type), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveDisplayInfo(result: result)) + defaultCall: __defaultImplStub!.didReceiveConfirmation(request: request, type: type)) } - func didReceiveAccountInfo(result: Result) { + func didReceiveAuth(request: DAppAuthRequest) { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveAuth(request: DAppAuthRequest)", + parameters: (request), + escapingParameters: (request), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.didReceiveAuth(request: request)) } - func didReceiveBlockNumber(result: Result) { + func didDetectPhishing(host: String) { - return cuckoo_manager.call("didReceiveBlockNumber(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didDetectPhishing(host: String)", + parameters: (host), + escapingParameters: (host), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveBlockNumber(result: result)) + defaultCall: __defaultImplStub!.didDetectPhishing(host: host)) } - func didReceiveBlockDuration(result: Result) { + func didReceiveFavorite(changes: [DataProviderChange]) { - return cuckoo_manager.call("didReceiveBlockDuration(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveFavorite(changes: [DataProviderChange])", + parameters: (changes), + escapingParameters: (changes), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveBlockDuration(result: result)) - - } - - - - func didReceiveLeasingPeriod(result: Result) { - - return cuckoo_manager.call("didReceiveLeasingPeriod(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(result: result)) - - } - - - - func didReceiveLeasingOffset(result: Result) { - - return cuckoo_manager.call("didReceiveLeasingOffset(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingOffset(result: result)) - - } - - - - func didReceiveMinimumBalance(result: Result) { - - return cuckoo_manager.call("didReceiveMinimumBalance(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveMinimumBalance(result: result)) - - } - - - - func didReceiveMinimumContribution(result: Result) { - - return cuckoo_manager.call("didReceiveMinimumContribution(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveMinimumContribution(result: result)) - - } - - - - func didReceivePriceData(result: Result) { - - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) - - } - - - - func didReceiveFee(result: Result) { - - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + defaultCall: __defaultImplStub!.didReceiveFavorite(changes: changes)) } - struct __StubbingProxy_CrowdloanContributionConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppBrowserInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -9612,79 +9340,49 @@ import SoraFoundation } - func didSubmitContribution(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didSubmitContribution(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveDisplayAddress(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveDisplayAddress(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveRewardDestinationAddress(_ address: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: address) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveRewardDestinationAddress(_: AccountAddress)", parameterMatchers: matchers)) - } - - func didReceiveCrowdloan(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveCrowdloan(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveDisplayInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveDisplayInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveBlockNumber(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveBlockNumber(result: Result)", parameterMatchers: matchers)) + func didReceive(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceive(error: Error)", parameterMatchers: matchers)) } - func didReceiveBlockDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveBlockDuration(result: Result)", parameterMatchers: matchers)) + func didReceiveDApp(model: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserModel)> where M1.MatchedType == DAppBrowserModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserModel)>] = [wrap(matchable: model) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveDApp(model: DAppBrowserModel)", parameterMatchers: matchers)) } - func didReceiveLeasingPeriod(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(result: Result)", parameterMatchers: matchers)) + func didReceiveReplacement(transports: M1, postExecution script: M2) -> Cuckoo.ProtocolStubNoReturnFunction<([DAppTransportModel], DAppScriptResponse)> where M1.MatchedType == [DAppTransportModel], M2.MatchedType == DAppScriptResponse { + let matchers: [Cuckoo.ParameterMatcher<([DAppTransportModel], DAppScriptResponse)>] = [wrap(matchable: transports) { $0.0 }, wrap(matchable: script) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", parameterMatchers: matchers)) } - func didReceiveLeasingOffset(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(result: Result)", parameterMatchers: matchers)) + func didReceive(response: M1, forTransport name: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppScriptResponse, String)> where M1.MatchedType == DAppScriptResponse, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(DAppScriptResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceive(response: DAppScriptResponse, forTransport: String)", parameterMatchers: matchers)) } - func didReceiveMinimumBalance(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveMinimumBalance(result: Result)", parameterMatchers: matchers)) + func didReceiveConfirmation(request: M1, type: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationRequest, DAppSigningType)> where M1.MatchedType == DAppOperationRequest, M2.MatchedType == DAppSigningType { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationRequest, DAppSigningType)>] = [wrap(matchable: request) { $0.0 }, wrap(matchable: type) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType)", parameterMatchers: matchers)) } - func didReceiveMinimumContribution(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveMinimumContribution(result: Result)", parameterMatchers: matchers)) + func didReceiveAuth(request: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthRequest)> where M1.MatchedType == DAppAuthRequest { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthRequest)>] = [wrap(matchable: request) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveAuth(request: DAppAuthRequest)", parameterMatchers: matchers)) } - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + func didDetectPhishing(host: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: host) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didDetectPhishing(host: String)", parameterMatchers: matchers)) } - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + func didReceiveFavorite(changes: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([DataProviderChange])> where M1.MatchedType == [DataProviderChange] { + let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveFavorite(changes: [DataProviderChange])", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppBrowserInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -9699,93 +9397,57 @@ import SoraFoundation @discardableResult - func didSubmitContribution(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didSubmitContribution(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveDisplayAddress(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveDisplayAddress(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveRewardDestinationAddress(_ address: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: address) { $0 }] - return cuckoo_manager.verify("didReceiveRewardDestinationAddress(_: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveCrowdloan(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveCrowdloan(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveDisplayInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveDisplayInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBlockNumber(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBlockNumber(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return cuckoo_manager.verify("didReceive(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveBlockDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBlockDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveDApp(model: M1) -> Cuckoo.__DoNotUse<(DAppBrowserModel), Void> where M1.MatchedType == DAppBrowserModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserModel)>] = [wrap(matchable: model) { $0 }] + return cuckoo_manager.verify("didReceiveDApp(model: DAppBrowserModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveLeasingPeriod(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingPeriod(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveReplacement(transports: M1, postExecution script: M2) -> Cuckoo.__DoNotUse<([DAppTransportModel], DAppScriptResponse), Void> where M1.MatchedType == [DAppTransportModel], M2.MatchedType == DAppScriptResponse { + let matchers: [Cuckoo.ParameterMatcher<([DAppTransportModel], DAppScriptResponse)>] = [wrap(matchable: transports) { $0.0 }, wrap(matchable: script) { $0.1 }] + return cuckoo_manager.verify("didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveLeasingOffset(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingOffset(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(response: M1, forTransport name: M2) -> Cuckoo.__DoNotUse<(DAppScriptResponse, String), Void> where M1.MatchedType == DAppScriptResponse, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(DAppScriptResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] + return cuckoo_manager.verify("didReceive(response: DAppScriptResponse, forTransport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveMinimumBalance(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinimumBalance(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveConfirmation(request: M1, type: M2) -> Cuckoo.__DoNotUse<(DAppOperationRequest, DAppSigningType), Void> where M1.MatchedType == DAppOperationRequest, M2.MatchedType == DAppSigningType { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationRequest, DAppSigningType)>] = [wrap(matchable: request) { $0.0 }, wrap(matchable: type) { $0.1 }] + return cuckoo_manager.verify("didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveMinimumContribution(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinimumContribution(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAuth(request: M1) -> Cuckoo.__DoNotUse<(DAppAuthRequest), Void> where M1.MatchedType == DAppAuthRequest { + let matchers: [Cuckoo.ParameterMatcher<(DAppAuthRequest)>] = [wrap(matchable: request) { $0 }] + return cuckoo_manager.verify("didReceiveAuth(request: DAppAuthRequest)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didDetectPhishing(host: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: host) { $0 }] + return cuckoo_manager.verify("didDetectPhishing(host: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFavorite(changes: M1) -> Cuckoo.__DoNotUse<([DataProviderChange]), Void> where M1.MatchedType == [DataProviderChange] { + let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] + return cuckoo_manager.verify("didReceiveFavorite(changes: [DataProviderChange])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionConfirmInteractorOutputProtocolStub: CrowdloanContributionConfirmInteractorOutputProtocol { + class DAppBrowserInteractorOutputProtocolStub: DAppBrowserInteractorOutputProtocol { @@ -9793,85 +9455,49 @@ import SoraFoundation - func didSubmitContribution(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveDisplayAddress(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveRewardDestinationAddress(_ address: AccountAddress) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveCrowdloan(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveDisplayInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveBlockNumber(result: Result) { + func didReceive(error: Error) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveBlockDuration(result: Result) { + func didReceiveDApp(model: DAppBrowserModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveLeasingPeriod(result: Result) { + func didReceiveReplacement(transports: [DAppTransportModel], postExecution script: DAppScriptResponse) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveLeasingOffset(result: Result) { + func didReceive(response: DAppScriptResponse, forTransport name: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveMinimumBalance(result: Result) { + func didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveMinimumContribution(result: Result) { + func didReceiveAuth(request: DAppAuthRequest) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceivePriceData(result: Result) { + func didDetectPhishing(host: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFee(result: Result) { + func didReceiveFavorite(changes: [DataProviderChange]) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -9879,19 +9505,19 @@ import SoraFoundation - class MockCrowdloanContributionConfirmWireframeProtocol: CrowdloanContributionConfirmWireframeProtocol, Cuckoo.ProtocolMock { + class MockDAppBrowserWireframeProtocol: DAppBrowserWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionConfirmWireframeProtocol + typealias MocksType = DAppBrowserWireframeProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmWireframeProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionConfirmWireframeProtocol + typealias Stubbing = __StubbingProxy_DAppBrowserWireframeProtocol + typealias Verification = __VerificationProxy_DAppBrowserWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionConfirmWireframeProtocol? + private var __defaultImplStub: DAppBrowserWireframeProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmWireframeProtocol) { + func enableDefaultImplementation(_ stub: DAppBrowserWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -9904,51 +9530,96 @@ import SoraFoundation - func complete(on view: CrowdloanContributionConfirmViewProtocol?) { + func presentOperationConfirm(from view: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate) { - return cuckoo_manager.call("complete(on: CrowdloanContributionConfirmViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("presentOperationConfirm(from: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate)", + parameters: (view, request, type, delegate), + escapingParameters: (view, request, type, delegate), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.complete(on: view)) + defaultCall: __defaultImplStub!.presentOperationConfirm(from: view, request: request, type: type, delegate: delegate)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func presentSearch(from view: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("presentSearch(from: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate)", + parameters: (view, initialQuery, delegate), + escapingParameters: (view, initialQuery, delegate), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.presentSearch(from: view, initialQuery: initialQuery, delegate: delegate)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func presentAuth(from view: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("presentAuth(from: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate)", + parameters: (view, request, delegate), + escapingParameters: (view, request, delegate), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.presentAuth(from: view, request: request, delegate: delegate)) + + } + + + + func presentPhishingDetected(from view: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate) { + + return cuckoo_manager.call("presentPhishingDetected(from: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate)", + parameters: (view, delegate), + escapingParameters: (view, delegate), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentPhishingDetected(from: view, delegate: delegate)) + + } + + + + func presentAddToFavoriteForm(from view: DAppBrowserViewProtocol?, page: DAppBrowserPage) { + + return cuckoo_manager.call("presentAddToFavoriteForm(from: DAppBrowserViewProtocol?, page: DAppBrowserPage)", + parameters: (view, page), + escapingParameters: (view, page), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentAddToFavoriteForm(from: view, page: page)) + + } + + + + func close(view: DAppBrowserViewProtocol?) { + + return cuckoo_manager.call("close(view: DAppBrowserViewProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.close(view: view)) } - struct __StubbingProxy_CrowdloanContributionConfirmWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppBrowserWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -9956,24 +9627,39 @@ import SoraFoundation } - func complete(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributionConfirmViewProtocol?)> where M1.OptionalMatchedType == CrowdloanContributionConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmWireframeProtocol.self, method: "complete(on: CrowdloanContributionConfirmViewProtocol?)", parameterMatchers: matchers)) + func presentOperationConfirm(from view: M1, request: M2, type: M3, delegate: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, DAppOperationRequest, DAppSigningType, DAppOperationConfirmDelegate)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppOperationRequest, M3.MatchedType == DAppSigningType, M4.MatchedType == DAppOperationConfirmDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppOperationRequest, DAppSigningType, DAppOperationConfirmDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: request) { $0.1 }, wrap(matchable: type) { $0.2 }, wrap(matchable: delegate) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentOperationConfirm(from: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate)", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func presentSearch(from view: M1, initialQuery: M2, delegate: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, String?, DAppSearchDelegate)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.OptionalMatchedType == String, M3.MatchedType == DAppSearchDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, String?, DAppSearchDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: initialQuery) { $0.1 }, wrap(matchable: delegate) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentSearch(from: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func presentAuth(from view: M1, request: M2, delegate: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, DAppAuthRequest, DAppAuthDelegate)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppAuthRequest, M3.MatchedType == DAppAuthDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppAuthRequest, DAppAuthDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: request) { $0.1 }, wrap(matchable: delegate) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentAuth(from: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate)", parameterMatchers: matchers)) + } + + func presentPhishingDetected(from view: M1, delegate: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, DAppPhishingViewDelegate)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppPhishingViewDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppPhishingViewDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentPhishingDetected(from: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate)", parameterMatchers: matchers)) + } + + func presentAddToFavoriteForm(from view: M1, page: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, DAppBrowserPage)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppBrowserPage { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppBrowserPage)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: page) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentAddToFavoriteForm(from: DAppBrowserViewProtocol?, page: DAppBrowserPage)", parameterMatchers: matchers)) + } + + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?)> where M1.OptionalMatchedType == DAppBrowserViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "close(view: DAppBrowserViewProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionConfirmWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppBrowserWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -9988,27 +9674,45 @@ import SoraFoundation @discardableResult - func complete(on view: M1) -> Cuckoo.__DoNotUse<(CrowdloanContributionConfirmViewProtocol?), Void> where M1.OptionalMatchedType == CrowdloanContributionConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(on: CrowdloanContributionConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentOperationConfirm(from view: M1, request: M2, type: M3, delegate: M4) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, DAppOperationRequest, DAppSigningType, DAppOperationConfirmDelegate), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppOperationRequest, M3.MatchedType == DAppSigningType, M4.MatchedType == DAppOperationConfirmDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppOperationRequest, DAppSigningType, DAppOperationConfirmDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: request) { $0.1 }, wrap(matchable: type) { $0.2 }, wrap(matchable: delegate) { $0.3 }] + return cuckoo_manager.verify("presentOperationConfirm(from: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentSearch(from view: M1, initialQuery: M2, delegate: M3) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, String?, DAppSearchDelegate), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.OptionalMatchedType == String, M3.MatchedType == DAppSearchDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, String?, DAppSearchDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: initialQuery) { $0.1 }, wrap(matchable: delegate) { $0.2 }] + return cuckoo_manager.verify("presentSearch(from: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentAuth(from view: M1, request: M2, delegate: M3) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, DAppAuthRequest, DAppAuthDelegate), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppAuthRequest, M3.MatchedType == DAppAuthDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppAuthRequest, DAppAuthDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: request) { $0.1 }, wrap(matchable: delegate) { $0.2 }] + return cuckoo_manager.verify("presentAuth(from: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentPhishingDetected(from view: M1, delegate: M2) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, DAppPhishingViewDelegate), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppPhishingViewDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppPhishingViewDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }] + return cuckoo_manager.verify("presentPhishingDetected(from: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentAddToFavoriteForm(from view: M1, page: M2) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, DAppBrowserPage), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppBrowserPage { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppBrowserPage)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: page) { $0.1 }] + return cuckoo_manager.verify("presentAddToFavoriteForm(from: DAppBrowserViewProtocol?, page: DAppBrowserPage)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func close(view: M1) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: DAppBrowserViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionConfirmWireframeProtocolStub: CrowdloanContributionConfirmWireframeProtocol { + class DAppBrowserWireframeProtocolStub: DAppBrowserWireframeProtocol { @@ -10016,19 +9720,37 @@ import SoraFoundation - func complete(on view: CrowdloanContributionConfirmViewProtocol?) { + func presentOperationConfirm(from view: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func presentSearch(from view: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func presentAuth(from view: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentPhishingDetected(from view: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentAddToFavoriteForm(from view: DAppBrowserViewProtocol?, page: DAppBrowserPage) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func close(view: DAppBrowserViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -10038,25 +9760,23 @@ import SoraFoundation import Cuckoo @testable import novawallet -import BigInt -import CommonWallet -import Foundation -import SoraFoundation +import RobinHood +import SubstrateSdk - class MockCrowdloanContributionSetupViewProtocol: CrowdloanContributionSetupViewProtocol, Cuckoo.ProtocolMock { + class MockDAppListViewProtocol: DAppListViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionSetupViewProtocol + typealias MocksType = DAppListViewProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupViewProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionSetupViewProtocol + typealias Stubbing = __StubbingProxy_DAppListViewProtocol + typealias Verification = __VerificationProxy_DAppListViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionSetupViewProtocol? + private var __defaultImplStub: DAppListViewProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionSetupViewProtocol) { + func enableDefaultImplementation(_ stub: DAppListViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -10091,214 +9811,57 @@ import SoraFoundation } + - - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } - - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - - } - - - - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } - - } - - - - - - - - func didReceiveAsset(viewModel: AssetBalanceViewModelProtocol) { - - return cuckoo_manager.call("didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) - - } - - - - func didReceiveFee(viewModel: BalanceViewModelProtocol?) { - - return cuckoo_manager.call("didReceiveFee(viewModel: BalanceViewModelProtocol?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) - - } - - - - func didReceiveInput(viewModel: AmountInputViewModelProtocol) { - - return cuckoo_manager.call("didReceiveInput(viewModel: AmountInputViewModelProtocol)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) - - } - - - - func didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel) { - - return cuckoo_manager.call("didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveCrowdloan(viewModel: viewModel)) - - } - - - - func didReceiveEstimatedReward(viewModel: String?) { - - return cuckoo_manager.call("didReceiveEstimatedReward(viewModel: String?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveEstimatedReward(viewModel: viewModel)) - - } - + - func didReceiveBonus(viewModel: String?) { - - return cuckoo_manager.call("didReceiveBonus(viewModel: String?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBonus(viewModel: viewModel)) - - } - - - func didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM) { + func didReceiveWalletSwitch(viewModel: WalletSwitchViewModel) { - return cuckoo_manager.call("didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", + return cuckoo_manager.call("didReceiveWalletSwitch(viewModel: WalletSwitchViewModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveRewardDestination(viewModel: viewModel)) - - } - - - - public func applyLocalization() { - - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.didReceiveWalletSwitch(viewModel: viewModel)) } - func didStartLoading() { + func didReceive(state: DAppListState) { - return cuckoo_manager.call("didStartLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(state: DAppListState)", + parameters: (state), + escapingParameters: (state), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.didReceive(state: state)) } - func didStopLoading() { + func didCompleteRefreshing() { - return cuckoo_manager.call("didStopLoading()", + return cuckoo_manager.call("didCompleteRefreshing()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.didCompleteRefreshing()) } - struct __StubbingProxy_CrowdloanContributionSetupViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppListViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -10306,84 +9869,34 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") - } - - - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") - } - - - func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AssetBalanceViewModelProtocol)> where M1.MatchedType == AssetBalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AssetBalanceViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", parameterMatchers: matchers)) - } - - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BalanceViewModelProtocol?)> where M1.OptionalMatchedType == BalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveFee(viewModel: BalanceViewModelProtocol?)", parameterMatchers: matchers)) - } - - func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AmountInputViewModelProtocol)> where M1.MatchedType == AmountInputViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AmountInputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveInput(viewModel: AmountInputViewModelProtocol)", parameterMatchers: matchers)) - } - - func didReceiveCrowdloan(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributionSetupViewModel)> where M1.MatchedType == CrowdloanContributionSetupViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel)", parameterMatchers: matchers)) - } - - func didReceiveEstimatedReward(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveEstimatedReward(viewModel: String?)", parameterMatchers: matchers)) - } - - func didReceiveBonus(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveBonus(viewModel: String?)", parameterMatchers: matchers)) - } - - func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanRewardDestinationVM)> where M1.MatchedType == CrowdloanRewardDestinationVM { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanRewardDestinationVM)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", parameterMatchers: matchers)) - } - - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func didReceiveWalletSwitch(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(WalletSwitchViewModel)> where M1.MatchedType == WalletSwitchViewModel { + let matchers: [Cuckoo.ParameterMatcher<(WalletSwitchViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListViewProtocol.self, method: "didReceiveWalletSwitch(viewModel: WalletSwitchViewModel)", parameterMatchers: matchers)) } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + func didReceive(state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListState)> where M1.MatchedType == DAppListState { + let matchers: [Cuckoo.ParameterMatcher<(DAppListState)>] = [wrap(matchable: state) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListViewProtocol.self, method: "didReceive(state: DAppListState)", parameterMatchers: matchers)) } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func didCompleteRefreshing() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppListViewProtocol.self, method: "didCompleteRefreshing()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionSetupViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppListViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -10405,87 +9918,30 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(AssetBalanceViewModelProtocol), Void> where M1.MatchedType == AssetBalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AssetBalanceViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(BalanceViewModelProtocol?), Void> where M1.OptionalMatchedType == BalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: BalanceViewModelProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(AmountInputViewModelProtocol), Void> where M1.MatchedType == AmountInputViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AmountInputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveInput(viewModel: AmountInputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveCrowdloan(viewModel: M1) -> Cuckoo.__DoNotUse<(CrowdloanContributionSetupViewModel), Void> where M1.MatchedType == CrowdloanContributionSetupViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveEstimatedReward(viewModel: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveEstimatedReward(viewModel: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBonus(viewModel: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveBonus(viewModel: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.__DoNotUse<(CrowdloanRewardDestinationVM), Void> where M1.MatchedType == CrowdloanRewardDestinationVM { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanRewardDestinationVM)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveWalletSwitch(viewModel: M1) -> Cuckoo.__DoNotUse<(WalletSwitchViewModel), Void> where M1.MatchedType == WalletSwitchViewModel { + let matchers: [Cuckoo.ParameterMatcher<(WalletSwitchViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveWalletSwitch(viewModel: WalletSwitchViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(state: M1) -> Cuckoo.__DoNotUse<(DAppListState), Void> where M1.MatchedType == DAppListState { + let matchers: [Cuckoo.ParameterMatcher<(DAppListState)>] = [wrap(matchable: state) { $0 }] + return cuckoo_manager.verify("didReceive(state: DAppListState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + func didCompleteRefreshing() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("didCompleteRefreshing()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionSetupViewProtocolStub: CrowdloanContributionSetupViewProtocol { + class DAppListViewProtocolStub: DAppListViewProtocol { @@ -10504,35 +9960,6 @@ import SoraFoundation } } - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - - } - - - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } @@ -10540,61 +9967,19 @@ import SoraFoundation - func didReceiveAsset(viewModel: AssetBalanceViewModelProtocol) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(viewModel: BalanceViewModelProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveInput(viewModel: AmountInputViewModelProtocol) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveEstimatedReward(viewModel: String?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveBonus(viewModel: String?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - public func applyLocalization() { + func didReceiveWalletSwitch(viewModel: WalletSwitchViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartLoading() { + func didReceive(state: DAppListState) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStopLoading() { + func didCompleteRefreshing() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -10602,19 +9987,19 @@ import SoraFoundation - class MockCrowdloanContributionSetupPresenterProtocol: CrowdloanContributionSetupPresenterProtocol, Cuckoo.ProtocolMock { + class MockDAppListPresenterProtocol: DAppListPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionSetupPresenterProtocol + typealias MocksType = DAppListPresenterProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupPresenterProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionSetupPresenterProtocol + typealias Stubbing = __StubbingProxy_DAppListPresenterProtocol + typealias Verification = __VerificationProxy_DAppListPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionSetupPresenterProtocol? + private var __defaultImplStub: DAppListPresenterProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionSetupPresenterProtocol) { + func enableDefaultImplementation(_ stub: DAppListPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -10642,141 +10027,261 @@ import SoraFoundation - func selectAmountPercentage(_ percentage: Float) { + func refresh() { - return cuckoo_manager.call("selectAmountPercentage(_: Float)", - parameters: (percentage), - escapingParameters: (percentage), + return cuckoo_manager.call("refresh()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectAmountPercentage(percentage)) + defaultCall: __defaultImplStub!.refresh()) } - func updateAmount(_ newValue: Decimal) { + func activateAccount() { - return cuckoo_manager.call("updateAmount(_: Decimal)", - parameters: (newValue), - escapingParameters: (newValue), + return cuckoo_manager.call("activateAccount()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.updateAmount(newValue)) + defaultCall: __defaultImplStub!.activateAccount()) } - func proceed() { + func activateSearch() { - return cuckoo_manager.call("proceed()", + return cuckoo_manager.call("activateSearch()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.activateSearch()) } - func presentLearnMore() { + func activateSettings() { - return cuckoo_manager.call("presentLearnMore()", + return cuckoo_manager.call("activateSettings()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentLearnMore()) + defaultCall: __defaultImplStub!.activateSettings()) } - func presentAdditionalBonuses() { + func numberOfCategories() -> Int { - return cuckoo_manager.call("presentAdditionalBonuses()", + return cuckoo_manager.call("numberOfCategories() -> Int", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentAdditionalBonuses()) + defaultCall: __defaultImplStub!.numberOfCategories()) } - func presentRewardDestination() { + func category(at index: Int) -> String { - return cuckoo_manager.call("presentRewardDestination()", + return cuckoo_manager.call("category(at: Int) -> String", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.category(at: index)) + + } + + + + func selectedCategoryIndex() -> Int { + + return cuckoo_manager.call("selectedCategoryIndex() -> Int", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentRewardDestination()) + defaultCall: __defaultImplStub!.selectedCategoryIndex()) } - - struct __StubbingProxy_CrowdloanContributionSetupPresenterProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func selectAmountPercentage(_ percentage: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Float)> where M1.MatchedType == Float { - let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "selectAmountPercentage(_: Float)", parameterMatchers: matchers)) - } - - func updateAmount(_ newValue: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "updateAmount(_: Decimal)", parameterMatchers: matchers)) - } - - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) - } - - func presentLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "presentLearnMore()", parameterMatchers: matchers)) - } - - func presentAdditionalBonuses() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "presentAdditionalBonuses()", parameterMatchers: matchers)) + + + func selectCategory(at index: Int) { + + return cuckoo_manager.call("selectCategory(at: Int)", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.selectCategory(at: index)) + + } + + + + func numberOfDApps() -> Int { + + return cuckoo_manager.call("numberOfDApps() -> Int", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.numberOfDApps()) + + } + + + + func dApp(at index: Int) -> DAppViewModel { + + return cuckoo_manager.call("dApp(at: Int) -> DAppViewModel", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.dApp(at: index)) + + } + + + + func selectDApp(at index: Int) { + + return cuckoo_manager.call("selectDApp(at: Int)", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.selectDApp(at: index)) + + } + + + + func toogleFavoriteForDApp(at index: Int) { + + return cuckoo_manager.call("toogleFavoriteForDApp(at: Int)", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.toogleFavoriteForDApp(at: index)) + + } + + + struct __StubbingProxy_DAppListPresenterProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager } - func presentRewardDestination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "presentRewardDestination()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func refresh() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "refresh()", parameterMatchers: matchers)) + } + + func activateAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "activateAccount()", parameterMatchers: matchers)) + } + + func activateSearch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "activateSearch()", parameterMatchers: matchers)) + } + + func activateSettings() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "activateSettings()", parameterMatchers: matchers)) + } + + func numberOfCategories() -> Cuckoo.ProtocolStubFunction<(), Int> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "numberOfCategories() -> Int", parameterMatchers: matchers)) + } + + func category(at index: M1) -> Cuckoo.ProtocolStubFunction<(Int), String> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "category(at: Int) -> String", parameterMatchers: matchers)) + } + + func selectedCategoryIndex() -> Cuckoo.ProtocolStubFunction<(), Int> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "selectedCategoryIndex() -> Int", parameterMatchers: matchers)) + } + + func selectCategory(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "selectCategory(at: Int)", parameterMatchers: matchers)) + } + + func numberOfDApps() -> Cuckoo.ProtocolStubFunction<(), Int> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "numberOfDApps() -> Int", parameterMatchers: matchers)) + } + + func dApp(at index: M1) -> Cuckoo.ProtocolStubFunction<(Int), DAppViewModel> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "dApp(at: Int) -> DAppViewModel", parameterMatchers: matchers)) + } + + func selectDApp(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "selectDApp(at: Int)", parameterMatchers: matchers)) + } + + func toogleFavoriteForDApp(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "toogleFavoriteForDApp(at: Int)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionSetupPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppListPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -10797,45 +10302,81 @@ import SoraFoundation } @discardableResult - func selectAmountPercentage(_ percentage: M1) -> Cuckoo.__DoNotUse<(Float), Void> where M1.MatchedType == Float { - let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] - return cuckoo_manager.verify("selectAmountPercentage(_: Float)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func refresh() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("refresh()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func updateAmount(_ newValue: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] - return cuckoo_manager.verify("updateAmount(_: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func activateAccount() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("activateAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { + func activateSearch() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("activateSearch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentLearnMore() -> Cuckoo.__DoNotUse<(), Void> { + func activateSettings() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("activateSettings()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentAdditionalBonuses() -> Cuckoo.__DoNotUse<(), Void> { + func numberOfCategories() -> Cuckoo.__DoNotUse<(), Int> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentAdditionalBonuses()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("numberOfCategories() -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentRewardDestination() -> Cuckoo.__DoNotUse<(), Void> { + func category(at index: M1) -> Cuckoo.__DoNotUse<(Int), String> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("category(at: Int) -> String", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func selectedCategoryIndex() -> Cuckoo.__DoNotUse<(), Int> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentRewardDestination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("selectedCategoryIndex() -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func selectCategory(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("selectCategory(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func numberOfDApps() -> Cuckoo.__DoNotUse<(), Int> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("numberOfDApps() -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func dApp(at index: M1) -> Cuckoo.__DoNotUse<(Int), DAppViewModel> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("dApp(at: Int) -> DAppViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func selectDApp(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("selectDApp(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func toogleFavoriteForDApp(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("toogleFavoriteForDApp(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionSetupPresenterProtocolStub: CrowdloanContributionSetupPresenterProtocol { + class DAppListPresenterProtocolStub: DAppListPresenterProtocol { @@ -10849,37 +10390,73 @@ import SoraFoundation - func selectAmountPercentage(_ percentage: Float) { + func refresh() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func updateAmount(_ newValue: Decimal) { + func activateAccount() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func proceed() { + func activateSearch() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentLearnMore() { + func activateSettings() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentAdditionalBonuses() { + func numberOfCategories() -> Int { + return DefaultValueRegistry.defaultValue(for: (Int).self) + } + + + + func category(at index: Int) -> String { + return DefaultValueRegistry.defaultValue(for: (String).self) + } + + + + func selectedCategoryIndex() -> Int { + return DefaultValueRegistry.defaultValue(for: (Int).self) + } + + + + func selectCategory(at index: Int) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentRewardDestination() { + func numberOfDApps() -> Int { + return DefaultValueRegistry.defaultValue(for: (Int).self) + } + + + + func dApp(at index: Int) -> DAppViewModel { + return DefaultValueRegistry.defaultValue(for: (DAppViewModel).self) + } + + + + func selectDApp(at index: Int) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func toogleFavoriteForDApp(at index: Int) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -10887,19 +10464,19 @@ import SoraFoundation - class MockCrowdloanContributionSetupInteractorInputProtocol: CrowdloanContributionSetupInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockDAppListInteractorInputProtocol: DAppListInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionSetupInteractorInputProtocol + typealias MocksType = DAppListInteractorInputProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupInteractorInputProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionSetupInteractorInputProtocol + typealias Stubbing = __StubbingProxy_DAppListInteractorInputProtocol + typealias Verification = __VerificationProxy_DAppListInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionSetupInteractorInputProtocol? + private var __defaultImplStub: DAppListInteractorInputProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionSetupInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: DAppListInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -10927,21 +10504,51 @@ import SoraFoundation - func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { + func refresh() { - return cuckoo_manager.call("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", - parameters: (amount, bonusService), - escapingParameters: (amount, bonusService), + return cuckoo_manager.call("refresh()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee(for: amount, bonusService: bonusService)) + defaultCall: __defaultImplStub!.refresh()) + + } + + + + func addToFavorites(dApp: DApp) { + + return cuckoo_manager.call("addToFavorites(dApp: DApp)", + parameters: (dApp), + escapingParameters: (dApp), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.addToFavorites(dApp: dApp)) + + } + + + + func removeFromFavorites(dAppIdentifier: String) { + + return cuckoo_manager.call("removeFromFavorites(dAppIdentifier: String)", + parameters: (dAppIdentifier), + escapingParameters: (dAppIdentifier), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.removeFromFavorites(dAppIdentifier: dAppIdentifier)) } - struct __StubbingProxy_CrowdloanContributionSetupInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppListInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -10951,17 +10558,27 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt, CrowdloanBonusServiceProtocol?)> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorInputProtocol.self, method: "estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) + func refresh() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorInputProtocol.self, method: "refresh()", parameterMatchers: matchers)) + } + + func addToFavorites(dApp: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DApp)> where M1.MatchedType == DApp { + let matchers: [Cuckoo.ParameterMatcher<(DApp)>] = [wrap(matchable: dApp) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorInputProtocol.self, method: "addToFavorites(dApp: DApp)", parameterMatchers: matchers)) + } + + func removeFromFavorites(dAppIdentifier: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: dAppIdentifier) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorInputProtocol.self, method: "removeFromFavorites(dAppIdentifier: String)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionSetupInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppListInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -10982,15 +10599,27 @@ import SoraFoundation } @discardableResult - func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.__DoNotUse<(BigUInt, CrowdloanBonusServiceProtocol?), Void> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] - return cuckoo_manager.verify("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func refresh() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("refresh()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func addToFavorites(dApp: M1) -> Cuckoo.__DoNotUse<(DApp), Void> where M1.MatchedType == DApp { + let matchers: [Cuckoo.ParameterMatcher<(DApp)>] = [wrap(matchable: dApp) { $0 }] + return cuckoo_manager.verify("addToFavorites(dApp: DApp)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func removeFromFavorites(dAppIdentifier: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: dAppIdentifier) { $0 }] + return cuckoo_manager.verify("removeFromFavorites(dAppIdentifier: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionSetupInteractorInputProtocolStub: CrowdloanContributionSetupInteractorInputProtocol { + class DAppListInteractorInputProtocolStub: DAppListInteractorInputProtocol { @@ -11004,7 +10633,19 @@ import SoraFoundation - func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { + func refresh() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func addToFavorites(dApp: DApp) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func removeFromFavorites(dAppIdentifier: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -11012,19 +10653,19 @@ import SoraFoundation - class MockCrowdloanContributionSetupInteractorOutputProtocol: CrowdloanContributionSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockDAppListInteractorOutputProtocol: DAppListInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionSetupInteractorOutputProtocol + typealias MocksType = DAppListInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupInteractorOutputProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionSetupInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_DAppListInteractorOutputProtocol + typealias Verification = __VerificationProxy_DAppListInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionSetupInteractorOutputProtocol? + private var __defaultImplStub: DAppListInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionSetupInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: DAppListInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -11037,171 +10678,223 @@ import SoraFoundation - func didReceiveCrowdloan(result: Result) { + func didReceive(walletResult: Result) { - return cuckoo_manager.call("didReceiveCrowdloan(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceive(walletResult: Result)", + parameters: (walletResult), + escapingParameters: (walletResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveCrowdloan(result: result)) + defaultCall: __defaultImplStub!.didReceive(walletResult: walletResult)) } - func didReceiveDisplayInfo(result: Result) { + func didReceive(dAppsResult: Result?) { - return cuckoo_manager.call("didReceiveDisplayInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceive(dAppsResult: Result?)", + parameters: (dAppsResult), + escapingParameters: (dAppsResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveDisplayInfo(result: result)) + defaultCall: __defaultImplStub!.didReceive(dAppsResult: dAppsResult)) } - func didReceiveAccountInfo(result: Result) { + func didReceiveFavoriteDapp(changes: [DataProviderChange]) { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveFavoriteDapp(changes: [DataProviderChange])", + parameters: (changes), + escapingParameters: (changes), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.didReceiveFavoriteDapp(changes: changes)) } + + struct __StubbingProxy_DAppListInteractorOutputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func didReceive(walletResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: walletResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorOutputProtocol.self, method: "didReceive(walletResult: Result)", parameterMatchers: matchers)) + } + + func didReceive(dAppsResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result?)> where M1.OptionalMatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result?)>] = [wrap(matchable: dAppsResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorOutputProtocol.self, method: "didReceive(dAppsResult: Result?)", parameterMatchers: matchers)) + } + + func didReceiveFavoriteDapp(changes: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([DataProviderChange])> where M1.MatchedType == [DataProviderChange] { + let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorOutputProtocol.self, method: "didReceiveFavoriteDapp(changes: [DataProviderChange])", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_DAppListInteractorOutputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didReceive(walletResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: walletResult) { $0 }] + return cuckoo_manager.verify("didReceive(walletResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(dAppsResult: M1) -> Cuckoo.__DoNotUse<(Result?), Void> where M1.OptionalMatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result?)>] = [wrap(matchable: dAppsResult) { $0 }] + return cuckoo_manager.verify("didReceive(dAppsResult: Result?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveFavoriteDapp(changes: M1) -> Cuckoo.__DoNotUse<([DataProviderChange]), Void> where M1.MatchedType == [DataProviderChange] { + let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] + return cuckoo_manager.verify("didReceiveFavoriteDapp(changes: [DataProviderChange])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class DAppListInteractorOutputProtocolStub: DAppListInteractorOutputProtocol { + + + - func didReceiveBlockNumber(result: Result) { - - return cuckoo_manager.call("didReceiveBlockNumber(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBlockNumber(result: result)) - + + + func didReceive(walletResult: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveBlockDuration(result: Result) { - - return cuckoo_manager.call("didReceiveBlockDuration(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBlockDuration(result: result)) - + func didReceive(dAppsResult: Result?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveLeasingPeriod(result: Result) { - - return cuckoo_manager.call("didReceiveLeasingPeriod(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(result: result)) - + func didReceiveFavoriteDapp(changes: [DataProviderChange]) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockDAppListWireframeProtocol: DAppListWireframeProtocol, Cuckoo.ProtocolMock { + typealias MocksType = DAppListWireframeProtocol - func didReceiveLeasingOffset(result: Result) { - - return cuckoo_manager.call("didReceiveLeasingOffset(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingOffset(result: result)) - + typealias Stubbing = __StubbingProxy_DAppListWireframeProtocol + typealias Verification = __VerificationProxy_DAppListWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: DAppListWireframeProtocol? + + func enableDefaultImplementation(_ stub: DAppListWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + + + - func didReceiveMinimumBalance(result: Result) { + + + func showSearch(from view: DAppListViewProtocol?, delegate: DAppSearchDelegate) { - return cuckoo_manager.call("didReceiveMinimumBalance(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("showSearch(from: DAppListViewProtocol?, delegate: DAppSearchDelegate)", + parameters: (view, delegate), + escapingParameters: (view, delegate), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMinimumBalance(result: result)) + defaultCall: __defaultImplStub!.showSearch(from: view, delegate: delegate)) } - func didReceiveMinimumContribution(result: Result) { + func showBrowser(from view: DAppListViewProtocol?, for result: DAppSearchResult) { - return cuckoo_manager.call("didReceiveMinimumContribution(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("showBrowser(from: DAppListViewProtocol?, for: DAppSearchResult)", + parameters: (view, result), + escapingParameters: (view, result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMinimumContribution(result: result)) + defaultCall: __defaultImplStub!.showBrowser(from: view, for: result)) } - func didReceivePriceData(result: Result) { + func showSetting(from view: DAppListViewProtocol?) { - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("showSetting(from: DAppListViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + defaultCall: __defaultImplStub!.showSetting(from: view)) } - func didReceiveFee(result: Result) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) } - struct __StubbingProxy_CrowdloanContributionSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppListWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -11209,64 +10902,29 @@ import SoraFoundation } - func didReceiveCrowdloan(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveCrowdloan(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveDisplayInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveDisplayInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveBlockNumber(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveBlockNumber(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveBlockDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveBlockDuration(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveLeasingPeriod(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveLeasingOffset(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveMinimumBalance(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveMinimumBalance(result: Result)", parameterMatchers: matchers)) + func showSearch(from view: M1, delegate: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListViewProtocol?, DAppSearchDelegate)> where M1.OptionalMatchedType == DAppListViewProtocol, M2.MatchedType == DAppSearchDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?, DAppSearchDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showSearch(from: DAppListViewProtocol?, delegate: DAppSearchDelegate)", parameterMatchers: matchers)) } - func didReceiveMinimumContribution(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveMinimumContribution(result: Result)", parameterMatchers: matchers)) + func showBrowser(from view: M1, for result: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListViewProtocol?, DAppSearchResult)> where M1.OptionalMatchedType == DAppListViewProtocol, M2.MatchedType == DAppSearchResult { + let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?, DAppSearchResult)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: result) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showBrowser(from: DAppListViewProtocol?, for: DAppSearchResult)", parameterMatchers: matchers)) } - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + func showSetting(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListViewProtocol?)> where M1.OptionalMatchedType == DAppListViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showSetting(from: DAppListViewProtocol?)", parameterMatchers: matchers)) } - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppListWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -11281,75 +10939,33 @@ import SoraFoundation @discardableResult - func didReceiveCrowdloan(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveCrowdloan(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveDisplayInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveDisplayInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBlockNumber(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBlockNumber(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBlockDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBlockDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveLeasingPeriod(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingPeriod(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveLeasingOffset(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingOffset(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveMinimumBalance(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinimumBalance(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showSearch(from view: M1, delegate: M2) -> Cuckoo.__DoNotUse<(DAppListViewProtocol?, DAppSearchDelegate), Void> where M1.OptionalMatchedType == DAppListViewProtocol, M2.MatchedType == DAppSearchDelegate { + let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?, DAppSearchDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }] + return cuckoo_manager.verify("showSearch(from: DAppListViewProtocol?, delegate: DAppSearchDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveMinimumContribution(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinimumContribution(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showBrowser(from view: M1, for result: M2) -> Cuckoo.__DoNotUse<(DAppListViewProtocol?, DAppSearchResult), Void> where M1.OptionalMatchedType == DAppListViewProtocol, M2.MatchedType == DAppSearchResult { + let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?, DAppSearchResult)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: result) { $0.1 }] + return cuckoo_manager.verify("showBrowser(from: DAppListViewProtocol?, for: DAppSearchResult)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showSetting(from view: M1) -> Cuckoo.__DoNotUse<(DAppListViewProtocol?), Void> where M1.OptionalMatchedType == DAppListViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showSetting(from: DAppListViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionSetupInteractorOutputProtocolStub: CrowdloanContributionSetupInteractorOutputProtocol { + class DAppListWireframeProtocolStub: DAppListWireframeProtocol { @@ -11357,174 +10973,120 @@ import SoraFoundation - func didReceiveCrowdloan(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveDisplayInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveBlockNumber(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveBlockDuration(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveLeasingPeriod(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveLeasingOffset(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveMinimumBalance(result: Result) { + func showSearch(from view: DAppListViewProtocol?, delegate: DAppSearchDelegate) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveMinimumContribution(result: Result) { + func showBrowser(from view: DAppListViewProtocol?, for result: DAppSearchResult) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceivePriceData(result: Result) { + func showSetting(from view: DAppListViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFee(result: Result) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet + +import SubstrateSdk + - class MockCrowdloanContributionSetupWireframeProtocol: CrowdloanContributionSetupWireframeProtocol, Cuckoo.ProtocolMock { + class MockDAppOperationConfirmViewProtocol: DAppOperationConfirmViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanContributionSetupWireframeProtocol + typealias MocksType = DAppOperationConfirmViewProtocol - typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupWireframeProtocol - typealias Verification = __VerificationProxy_CrowdloanContributionSetupWireframeProtocol + typealias Stubbing = __StubbingProxy_DAppOperationConfirmViewProtocol + typealias Verification = __VerificationProxy_DAppOperationConfirmViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanContributionSetupWireframeProtocol? + private var __defaultImplStub: DAppOperationConfirmViewProtocol? - func enableDefaultImplementation(_ stub: CrowdloanContributionSetupWireframeProtocol) { + func enableDefaultImplementation(_ stub: DAppOperationConfirmViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - - - func showConfirmation(from view: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?) { - - return cuckoo_manager.call("showConfirmation(from: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?)", - parameters: (view, paraId, inputAmount, bonusService), - escapingParameters: (view, paraId, inputAmount, bonusService), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showConfirmation(from: view, paraId: paraId, inputAmount: inputAmount, bonusService: bonusService)) + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } - func showAdditionalBonus(from view: CrowdloanContributionSetupViewProtocol?, for displayInfo: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?) { - - return cuckoo_manager.call("showAdditionalBonus(from: CrowdloanContributionSetupViewProtocol?, for: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?)", - parameters: (view, displayInfo, inputAmount, delegate, existingService), - escapingParameters: (view, displayInfo, inputAmount, delegate, existingService), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showAdditionalBonus(from: view, for: displayInfo, inputAmount: inputAmount, delegate: delegate, existingService: existingService)) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } + - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) - - } + - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceive(confimationViewModel: DAppOperationConfirmViewModel) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("didReceive(confimationViewModel: DAppOperationConfirmViewModel)", + parameters: (confimationViewModel), + escapingParameters: (confimationViewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.didReceive(confimationViewModel: confimationViewModel)) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func didReceive(feeViewModel: DAppOperationFeeViewModel) { - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), + return cuckoo_manager.call("didReceive(feeViewModel: DAppOperationFeeViewModel)", + parameters: (feeViewModel), + escapingParameters: (feeViewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + defaultCall: __defaultImplStub!.didReceive(feeViewModel: feeViewModel)) } - struct __StubbingProxy_CrowdloanContributionSetupWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppOperationConfirmViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -11532,34 +11094,29 @@ import SoraFoundation } - func showConfirmation(from view: M1, paraId: M2, inputAmount: M3, bonusService: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributionSetupViewProtocol?, ParaId, Decimal, CrowdloanBonusServiceProtocol?)> where M1.OptionalMatchedType == CrowdloanContributionSetupViewProtocol, M2.MatchedType == ParaId, M3.MatchedType == Decimal, M4.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewProtocol?, ParaId, Decimal, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: paraId) { $0.1 }, wrap(matchable: inputAmount) { $0.2 }, wrap(matchable: bonusService) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "showConfirmation(from: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func showAdditionalBonus(from view: M1, for displayInfo: M2, inputAmount: M3, delegate: M4, existingService: M5) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributionSetupViewProtocol?, CrowdloanDisplayInfo, Decimal, CustomCrowdloanDelegate, CrowdloanBonusServiceProtocol?)> where M1.OptionalMatchedType == CrowdloanContributionSetupViewProtocol, M2.MatchedType == CrowdloanDisplayInfo, M3.MatchedType == Decimal, M4.MatchedType == CustomCrowdloanDelegate, M5.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewProtocol?, CrowdloanDisplayInfo, Decimal, CustomCrowdloanDelegate, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: displayInfo) { $0.1 }, wrap(matchable: inputAmount) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: existingService) { $0.4 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "showAdditionalBonus(from: CrowdloanContributionSetupViewProtocol?, for: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) - } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + + func didReceive(confimationViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationConfirmViewModel)> where M1.MatchedType == DAppOperationConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewModel)>] = [wrap(matchable: confimationViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmViewProtocol.self, method: "didReceive(confimationViewModel: DAppOperationConfirmViewModel)", parameterMatchers: matchers)) } - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + func didReceive(feeViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationFeeViewModel)> where M1.MatchedType == DAppOperationFeeViewModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationFeeViewModel)>] = [wrap(matchable: feeViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmViewProtocol.self, method: "didReceive(feeViewModel: DAppOperationFeeViewModel)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanContributionSetupWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppOperationConfirmViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -11571,272 +11128,158 @@ import SoraFoundation } - - @discardableResult - func showConfirmation(from view: M1, paraId: M2, inputAmount: M3, bonusService: M4) -> Cuckoo.__DoNotUse<(CrowdloanContributionSetupViewProtocol?, ParaId, Decimal, CrowdloanBonusServiceProtocol?), Void> where M1.OptionalMatchedType == CrowdloanContributionSetupViewProtocol, M2.MatchedType == ParaId, M3.MatchedType == Decimal, M4.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewProtocol?, ParaId, Decimal, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: paraId) { $0.1 }, wrap(matchable: inputAmount) { $0.2 }, wrap(matchable: bonusService) { $0.3 }] - return cuckoo_manager.verify("showConfirmation(from: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func showAdditionalBonus(from view: M1, for displayInfo: M2, inputAmount: M3, delegate: M4, existingService: M5) -> Cuckoo.__DoNotUse<(CrowdloanContributionSetupViewProtocol?, CrowdloanDisplayInfo, Decimal, CustomCrowdloanDelegate, CrowdloanBonusServiceProtocol?), Void> where M1.OptionalMatchedType == CrowdloanContributionSetupViewProtocol, M2.MatchedType == CrowdloanDisplayInfo, M3.MatchedType == Decimal, M4.MatchedType == CustomCrowdloanDelegate, M5.OptionalMatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewProtocol?, CrowdloanDisplayInfo, Decimal, CustomCrowdloanDelegate, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: displayInfo) { $0.1 }, wrap(matchable: inputAmount) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: existingService) { $0.4 }] - return cuckoo_manager.verify("showAdditionalBonus(from: CrowdloanContributionSetupViewProtocol?, for: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(confimationViewModel: M1) -> Cuckoo.__DoNotUse<(DAppOperationConfirmViewModel), Void> where M1.MatchedType == DAppOperationConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewModel)>] = [wrap(matchable: confimationViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(confimationViewModel: DAppOperationConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(feeViewModel: M1) -> Cuckoo.__DoNotUse<(DAppOperationFeeViewModel), Void> where M1.MatchedType == DAppOperationFeeViewModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationFeeViewModel)>] = [wrap(matchable: feeViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(feeViewModel: DAppOperationFeeViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanContributionSetupWireframeProtocolStub: CrowdloanContributionSetupWireframeProtocol { - - - - - + class DAppOperationConfirmViewProtocolStub: DAppOperationConfirmViewProtocol { + - func showConfirmation(from view: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + - - func showAdditionalBonus(from view: CrowdloanContributionSetupViewProtocol?, for displayInfo: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceive(confimationViewModel: DAppOperationConfirmViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func didReceive(feeViewModel: DAppOperationFeeViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import SoraFoundation - - class MockCrowdloanListViewProtocol: CrowdloanListViewProtocol, Cuckoo.ProtocolMock { + class MockDAppOperationConfirmPresenterProtocol: DAppOperationConfirmPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanListViewProtocol + typealias MocksType = DAppOperationConfirmPresenterProtocol - typealias Stubbing = __StubbingProxy_CrowdloanListViewProtocol - typealias Verification = __VerificationProxy_CrowdloanListViewProtocol + typealias Stubbing = __StubbingProxy_DAppOperationConfirmPresenterProtocol + typealias Verification = __VerificationProxy_DAppOperationConfirmPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanListViewProtocol? + private var __defaultImplStub: DAppOperationConfirmPresenterProtocol? - func enableDefaultImplementation(_ stub: CrowdloanListViewProtocol) { + func enableDefaultImplementation(_ stub: DAppOperationConfirmPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func confirm() { + + return cuckoo_manager.call("confirm()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.confirm()) } - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } - - } - - - - - - - - func didReceive(walletSwitchViewModel: WalletSwitchViewModel) { - - return cuckoo_manager.call("didReceive(walletSwitchViewModel: WalletSwitchViewModel)", - parameters: (walletSwitchViewModel), - escapingParameters: (walletSwitchViewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(walletSwitchViewModel: walletSwitchViewModel)) - - } - - - - func didReceive(chainInfo: CrowdloansChainViewModel) { - - return cuckoo_manager.call("didReceive(chainInfo: CrowdloansChainViewModel)", - parameters: (chainInfo), - escapingParameters: (chainInfo), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(chainInfo: chainInfo)) - - } - - - - func didReceive(listState: CrowdloansViewModel) { - - return cuckoo_manager.call("didReceive(listState: CrowdloansViewModel)", - parameters: (listState), - escapingParameters: (listState), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(listState: listState)) - - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) - - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) - - } - - - - func didStartLoading() { + func reject() { - return cuckoo_manager.call("didStartLoading()", + return cuckoo_manager.call("reject()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.reject()) } - func didStopLoading() { + func activateTxDetails() { - return cuckoo_manager.call("didStopLoading()", + return cuckoo_manager.call("activateTxDetails()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.activateTxDetails()) } - struct __StubbingProxy_CrowdloanListViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppOperationConfirmPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -11844,64 +11287,29 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") - } - - - func didReceive(walletSwitchViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(WalletSwitchViewModel)> where M1.MatchedType == WalletSwitchViewModel { - let matchers: [Cuckoo.ParameterMatcher<(WalletSwitchViewModel)>] = [wrap(matchable: walletSwitchViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListViewProtocol.self, method: "didReceive(walletSwitchViewModel: WalletSwitchViewModel)", parameterMatchers: matchers)) - } - - func didReceive(chainInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloansChainViewModel)> where M1.MatchedType == CrowdloansChainViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloansChainViewModel)>] = [wrap(matchable: chainInfo) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListViewProtocol.self, method: "didReceive(chainInfo: CrowdloansChainViewModel)", parameterMatchers: matchers)) - } - - func didReceive(listState: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloansViewModel)> where M1.MatchedType == CrowdloansViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloansViewModel)>] = [wrap(matchable: listState) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListViewProtocol.self, method: "didReceive(listState: CrowdloansViewModel)", parameterMatchers: matchers)) - } - - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListViewProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListViewProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func reject() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmPresenterProtocol.self, method: "reject()", parameterMatchers: matchers)) } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func activateTxDetails() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmPresenterProtocol.self, method: "activateTxDetails()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanListViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppOperationConfirmPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -11913,110 +11321,36 @@ import SoraFoundation } - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceive(walletSwitchViewModel: M1) -> Cuckoo.__DoNotUse<(WalletSwitchViewModel), Void> where M1.MatchedType == WalletSwitchViewModel { - let matchers: [Cuckoo.ParameterMatcher<(WalletSwitchViewModel)>] = [wrap(matchable: walletSwitchViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(walletSwitchViewModel: WalletSwitchViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(chainInfo: M1) -> Cuckoo.__DoNotUse<(CrowdloansChainViewModel), Void> where M1.MatchedType == CrowdloansChainViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloansChainViewModel)>] = [wrap(matchable: chainInfo) { $0 }] - return cuckoo_manager.verify("didReceive(chainInfo: CrowdloansChainViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(listState: M1) -> Cuckoo.__DoNotUse<(CrowdloansViewModel), Void> where M1.MatchedType == CrowdloansViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloansViewModel)>] = [wrap(matchable: listState) { $0 }] - return cuckoo_manager.verify("didReceive(listState: CrowdloansViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func confirm() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + func reject() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("reject()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + func activateTxDetails() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("activateTxDetails()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanListViewProtocolStub: CrowdloanListViewProtocol { - - - - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - - - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } - - - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } + class DAppOperationConfirmPresenterProtocolStub: DAppOperationConfirmPresenterProtocol { @@ -12024,43 +11358,25 @@ import SoraFoundation - func didReceive(walletSwitchViewModel: WalletSwitchViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(chainInfo: CrowdloansChainViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(listState: CrowdloansViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func confirm() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartLoading() { + func reject() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStopLoading() { + func activateTxDetails() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -12068,19 +11384,19 @@ import SoraFoundation - class MockCrowdloanListPresenterProtocol: CrowdloanListPresenterProtocol, Cuckoo.ProtocolMock { + class MockDAppOperationConfirmInteractorInputProtocol: DAppOperationConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanListPresenterProtocol + typealias MocksType = DAppOperationConfirmInteractorInputProtocol - typealias Stubbing = __StubbingProxy_CrowdloanListPresenterProtocol - typealias Verification = __VerificationProxy_CrowdloanListPresenterProtocol + typealias Stubbing = __StubbingProxy_DAppOperationConfirmInteractorInputProtocol + typealias Verification = __VerificationProxy_DAppOperationConfirmInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanListPresenterProtocol? + private var __defaultImplStub: DAppOperationConfirmInteractorInputProtocol? - func enableDefaultImplementation(_ stub: CrowdloanListPresenterProtocol) { + func enableDefaultImplementation(_ stub: DAppOperationConfirmInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -12108,111 +11424,66 @@ import SoraFoundation - func refresh(shouldReset: Bool) { - - return cuckoo_manager.call("refresh(shouldReset: Bool)", - parameters: (shouldReset), - escapingParameters: (shouldReset), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.refresh(shouldReset: shouldReset)) - - } - - - - func selectCrowdloan(_ paraId: ParaId) { - - return cuckoo_manager.call("selectCrowdloan(_: ParaId)", - parameters: (paraId), - escapingParameters: (paraId), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.selectCrowdloan(paraId)) - - } - - - - func becomeOnline() { - - return cuckoo_manager.call("becomeOnline()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.becomeOnline()) - - } - - - - func putOffline() { + func estimateFee() { - return cuckoo_manager.call("putOffline()", + return cuckoo_manager.call("estimateFee()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.putOffline()) + defaultCall: __defaultImplStub!.estimateFee()) } - func selectChain() { + func confirm() { - return cuckoo_manager.call("selectChain()", + return cuckoo_manager.call("confirm()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectChain()) + defaultCall: __defaultImplStub!.confirm()) } - func handleYourContributions() { + func reject() { - return cuckoo_manager.call("handleYourContributions()", + return cuckoo_manager.call("reject()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handleYourContributions()) + defaultCall: __defaultImplStub!.reject()) } - func handleWalletSwitch() { + func prepareTxDetails() { - return cuckoo_manager.call("handleWalletSwitch()", + return cuckoo_manager.call("prepareTxDetails()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handleWalletSwitch()) + defaultCall: __defaultImplStub!.prepareTxDetails()) } - struct __StubbingProxy_CrowdloanListPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppOperationConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -12222,47 +11493,32 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func refresh(shouldReset: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: shouldReset) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "refresh(shouldReset: Bool)", parameterMatchers: matchers)) - } - - func selectCrowdloan(_ paraId: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ParaId)> where M1.MatchedType == ParaId { - let matchers: [Cuckoo.ParameterMatcher<(ParaId)>] = [wrap(matchable: paraId) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "selectCrowdloan(_: ParaId)", parameterMatchers: matchers)) - } - - func becomeOnline() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "becomeOnline()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func putOffline() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "putOffline()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) } - func selectChain() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "selectChain()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "confirm()", parameterMatchers: matchers)) } - func handleYourContributions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func reject() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "handleYourContributions()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "reject()", parameterMatchers: matchers)) } - func handleWalletSwitch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func prepareTxDetails() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "handleWalletSwitch()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "prepareTxDetails()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanListPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppOperationConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -12283,51 +11539,33 @@ import SoraFoundation } @discardableResult - func refresh(shouldReset: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: shouldReset) { $0 }] - return cuckoo_manager.verify("refresh(shouldReset: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func selectCrowdloan(_ paraId: M1) -> Cuckoo.__DoNotUse<(ParaId), Void> where M1.MatchedType == ParaId { - let matchers: [Cuckoo.ParameterMatcher<(ParaId)>] = [wrap(matchable: paraId) { $0 }] - return cuckoo_manager.verify("selectCrowdloan(_: ParaId)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func becomeOnline() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("becomeOnline()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func putOffline() -> Cuckoo.__DoNotUse<(), Void> { + func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("putOffline()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectChain() -> Cuckoo.__DoNotUse<(), Void> { + func confirm() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectChain()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func handleYourContributions() -> Cuckoo.__DoNotUse<(), Void> { + func reject() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleYourContributions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("reject()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func handleWalletSwitch() -> Cuckoo.__DoNotUse<(), Void> { + func prepareTxDetails() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleWalletSwitch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("prepareTxDetails()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanListPresenterProtocolStub: CrowdloanListPresenterProtocol { + class DAppOperationConfirmInteractorInputProtocolStub: DAppOperationConfirmInteractorInputProtocol { @@ -12341,43 +11579,25 @@ import SoraFoundation - func refresh(shouldReset: Bool) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func selectCrowdloan(_ paraId: ParaId) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func becomeOnline() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func putOffline() { + func estimateFee() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectChain() { + func confirm() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func handleYourContributions() { + func reject() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func handleWalletSwitch() { + func prepareTxDetails() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -12385,19 +11605,19 @@ import SoraFoundation - class MockCrowdloanListInteractorInputProtocol: CrowdloanListInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockDAppOperationConfirmInteractorOutputProtocol: DAppOperationConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanListInteractorInputProtocol + typealias MocksType = DAppOperationConfirmInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_CrowdloanListInteractorInputProtocol - typealias Verification = __VerificationProxy_CrowdloanListInteractorInputProtocol + typealias Stubbing = __StubbingProxy_DAppOperationConfirmInteractorOutputProtocol + typealias Verification = __VerificationProxy_DAppOperationConfirmInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanListInteractorInputProtocol? + private var __defaultImplStub: DAppOperationConfirmInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: CrowdloanListInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: DAppOperationConfirmInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -12410,81 +11630,81 @@ import SoraFoundation - func setup() { + func didReceive(modelResult: Result) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(modelResult: Result)", + parameters: (modelResult), + escapingParameters: (modelResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceive(modelResult: modelResult)) } - func refresh() { + func didReceive(feeResult: Result) { - return cuckoo_manager.call("refresh()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(feeResult: Result)", + parameters: (feeResult), + escapingParameters: (feeResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.refresh()) + defaultCall: __defaultImplStub!.didReceive(feeResult: feeResult)) } - func saveSelected(chainModel: ChainModel) { + func didReceive(priceResult: Result) { - return cuckoo_manager.call("saveSelected(chainModel: ChainModel)", - parameters: (chainModel), - escapingParameters: (chainModel), + return cuckoo_manager.call("didReceive(priceResult: Result)", + parameters: (priceResult), + escapingParameters: (priceResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.saveSelected(chainModel: chainModel)) + defaultCall: __defaultImplStub!.didReceive(priceResult: priceResult)) } - func becomeOnline() { + func didReceive(responseResult: Result, for request: DAppOperationRequest) { - return cuckoo_manager.call("becomeOnline()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(responseResult: Result, for: DAppOperationRequest)", + parameters: (responseResult, request), + escapingParameters: (responseResult, request), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.becomeOnline()) + defaultCall: __defaultImplStub!.didReceive(responseResult: responseResult, for: request)) } - func putOffline() { + func didReceive(txDetailsResult: Result) { - return cuckoo_manager.call("putOffline()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(txDetailsResult: Result)", + parameters: (txDetailsResult), + escapingParameters: (txDetailsResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.putOffline()) + defaultCall: __defaultImplStub!.didReceive(txDetailsResult: txDetailsResult)) } - struct __StubbingProxy_CrowdloanListInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppOperationConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -12492,34 +11712,34 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + func didReceive(modelResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: modelResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(modelResult: Result)", parameterMatchers: matchers)) } - func refresh() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "refresh()", parameterMatchers: matchers)) + func didReceive(feeResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: feeResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(feeResult: Result)", parameterMatchers: matchers)) } - func saveSelected(chainModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainModel)> where M1.MatchedType == ChainModel { - let matchers: [Cuckoo.ParameterMatcher<(ChainModel)>] = [wrap(matchable: chainModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "saveSelected(chainModel: ChainModel)", parameterMatchers: matchers)) + func didReceive(priceResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(priceResult: Result)", parameterMatchers: matchers)) } - func becomeOnline() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "becomeOnline()", parameterMatchers: matchers)) + func didReceive(responseResult: M1, for request: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Result, DAppOperationRequest)> where M1.MatchedType == Result, M2.MatchedType == DAppOperationRequest { + let matchers: [Cuckoo.ParameterMatcher<(Result, DAppOperationRequest)>] = [wrap(matchable: responseResult) { $0.0 }, wrap(matchable: request) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(responseResult: Result, for: DAppOperationRequest)", parameterMatchers: matchers)) } - func putOffline() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "putOffline()", parameterMatchers: matchers)) + func didReceive(txDetailsResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: txDetailsResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(txDetailsResult: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanListInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppOperationConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -12534,39 +11754,39 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(modelResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: modelResult) { $0 }] + return cuckoo_manager.verify("didReceive(modelResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func refresh() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("refresh()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(feeResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: feeResult) { $0 }] + return cuckoo_manager.verify("didReceive(feeResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func saveSelected(chainModel: M1) -> Cuckoo.__DoNotUse<(ChainModel), Void> where M1.MatchedType == ChainModel { - let matchers: [Cuckoo.ParameterMatcher<(ChainModel)>] = [wrap(matchable: chainModel) { $0 }] - return cuckoo_manager.verify("saveSelected(chainModel: ChainModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(priceResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] + return cuckoo_manager.verify("didReceive(priceResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func becomeOnline() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("becomeOnline()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(responseResult: M1, for request: M2) -> Cuckoo.__DoNotUse<(Result, DAppOperationRequest), Void> where M1.MatchedType == Result, M2.MatchedType == DAppOperationRequest { + let matchers: [Cuckoo.ParameterMatcher<(Result, DAppOperationRequest)>] = [wrap(matchable: responseResult) { $0.0 }, wrap(matchable: request) { $0.1 }] + return cuckoo_manager.verify("didReceive(responseResult: Result, for: DAppOperationRequest)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func putOffline() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("putOffline()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(txDetailsResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: txDetailsResult) { $0 }] + return cuckoo_manager.verify("didReceive(txDetailsResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanListInteractorInputProtocolStub: CrowdloanListInteractorInputProtocol { + class DAppOperationConfirmInteractorOutputProtocolStub: DAppOperationConfirmInteractorOutputProtocol { @@ -12574,31 +11794,31 @@ import SoraFoundation - func setup() { + func didReceive(modelResult: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func refresh() { + func didReceive(feeResult: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func saveSelected(chainModel: ChainModel) { + func didReceive(priceResult: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func becomeOnline() { + func didReceive(responseResult: Result, for request: DAppOperationRequest) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func putOffline() { + func didReceive(txDetailsResult: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -12606,19 +11826,19 @@ import SoraFoundation - class MockCrowdloanListInteractorOutputProtocol: CrowdloanListInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockDAppOperationConfirmWireframeProtocol: DAppOperationConfirmWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanListInteractorOutputProtocol + typealias MocksType = DAppOperationConfirmWireframeProtocol - typealias Stubbing = __StubbingProxy_CrowdloanListInteractorOutputProtocol - typealias Verification = __VerificationProxy_CrowdloanListInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_DAppOperationConfirmWireframeProtocol + typealias Verification = __VerificationProxy_DAppOperationConfirmWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanListInteractorOutputProtocol? + private var __defaultImplStub: DAppOperationConfirmWireframeProtocol? - func enableDefaultImplementation(_ stub: CrowdloanListInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: DAppOperationConfirmWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -12631,201 +11851,66 @@ import SoraFoundation - func didReceiveCrowdloans(result: Result<[Crowdloan], Error>) { - - return cuckoo_manager.call("didReceiveCrowdloans(result: Result<[Crowdloan], Error>)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveCrowdloans(result: result)) - - } - - - - func didReceiveDisplayInfo(result: Result) { - - return cuckoo_manager.call("didReceiveDisplayInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveDisplayInfo(result: result)) - - } - - - - func didReceiveBlockNumber(result: Result) { - - return cuckoo_manager.call("didReceiveBlockNumber(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBlockNumber(result: result)) - - } - - - - func didReceiveBlockDuration(result: Result) { - - return cuckoo_manager.call("didReceiveBlockDuration(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBlockDuration(result: result)) - - } - - - - func didReceiveLeasingPeriod(result: Result) { - - return cuckoo_manager.call("didReceiveLeasingPeriod(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(result: result)) - - } - - - - func didReceiveLeasingOffset(result: Result) { - - return cuckoo_manager.call("didReceiveLeasingOffset(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingOffset(result: result)) - - } - - - - func didReceiveContributions(result: Result) { - - return cuckoo_manager.call("didReceiveContributions(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveContributions(result: result)) - - } - - - - func didReceiveExternalContributions(result: Result<[ExternalContribution], Error>) { - - return cuckoo_manager.call("didReceiveExternalContributions(result: Result<[ExternalContribution], Error>)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveExternalContributions(result: result)) - - } - - - - func didReceiveLeaseInfo(result: Result) { - - return cuckoo_manager.call("didReceiveLeaseInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeaseInfo(result: result)) - - } - - - - func didReceiveSelectedChain(result: Result) { + func close(view: DAppOperationConfirmViewProtocol?) { - return cuckoo_manager.call("didReceiveSelectedChain(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("close(view: DAppOperationConfirmViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveSelectedChain(result: result)) + defaultCall: __defaultImplStub!.close(view: view)) } - func didReceiveAccountInfo(result: Result) { + func showTxDetails(from view: DAppOperationConfirmViewProtocol?, json: JSON) { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("showTxDetails(from: DAppOperationConfirmViewProtocol?, json: JSON)", + parameters: (view, json), + escapingParameters: (view, json), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.showTxDetails(from: view, json: json)) } - func didReceive(wallet: MetaAccountModel) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didReceive(wallet: MetaAccountModel)", - parameters: (wallet), - escapingParameters: (wallet), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(wallet: wallet)) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func didReceivePriceData(result: Result?) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didReceivePriceData(result: Result?)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_CrowdloanListInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppOperationConfirmWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -12833,74 +11918,29 @@ import SoraFoundation } - func didReceiveCrowdloans(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[Crowdloan], Error>)> where M1.MatchedType == Result<[Crowdloan], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[Crowdloan], Error>)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveCrowdloans(result: Result<[Crowdloan], Error>)", parameterMatchers: matchers)) - } - - func didReceiveDisplayInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveDisplayInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveBlockNumber(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveBlockNumber(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveBlockDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveBlockDuration(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveLeasingPeriod(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveLeasingOffset(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveContributions(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveContributions(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveExternalContributions(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[ExternalContribution], Error>)> where M1.MatchedType == Result<[ExternalContribution], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[ExternalContribution], Error>)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveExternalContributions(result: Result<[ExternalContribution], Error>)", parameterMatchers: matchers)) - } - - func didReceiveLeaseInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveLeaseInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveSelectedChain(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveSelectedChain(result: Result)", parameterMatchers: matchers)) + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationConfirmViewProtocol?)> where M1.OptionalMatchedType == DAppOperationConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmWireframeProtocol.self, method: "close(view: DAppOperationConfirmViewProtocol?)", parameterMatchers: matchers)) } - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) + func showTxDetails(from view: M1, json: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationConfirmViewProtocol?, JSON)> where M1.OptionalMatchedType == DAppOperationConfirmViewProtocol, M2.MatchedType == JSON { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewProtocol?, JSON)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: json) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmWireframeProtocol.self, method: "showTxDetails(from: DAppOperationConfirmViewProtocol?, json: JSON)", parameterMatchers: matchers)) } - func didReceive(wallet: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaAccountModel)> where M1.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceive(wallet: MetaAccountModel)", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result?)> where M1.OptionalMatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result?)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result?)", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanListInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppOperationConfirmWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -12915,87 +11955,33 @@ import SoraFoundation @discardableResult - func didReceiveCrowdloans(result: M1) -> Cuckoo.__DoNotUse<(Result<[Crowdloan], Error>), Void> where M1.MatchedType == Result<[Crowdloan], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[Crowdloan], Error>)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveCrowdloans(result: Result<[Crowdloan], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveDisplayInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveDisplayInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBlockNumber(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBlockNumber(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBlockDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBlockDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveLeasingPeriod(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingPeriod(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveLeasingOffset(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingOffset(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveContributions(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveContributions(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveExternalContributions(result: M1) -> Cuckoo.__DoNotUse<(Result<[ExternalContribution], Error>), Void> where M1.MatchedType == Result<[ExternalContribution], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[ExternalContribution], Error>)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveExternalContributions(result: Result<[ExternalContribution], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveLeaseInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLeaseInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveSelectedChain(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveSelectedChain(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close(view: M1) -> Cuckoo.__DoNotUse<(DAppOperationConfirmViewProtocol?), Void> where M1.OptionalMatchedType == DAppOperationConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: DAppOperationConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showTxDetails(from view: M1, json: M2) -> Cuckoo.__DoNotUse<(DAppOperationConfirmViewProtocol?, JSON), Void> where M1.OptionalMatchedType == DAppOperationConfirmViewProtocol, M2.MatchedType == JSON { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewProtocol?, JSON)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: json) { $0.1 }] + return cuckoo_manager.verify("showTxDetails(from: DAppOperationConfirmViewProtocol?, json: JSON)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(wallet: M1) -> Cuckoo.__DoNotUse<(MetaAccountModel), Void> where M1.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] - return cuckoo_manager.verify("didReceive(wallet: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result?), Void> where M1.OptionalMatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result?)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanListInteractorOutputProtocolStub: CrowdloanListInteractorOutputProtocol { + class DAppOperationConfirmWireframeProtocolStub: DAppOperationConfirmWireframeProtocol { @@ -13003,79 +11989,25 @@ import SoraFoundation - func didReceiveCrowdloans(result: Result<[Crowdloan], Error>) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveDisplayInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveBlockNumber(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveBlockDuration(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveLeasingPeriod(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveLeasingOffset(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveContributions(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveExternalContributions(result: Result<[ExternalContribution], Error>) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveLeaseInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveSelectedChain(result: Result) { + func close(view: DAppOperationConfirmViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveAccountInfo(result: Result) { + func showTxDetails(from view: DAppOperationConfirmViewProtocol?, json: JSON) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(wallet: MetaAccountModel) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceivePriceData(result: Result?) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -13083,19 +12015,19 @@ import SoraFoundation - class MockCrowdloanListWireframeProtocol: CrowdloanListWireframeProtocol, Cuckoo.ProtocolMock { + class MockDAppOperationConfirmDelegate: DAppOperationConfirmDelegate, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanListWireframeProtocol + typealias MocksType = DAppOperationConfirmDelegate - typealias Stubbing = __StubbingProxy_CrowdloanListWireframeProtocol - typealias Verification = __VerificationProxy_CrowdloanListWireframeProtocol + typealias Stubbing = __StubbingProxy_DAppOperationConfirmDelegate + typealias Verification = __VerificationProxy_DAppOperationConfirmDelegate let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanListWireframeProtocol? + private var __defaultImplStub: DAppOperationConfirmDelegate? - func enableDefaultImplementation(_ stub: CrowdloanListWireframeProtocol) { + func enableDefaultImplementation(_ stub: DAppOperationConfirmDelegate) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -13108,96 +12040,162 @@ import SoraFoundation - func presentContributionSetup(from view: CrowdloanListViewProtocol?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?) { + func didReceiveConfirmationResponse(_ response: DAppOperationResponse, for request: DAppOperationRequest) { - return cuckoo_manager.call("presentContributionSetup(from: CrowdloanListViewProtocol?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?)", - parameters: (view, crowdloan, displayInfo), - escapingParameters: (view, crowdloan, displayInfo), + return cuckoo_manager.call("didReceiveConfirmationResponse(_: DAppOperationResponse, for: DAppOperationRequest)", + parameters: (response, request), + escapingParameters: (response, request), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentContributionSetup(from: view, crowdloan: crowdloan, displayInfo: displayInfo)) + defaultCall: __defaultImplStub!.didReceiveConfirmationResponse(response, for: request)) } + + struct __StubbingProxy_DAppOperationConfirmDelegate: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func didReceiveConfirmationResponse(_ response: M1, for request: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationResponse, DAppOperationRequest)> where M1.MatchedType == DAppOperationResponse, M2.MatchedType == DAppOperationRequest { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationResponse, DAppOperationRequest)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: request) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmDelegate.self, method: "didReceiveConfirmationResponse(_: DAppOperationResponse, for: DAppOperationRequest)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_DAppOperationConfirmDelegate: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didReceiveConfirmationResponse(_ response: M1, for request: M2) -> Cuckoo.__DoNotUse<(DAppOperationResponse, DAppOperationRequest), Void> where M1.MatchedType == DAppOperationResponse, M2.MatchedType == DAppOperationRequest { + let matchers: [Cuckoo.ParameterMatcher<(DAppOperationResponse, DAppOperationRequest)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: request) { $0.1 }] + return cuckoo_manager.verify("didReceiveConfirmationResponse(_: DAppOperationResponse, for: DAppOperationRequest)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class DAppOperationConfirmDelegateStub: DAppOperationConfirmDelegate { + - func showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from: ControllerBackedProtocol?)", - parameters: (crowdloans, viewInfo, chainAsset, view), - escapingParameters: (crowdloans, viewInfo, chainAsset, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showYourContributions(crowdloans: crowdloans, viewInfo: viewInfo, chainAsset: chainAsset, from: view)) - + + + + + func didReceiveConfirmationResponse(_ response: DAppOperationResponse, for request: DAppOperationRequest) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + +import Cuckoo +@testable import novawallet + +import RobinHood + + + class MockDAppSearchViewProtocol: DAppSearchViewProtocol, Cuckoo.ProtocolMock { + typealias MocksType = DAppSearchViewProtocol - func selectChain(from view: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?) { - - return cuckoo_manager.call("selectChain(from: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?)", - parameters: (view, delegate, selectedChainAssetId), - escapingParameters: (view, delegate, selectedChainAssetId), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.selectChain(from: view, delegate: delegate, selectedChainAssetId: selectedChainAssetId)) - + typealias Stubbing = __StubbingProxy_DAppSearchViewProtocol + typealias Verification = __VerificationProxy_DAppSearchViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: DAppSearchViewProtocol? + + func enableDefaultImplementation(_ stub: DAppSearchViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + - func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } - return cuckoo_manager.call("showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", - parameters: (view, wallet), - escapingParameters: (view, wallet), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showWalletDetails(from: view, wallet: wallet)) + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } + + - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + + + func didReceive(initialQuery: String) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("didReceive(initialQuery: String)", + parameters: (initialQuery), + escapingParameters: (initialQuery), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.didReceive(initialQuery: initialQuery)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceiveDApp(viewModels: [DAppViewModel]) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("didReceiveDApp(viewModels: [DAppViewModel])", + parameters: (viewModels), + escapingParameters: (viewModels), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.didReceiveDApp(viewModels: viewModels)) } - struct __StubbingProxy_CrowdloanListWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppSearchViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -13205,39 +12203,29 @@ import SoraFoundation } - func presentContributionSetup(from view: M1, crowdloan: M2, displayInfo: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanListViewProtocol?, Crowdloan, CrowdloanDisplayInfo?)> where M1.OptionalMatchedType == CrowdloanListViewProtocol, M2.MatchedType == Crowdloan, M3.OptionalMatchedType == CrowdloanDisplayInfo { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanListViewProtocol?, Crowdloan, CrowdloanDisplayInfo?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: crowdloan) { $0.1 }, wrap(matchable: displayInfo) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "presentContributionSetup(from: CrowdloanListViewProtocol?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?)", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func showYourContributions(crowdloans: M1, viewInfo: M2, chainAsset: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<([Crowdloan], CrowdloansViewInfo, ChainAssetDisplayInfo, ControllerBackedProtocol?)> where M1.MatchedType == [Crowdloan], M2.MatchedType == CrowdloansViewInfo, M3.MatchedType == ChainAssetDisplayInfo, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<([Crowdloan], CrowdloansViewInfo, ChainAssetDisplayInfo, ControllerBackedProtocol?)>] = [wrap(matchable: crowdloans) { $0.0 }, wrap(matchable: viewInfo) { $0.1 }, wrap(matchable: chainAsset) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - func selectChain(from view: M1, delegate: M2, selectedChainAssetId: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, AssetSelectionDelegate, ChainAssetId?)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AssetSelectionDelegate, M3.OptionalMatchedType == ChainAssetId { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AssetSelectionDelegate, ChainAssetId?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }, wrap(matchable: selectedChainAssetId) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "selectChain(from: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?)", parameterMatchers: matchers)) + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func showWalletDetails(from view: M1, wallet: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, MetaAccountModel)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaAccountModel)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: wallet) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", parameterMatchers: matchers)) - } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceive(initialQuery: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: initialQuery) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchViewProtocol.self, method: "didReceive(initialQuery: String)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveDApp(viewModels: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([DAppViewModel])> where M1.MatchedType == [DAppViewModel] { + let matchers: [Cuckoo.ParameterMatcher<([DAppViewModel])>] = [wrap(matchable: viewModels) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchViewProtocol.self, method: "didReceiveDApp(viewModels: [DAppViewModel])", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanListWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppSearchViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -13249,182 +12237,173 @@ import SoraFoundation } - - @discardableResult - func presentContributionSetup(from view: M1, crowdloan: M2, displayInfo: M3) -> Cuckoo.__DoNotUse<(CrowdloanListViewProtocol?, Crowdloan, CrowdloanDisplayInfo?), Void> where M1.OptionalMatchedType == CrowdloanListViewProtocol, M2.MatchedType == Crowdloan, M3.OptionalMatchedType == CrowdloanDisplayInfo { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanListViewProtocol?, Crowdloan, CrowdloanDisplayInfo?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: crowdloan) { $0.1 }, wrap(matchable: displayInfo) { $0.2 }] - return cuckoo_manager.verify("presentContributionSetup(from: CrowdloanListViewProtocol?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func showYourContributions(crowdloans: M1, viewInfo: M2, chainAsset: M3, from view: M4) -> Cuckoo.__DoNotUse<([Crowdloan], CrowdloansViewInfo, ChainAssetDisplayInfo, ControllerBackedProtocol?), Void> where M1.MatchedType == [Crowdloan], M2.MatchedType == CrowdloansViewInfo, M3.MatchedType == ChainAssetDisplayInfo, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<([Crowdloan], CrowdloansViewInfo, ChainAssetDisplayInfo, ControllerBackedProtocol?)>] = [wrap(matchable: crowdloans) { $0.0 }, wrap(matchable: viewInfo) { $0.1 }, wrap(matchable: chainAsset) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func selectChain(from view: M1, delegate: M2, selectedChainAssetId: M3) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, AssetSelectionDelegate, ChainAssetId?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AssetSelectionDelegate, M3.OptionalMatchedType == ChainAssetId { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AssetSelectionDelegate, ChainAssetId?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }, wrap(matchable: selectedChainAssetId) { $0.2 }] - return cuckoo_manager.verify("selectChain(from: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func showWalletDetails(from view: M1, wallet: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, MetaAccountModel), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaAccountModel)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: wallet) { $0.1 }] - return cuckoo_manager.verify("showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } + @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(initialQuery: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: initialQuery) { $0 }] + return cuckoo_manager.verify("didReceive(initialQuery: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveDApp(viewModels: M1) -> Cuckoo.__DoNotUse<([DAppViewModel]), Void> where M1.MatchedType == [DAppViewModel] { + let matchers: [Cuckoo.ParameterMatcher<([DAppViewModel])>] = [wrap(matchable: viewModels) { $0 }] + return cuckoo_manager.verify("didReceiveDApp(viewModels: [DAppViewModel])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanListWireframeProtocolStub: CrowdloanListWireframeProtocol { - - - - - - - - func presentContributionSetup(from view: CrowdloanListViewProtocol?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - + class DAppSearchViewProtocolStub: DAppSearchViewProtocol { + - func showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + - - func selectChain(from view: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + - - func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func didReceive(initialQuery: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceiveDApp(viewModels: [DAppViewModel]) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import Foundation -import SoraFoundation - - class MockCrowdloanYourContributionsViewProtocol: CrowdloanYourContributionsViewProtocol, Cuckoo.ProtocolMock { + class MockDAppSearchPresenterProtocol: DAppSearchPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanYourContributionsViewProtocol + typealias MocksType = DAppSearchPresenterProtocol - typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsViewProtocol - typealias Verification = __VerificationProxy_CrowdloanYourContributionsViewProtocol + typealias Stubbing = __StubbingProxy_DAppSearchPresenterProtocol + typealias Verification = __VerificationProxy_DAppSearchPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanYourContributionsViewProtocol? + private var __defaultImplStub: DAppSearchPresenterProtocol? - func enableDefaultImplementation(_ stub: CrowdloanYourContributionsViewProtocol) { + func enableDefaultImplementation(_ stub: DAppSearchPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func updateSearch(query: String) { + + return cuckoo_manager.call("updateSearch(query: String)", + parameters: (query), + escapingParameters: (query), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.updateSearch(query: query)) } - - + + func selectDApp(viewModel: DAppViewModel) { + + return cuckoo_manager.call("selectDApp(viewModel: DAppViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.selectDApp(viewModel: viewModel)) + + } - func reload(model: CrowdloanYourContributionsViewModel) { + func selectSearchQuery() { - return cuckoo_manager.call("reload(model: CrowdloanYourContributionsViewModel)", - parameters: (model), - escapingParameters: (model), + return cuckoo_manager.call("selectSearchQuery()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload(model: model)) + defaultCall: __defaultImplStub!.selectSearchQuery()) } - func reload(returnInIntervals: [FormattedReturnInIntervalsViewModel]) { + func cancel() { - return cuckoo_manager.call("reload(returnInIntervals: [FormattedReturnInIntervalsViewModel])", - parameters: (returnInIntervals), - escapingParameters: (returnInIntervals), + return cuckoo_manager.call("cancel()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload(returnInIntervals: returnInIntervals)) + defaultCall: __defaultImplStub!.cancel()) } - struct __StubbingProxy_CrowdloanYourContributionsViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppSearchPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -13432,29 +12411,34 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func updateSearch(query: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: query) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "updateSearch(query: String)", parameterMatchers: matchers)) } + func selectDApp(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppViewModel)> where M1.MatchedType == DAppViewModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "selectDApp(viewModel: DAppViewModel)", parameterMatchers: matchers)) + } - func reload(model: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanYourContributionsViewModel)> where M1.MatchedType == CrowdloanYourContributionsViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewModel)>] = [wrap(matchable: model) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsViewProtocol.self, method: "reload(model: CrowdloanYourContributionsViewModel)", parameterMatchers: matchers)) + func selectSearchQuery() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "selectSearchQuery()", parameterMatchers: matchers)) } - func reload(returnInIntervals: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([FormattedReturnInIntervalsViewModel])> where M1.MatchedType == [FormattedReturnInIntervalsViewModel] { - let matchers: [Cuckoo.ParameterMatcher<([FormattedReturnInIntervalsViewModel])>] = [wrap(matchable: returnInIntervals) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsViewProtocol.self, method: "reload(returnInIntervals: [FormattedReturnInIntervalsViewModel])", parameterMatchers: matchers)) + func cancel() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "cancel()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanYourContributionsViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppSearchPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -13466,66 +12450,74 @@ import SoraFoundation } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func updateSearch(query: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: query) { $0 }] + return cuckoo_manager.verify("updateSearch(query: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - + @discardableResult + func selectDApp(viewModel: M1) -> Cuckoo.__DoNotUse<(DAppViewModel), Void> where M1.MatchedType == DAppViewModel { + let matchers: [Cuckoo.ParameterMatcher<(DAppViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("selectDApp(viewModel: DAppViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } @discardableResult - func reload(model: M1) -> Cuckoo.__DoNotUse<(CrowdloanYourContributionsViewModel), Void> where M1.MatchedType == CrowdloanYourContributionsViewModel { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewModel)>] = [wrap(matchable: model) { $0 }] - return cuckoo_manager.verify("reload(model: CrowdloanYourContributionsViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectSearchQuery() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectSearchQuery()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func reload(returnInIntervals: M1) -> Cuckoo.__DoNotUse<([FormattedReturnInIntervalsViewModel]), Void> where M1.MatchedType == [FormattedReturnInIntervalsViewModel] { - let matchers: [Cuckoo.ParameterMatcher<([FormattedReturnInIntervalsViewModel])>] = [wrap(matchable: returnInIntervals) { $0 }] - return cuckoo_manager.verify("reload(returnInIntervals: [FormattedReturnInIntervalsViewModel])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func cancel() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("cancel()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanYourContributionsViewProtocolStub: CrowdloanYourContributionsViewProtocol { - + class DAppSearchPresenterProtocolStub: DAppSearchPresenterProtocol { + - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + + + + + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - + + func updateSearch(query: String) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - + func selectDApp(viewModel: DAppViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func reload(model: CrowdloanYourContributionsViewModel) { + + func selectSearchQuery() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func reload(returnInIntervals: [FormattedReturnInIntervalsViewModel]) { + func cancel() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -13533,19 +12525,19 @@ import SoraFoundation - class MockCrowdloanYourContributionsPresenterProtocol: CrowdloanYourContributionsPresenterProtocol, Cuckoo.ProtocolMock { + class MockDAppSearchInteractorInputProtocol: DAppSearchInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanYourContributionsPresenterProtocol + typealias MocksType = DAppSearchInteractorInputProtocol - typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsPresenterProtocol - typealias Verification = __VerificationProxy_CrowdloanYourContributionsPresenterProtocol + typealias Stubbing = __StubbingProxy_DAppSearchInteractorInputProtocol + typealias Verification = __VerificationProxy_DAppSearchInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanYourContributionsPresenterProtocol? + private var __defaultImplStub: DAppSearchInteractorInputProtocol? - func enableDefaultImplementation(_ stub: CrowdloanYourContributionsPresenterProtocol) { + func enableDefaultImplementation(_ stub: DAppSearchInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -13572,7 +12564,7 @@ import SoraFoundation } - struct __StubbingProxy_CrowdloanYourContributionsPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppSearchInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -13582,12 +12574,12 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanYourContributionsPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppSearchInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -13610,7 +12602,7 @@ import SoraFoundation } } - class CrowdloanYourContributionsPresenterProtocolStub: CrowdloanYourContributionsPresenterProtocol { + class DAppSearchInteractorInputProtocolStub: DAppSearchInteractorInputProtocol { @@ -13626,19 +12618,19 @@ import SoraFoundation - class MockCrowdloanYourContributionsVMFactoryProtocol: CrowdloanYourContributionsVMFactoryProtocol, Cuckoo.ProtocolMock { + class MockDAppSearchInteractorOutputProtocol: DAppSearchInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanYourContributionsVMFactoryProtocol + typealias MocksType = DAppSearchInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsVMFactoryProtocol - typealias Verification = __VerificationProxy_CrowdloanYourContributionsVMFactoryProtocol + typealias Stubbing = __StubbingProxy_DAppSearchInteractorOutputProtocol + typealias Verification = __VerificationProxy_DAppSearchInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanYourContributionsVMFactoryProtocol? + private var __defaultImplStub: DAppSearchInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: CrowdloanYourContributionsVMFactoryProtocol) { + func enableDefaultImplementation(_ stub: DAppSearchInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -13651,36 +12643,36 @@ import SoraFoundation - func createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel { + func didReceive(dAppsResult: Result) { - return cuckoo_manager.call("createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel", - parameters: (input, externalContributions, amount, price, locale), - escapingParameters: (input, externalContributions, amount, price, locale), + return cuckoo_manager.call("didReceive(dAppsResult: Result)", + parameters: (dAppsResult), + escapingParameters: (dAppsResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.createViewModel(input: input, externalContributions: externalContributions, amount: amount, price: price, locale: locale)) + defaultCall: __defaultImplStub!.didReceive(dAppsResult: dAppsResult)) } - func createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel] { + func didReceiveFavorite(changes: [DataProviderChange]) { - return cuckoo_manager.call("createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel]", - parameters: (input, externalContributions, metadata), - escapingParameters: (input, externalContributions, metadata), + return cuckoo_manager.call("didReceiveFavorite(changes: [DataProviderChange])", + parameters: (changes), + escapingParameters: (changes), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.createReturnInIntervals(input: input, externalContributions: externalContributions, metadata: metadata)) + defaultCall: __defaultImplStub!.didReceiveFavorite(changes: changes)) } - struct __StubbingProxy_CrowdloanYourContributionsVMFactoryProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppSearchInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -13688,19 +12680,19 @@ import SoraFoundation } - func createViewModel(input: M1, externalContributions: M2, amount: M3, price: M4, locale: M5) -> Cuckoo.ProtocolStubFunction<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, Decimal, PriceData?, Locale), CrowdloanYourContributionsViewModel> where M1.MatchedType == CrowdloanYourContributionsViewInput, M2.OptionalMatchedType == [ExternalContribution], M3.MatchedType == Decimal, M4.OptionalMatchedType == PriceData, M5.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, Decimal, PriceData?, Locale)>] = [wrap(matchable: input) { $0.0 }, wrap(matchable: externalContributions) { $0.1 }, wrap(matchable: amount) { $0.2 }, wrap(matchable: price) { $0.3 }, wrap(matchable: locale) { $0.4 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsVMFactoryProtocol.self, method: "createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel", parameterMatchers: matchers)) + func didReceive(dAppsResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: dAppsResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchInteractorOutputProtocol.self, method: "didReceive(dAppsResult: Result)", parameterMatchers: matchers)) } - func createReturnInIntervals(input: M1, externalContributions: M2, metadata: M3) -> Cuckoo.ProtocolStubFunction<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, CrowdloanMetadata), [ReturnInIntervalsViewModel]> where M1.MatchedType == CrowdloanYourContributionsViewInput, M2.OptionalMatchedType == [ExternalContribution], M3.MatchedType == CrowdloanMetadata { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, CrowdloanMetadata)>] = [wrap(matchable: input) { $0.0 }, wrap(matchable: externalContributions) { $0.1 }, wrap(matchable: metadata) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsVMFactoryProtocol.self, method: "createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel]", parameterMatchers: matchers)) + func didReceiveFavorite(changes: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([DataProviderChange])> where M1.MatchedType == [DataProviderChange] { + let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchInteractorOutputProtocol.self, method: "didReceiveFavorite(changes: [DataProviderChange])", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanYourContributionsVMFactoryProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppSearchInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -13715,21 +12707,21 @@ import SoraFoundation @discardableResult - func createViewModel(input: M1, externalContributions: M2, amount: M3, price: M4, locale: M5) -> Cuckoo.__DoNotUse<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, Decimal, PriceData?, Locale), CrowdloanYourContributionsViewModel> where M1.MatchedType == CrowdloanYourContributionsViewInput, M2.OptionalMatchedType == [ExternalContribution], M3.MatchedType == Decimal, M4.OptionalMatchedType == PriceData, M5.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, Decimal, PriceData?, Locale)>] = [wrap(matchable: input) { $0.0 }, wrap(matchable: externalContributions) { $0.1 }, wrap(matchable: amount) { $0.2 }, wrap(matchable: price) { $0.3 }, wrap(matchable: locale) { $0.4 }] - return cuckoo_manager.verify("createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(dAppsResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: dAppsResult) { $0 }] + return cuckoo_manager.verify("didReceive(dAppsResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func createReturnInIntervals(input: M1, externalContributions: M2, metadata: M3) -> Cuckoo.__DoNotUse<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, CrowdloanMetadata), [ReturnInIntervalsViewModel]> where M1.MatchedType == CrowdloanYourContributionsViewInput, M2.OptionalMatchedType == [ExternalContribution], M3.MatchedType == CrowdloanMetadata { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, CrowdloanMetadata)>] = [wrap(matchable: input) { $0.0 }, wrap(matchable: externalContributions) { $0.1 }, wrap(matchable: metadata) { $0.2 }] - return cuckoo_manager.verify("createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel]", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFavorite(changes: M1) -> Cuckoo.__DoNotUse<([DataProviderChange]), Void> where M1.MatchedType == [DataProviderChange] { + let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] + return cuckoo_manager.verify("didReceiveFavorite(changes: [DataProviderChange])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanYourContributionsVMFactoryProtocolStub: CrowdloanYourContributionsVMFactoryProtocol { + class DAppSearchInteractorOutputProtocolStub: DAppSearchInteractorOutputProtocol { @@ -13737,33 +12729,33 @@ import SoraFoundation - func createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel { - return DefaultValueRegistry.defaultValue(for: (CrowdloanYourContributionsViewModel).self) + func didReceive(dAppsResult: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel] { - return DefaultValueRegistry.defaultValue(for: ([ReturnInIntervalsViewModel]).self) + func didReceiveFavorite(changes: [DataProviderChange]) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } } - class MockCrowdloanYourContributionsInteractorInputProtocol: CrowdloanYourContributionsInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockDAppSearchWireframeProtocol: DAppSearchWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanYourContributionsInteractorInputProtocol + typealias MocksType = DAppSearchWireframeProtocol - typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsInteractorInputProtocol - typealias Verification = __VerificationProxy_CrowdloanYourContributionsInteractorInputProtocol + typealias Stubbing = __StubbingProxy_DAppSearchWireframeProtocol + typealias Verification = __VerificationProxy_DAppSearchWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanYourContributionsInteractorInputProtocol? + private var __defaultImplStub: DAppSearchWireframeProtocol? - func enableDefaultImplementation(_ stub: CrowdloanYourContributionsInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: DAppSearchWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -13776,21 +12768,21 @@ import SoraFoundation - func setup() { + func close(from view: DAppSearchViewProtocol?) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("close(from: DAppSearchViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.close(from: view)) } - struct __StubbingProxy_CrowdloanYourContributionsInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_DAppSearchWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -13798,14 +12790,14 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + func close(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppSearchViewProtocol?)> where M1.OptionalMatchedType == DAppSearchViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppSearchViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchWireframeProtocol.self, method: "close(from: DAppSearchViewProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanYourContributionsInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_DAppSearchWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -13820,15 +12812,15 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close(from view: M1) -> Cuckoo.__DoNotUse<(DAppSearchViewProtocol?), Void> where M1.OptionalMatchedType == DAppSearchViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppSearchViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(from: DAppSearchViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanYourContributionsInteractorInputProtocolStub: CrowdloanYourContributionsInteractorInputProtocol { + class DAppSearchWireframeProtocolStub: DAppSearchWireframeProtocol { @@ -13836,7 +12828,7 @@ import SoraFoundation - func setup() { + func close(from view: DAppSearchViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -13844,19 +12836,19 @@ import SoraFoundation - class MockCrowdloanYourContributionsInteractorOutputProtocol: CrowdloanYourContributionsInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockDAppSearchDelegate: DAppSearchDelegate, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanYourContributionsInteractorOutputProtocol + typealias MocksType = DAppSearchDelegate - typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsInteractorOutputProtocol - typealias Verification = __VerificationProxy_CrowdloanYourContributionsInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_DAppSearchDelegate + typealias Verification = __VerificationProxy_DAppSearchDelegate let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanYourContributionsInteractorOutputProtocol? + private var __defaultImplStub: DAppSearchDelegate? - func enableDefaultImplementation(_ stub: CrowdloanYourContributionsInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: DAppSearchDelegate) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -13869,111 +12861,163 @@ import SoraFoundation - func didReceiveExternalContributions(_ externalContributions: [ExternalContribution]) { + func didCompleteDAppSearchResult(_ result: DAppSearchResult) { - return cuckoo_manager.call("didReceiveExternalContributions(_: [ExternalContribution])", - parameters: (externalContributions), - escapingParameters: (externalContributions), + return cuckoo_manager.call("didCompleteDAppSearchResult(_: DAppSearchResult)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveExternalContributions(externalContributions)) + defaultCall: __defaultImplStub!.didCompleteDAppSearchResult(result)) } + + struct __StubbingProxy_DAppSearchDelegate: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func didCompleteDAppSearchResult(_ result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppSearchResult)> where M1.MatchedType == DAppSearchResult { + let matchers: [Cuckoo.ParameterMatcher<(DAppSearchResult)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchDelegate.self, method: "didCompleteDAppSearchResult(_: DAppSearchResult)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_DAppSearchDelegate: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didCompleteDAppSearchResult(_ result: M1) -> Cuckoo.__DoNotUse<(DAppSearchResult), Void> where M1.MatchedType == DAppSearchResult { + let matchers: [Cuckoo.ParameterMatcher<(DAppSearchResult)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didCompleteDAppSearchResult(_: DAppSearchResult)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class DAppSearchDelegateStub: DAppSearchDelegate { + + + - func didReceiveBlockNumber(_ blockNumber: BlockNumber?) { - - return cuckoo_manager.call("didReceiveBlockNumber(_: BlockNumber?)", - parameters: (blockNumber), - escapingParameters: (blockNumber), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBlockNumber(blockNumber)) - + + + func didCompleteDAppSearchResult(_ result: DAppSearchResult) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + +import Cuckoo +@testable import novawallet + +import Foundation +import SoraFoundation + + + class MockAccountExportPasswordViewProtocol: AccountExportPasswordViewProtocol, Cuckoo.ProtocolMock { + typealias MocksType = AccountExportPasswordViewProtocol - func didReceiveBlockDuration(_ blockDuration: BlockTime) { - - return cuckoo_manager.call("didReceiveBlockDuration(_: BlockTime)", - parameters: (blockDuration), - escapingParameters: (blockDuration), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveBlockDuration(blockDuration)) - + typealias Stubbing = __StubbingProxy_AccountExportPasswordViewProtocol + typealias Verification = __VerificationProxy_AccountExportPasswordViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: AccountExportPasswordViewProtocol? + + func enableDefaultImplementation(_ stub: AccountExportPasswordViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + - func didReceiveLeasingPeriod(_ leasingPeriod: LeasingPeriod) { - - return cuckoo_manager.call("didReceiveLeasingPeriod(_: LeasingPeriod)", - parameters: (leasingPeriod), - escapingParameters: (leasingPeriod), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(leasingPeriod)) + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } - func didReceiveLeasingOffset(_ leasingOffset: LeasingOffset) { - - return cuckoo_manager.call("didReceiveLeasingOffset(_: LeasingOffset)", - parameters: (leasingOffset), - escapingParameters: (leasingOffset), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLeasingOffset(leasingOffset)) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } + + + - func didReceivePrice(_ priceData: PriceData?) { + + func setPasswordInputViewModel(_ viewModel: InputViewModelProtocol) { - return cuckoo_manager.call("didReceivePrice(_: PriceData?)", - parameters: (priceData), - escapingParameters: (priceData), + return cuckoo_manager.call("setPasswordInputViewModel(_: InputViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePrice(priceData)) + defaultCall: __defaultImplStub!.setPasswordInputViewModel(viewModel)) } - func didReceiveError(_ error: Error) { + func setPasswordConfirmationViewModel(_ viewModel: InputViewModelProtocol) { - return cuckoo_manager.call("didReceiveError(_: Error)", - parameters: (error), - escapingParameters: (error), + return cuckoo_manager.call("setPasswordConfirmationViewModel(_: InputViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveError(error)) + defaultCall: __defaultImplStub!.setPasswordConfirmationViewModel(viewModel)) } - struct __StubbingProxy_CrowdloanYourContributionsInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_AccountExportPasswordViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -13981,44 +13025,29 @@ import SoraFoundation } - func didReceiveExternalContributions(_ externalContributions: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([ExternalContribution])> where M1.MatchedType == [ExternalContribution] { - let matchers: [Cuckoo.ParameterMatcher<([ExternalContribution])>] = [wrap(matchable: externalContributions) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveExternalContributions(_: [ExternalContribution])", parameterMatchers: matchers)) - } - - func didReceiveBlockNumber(_ blockNumber: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BlockNumber?)> where M1.OptionalMatchedType == BlockNumber { - let matchers: [Cuckoo.ParameterMatcher<(BlockNumber?)>] = [wrap(matchable: blockNumber) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveBlockNumber(_: BlockNumber?)", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func didReceiveBlockDuration(_ blockDuration: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BlockTime)> where M1.MatchedType == BlockTime { - let matchers: [Cuckoo.ParameterMatcher<(BlockTime)>] = [wrap(matchable: blockDuration) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveBlockDuration(_: BlockTime)", parameterMatchers: matchers)) - } - func didReceiveLeasingPeriod(_ leasingPeriod: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LeasingPeriod)> where M1.MatchedType == LeasingPeriod { - let matchers: [Cuckoo.ParameterMatcher<(LeasingPeriod)>] = [wrap(matchable: leasingPeriod) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(_: LeasingPeriod)", parameterMatchers: matchers)) + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func didReceiveLeasingOffset(_ leasingOffset: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LeasingOffset)> where M1.MatchedType == LeasingOffset { - let matchers: [Cuckoo.ParameterMatcher<(LeasingOffset)>] = [wrap(matchable: leasingOffset) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(_: LeasingOffset)", parameterMatchers: matchers)) - } - func didReceivePrice(_ priceData: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PriceData?)> where M1.OptionalMatchedType == PriceData { - let matchers: [Cuckoo.ParameterMatcher<(PriceData?)>] = [wrap(matchable: priceData) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceivePrice(_: PriceData?)", parameterMatchers: matchers)) + func setPasswordInputViewModel(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(InputViewModelProtocol)> where M1.MatchedType == InputViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordViewProtocol.self, method: "setPasswordInputViewModel(_: InputViewModelProtocol)", parameterMatchers: matchers)) } - func didReceiveError(_ error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveError(_: Error)", parameterMatchers: matchers)) + func setPasswordConfirmationViewModel(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(InputViewModelProtocol)> where M1.MatchedType == InputViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordViewProtocol.self, method: "setPasswordConfirmationViewModel(_: InputViewModelProtocol)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CrowdloanYourContributionsInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_AccountExportPasswordViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -14030,98 +13059,66 @@ import SoraFoundation } - - - @discardableResult - func didReceiveExternalContributions(_ externalContributions: M1) -> Cuckoo.__DoNotUse<([ExternalContribution]), Void> where M1.MatchedType == [ExternalContribution] { - let matchers: [Cuckoo.ParameterMatcher<([ExternalContribution])>] = [wrap(matchable: externalContributions) { $0 }] - return cuckoo_manager.verify("didReceiveExternalContributions(_: [ExternalContribution])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveBlockNumber(_ blockNumber: M1) -> Cuckoo.__DoNotUse<(BlockNumber?), Void> where M1.OptionalMatchedType == BlockNumber { - let matchers: [Cuckoo.ParameterMatcher<(BlockNumber?)>] = [wrap(matchable: blockNumber) { $0 }] - return cuckoo_manager.verify("didReceiveBlockNumber(_: BlockNumber?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceiveBlockDuration(_ blockDuration: M1) -> Cuckoo.__DoNotUse<(BlockTime), Void> where M1.MatchedType == BlockTime { - let matchers: [Cuckoo.ParameterMatcher<(BlockTime)>] = [wrap(matchable: blockDuration) { $0 }] - return cuckoo_manager.verify("didReceiveBlockDuration(_: BlockTime)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveLeasingPeriod(_ leasingPeriod: M1) -> Cuckoo.__DoNotUse<(LeasingPeriod), Void> where M1.MatchedType == LeasingPeriod { - let matchers: [Cuckoo.ParameterMatcher<(LeasingPeriod)>] = [wrap(matchable: leasingPeriod) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingPeriod(_: LeasingPeriod)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceiveLeasingOffset(_ leasingOffset: M1) -> Cuckoo.__DoNotUse<(LeasingOffset), Void> where M1.MatchedType == LeasingOffset { - let matchers: [Cuckoo.ParameterMatcher<(LeasingOffset)>] = [wrap(matchable: leasingOffset) { $0 }] - return cuckoo_manager.verify("didReceiveLeasingOffset(_: LeasingOffset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } + @discardableResult - func didReceivePrice(_ priceData: M1) -> Cuckoo.__DoNotUse<(PriceData?), Void> where M1.OptionalMatchedType == PriceData { - let matchers: [Cuckoo.ParameterMatcher<(PriceData?)>] = [wrap(matchable: priceData) { $0 }] - return cuckoo_manager.verify("didReceivePrice(_: PriceData?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setPasswordInputViewModel(_ viewModel: M1) -> Cuckoo.__DoNotUse<(InputViewModelProtocol), Void> where M1.MatchedType == InputViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("setPasswordInputViewModel(_: InputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveError(_ error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return cuckoo_manager.verify("didReceiveError(_: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setPasswordConfirmationViewModel(_ viewModel: M1) -> Cuckoo.__DoNotUse<(InputViewModelProtocol), Void> where M1.MatchedType == InputViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("setPasswordConfirmationViewModel(_: InputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CrowdloanYourContributionsInteractorOutputProtocolStub: CrowdloanYourContributionsInteractorOutputProtocol { - - - - - - - - func didReceiveExternalContributions(_ externalContributions: [ExternalContribution]) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveBlockNumber(_ blockNumber: BlockNumber?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - + class AccountExportPasswordViewProtocolStub: AccountExportPasswordViewProtocol { + - func didReceiveBlockDuration(_ blockDuration: BlockTime) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + - - func didReceiveLeasingPeriod(_ leasingPeriod: LeasingPeriod) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + - - func didReceiveLeasingOffset(_ leasingOffset: LeasingOffset) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceivePrice(_ priceData: PriceData?) { + func setPasswordInputViewModel(_ viewModel: InputViewModelProtocol) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveError(_ error: Error) { + func setPasswordConfirmationViewModel(_ viewModel: InputViewModelProtocol) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -14129,19 +13126,19 @@ import SoraFoundation - class MockCrowdloanYourContributionsWireframeProtocol: CrowdloanYourContributionsWireframeProtocol, Cuckoo.ProtocolMock { + class MockAccountExportPasswordPresenterProtocol: AccountExportPasswordPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CrowdloanYourContributionsWireframeProtocol + typealias MocksType = AccountExportPasswordPresenterProtocol - typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsWireframeProtocol - typealias Verification = __VerificationProxy_CrowdloanYourContributionsWireframeProtocol + typealias Stubbing = __StubbingProxy_AccountExportPasswordPresenterProtocol + typealias Verification = __VerificationProxy_AccountExportPasswordPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CrowdloanYourContributionsWireframeProtocol? + private var __defaultImplStub: AccountExportPasswordPresenterProtocol? - func enableDefaultImplementation(_ stub: CrowdloanYourContributionsWireframeProtocol) { + func enableDefaultImplementation(_ stub: AccountExportPasswordPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -14152,8 +13149,38 @@ import SoraFoundation + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) + + } + + + + func proceed() { + + return cuckoo_manager.call("proceed()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.proceed()) + + } + - struct __StubbingProxy_CrowdloanYourContributionsWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_AccountExportPasswordPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -14161,9 +13188,19 @@ import SoraFoundation } + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + } + } - struct __VerificationProxy_CrowdloanYourContributionsWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_AccountExportPasswordPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -14177,37 +13214,56 @@ import SoraFoundation + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class CrowdloanYourContributionsWireframeProtocolStub: CrowdloanYourContributionsWireframeProtocol { + class AccountExportPasswordPresenterProtocolStub: AccountExportPasswordPresenterProtocol { + + + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func proceed() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } -import Cuckoo -@testable import novawallet - -import Foundation - - class MockCustomCrowdloanDelegate: CustomCrowdloanDelegate, Cuckoo.ProtocolMock { + class MockAccountExportPasswordInteractorInputProtocol: AccountExportPasswordInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CustomCrowdloanDelegate + typealias MocksType = AccountExportPasswordInteractorInputProtocol - typealias Stubbing = __StubbingProxy_CustomCrowdloanDelegate - typealias Verification = __VerificationProxy_CustomCrowdloanDelegate + typealias Stubbing = __StubbingProxy_AccountExportPasswordInteractorInputProtocol + typealias Verification = __VerificationProxy_AccountExportPasswordInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CustomCrowdloanDelegate? + private var __defaultImplStub: AccountExportPasswordInteractorInputProtocol? - func enableDefaultImplementation(_ stub: CustomCrowdloanDelegate) { + func enableDefaultImplementation(_ stub: AccountExportPasswordInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -14220,21 +13276,21 @@ import Foundation - func didReceive(bonusService: CrowdloanBonusServiceProtocol) { + func exportAccount(password: String) { - return cuckoo_manager.call("didReceive(bonusService: CrowdloanBonusServiceProtocol)", - parameters: (bonusService), - escapingParameters: (bonusService), + return cuckoo_manager.call("exportAccount(password: String)", + parameters: (password), + escapingParameters: (password), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(bonusService: bonusService)) + defaultCall: __defaultImplStub!.exportAccount(password: password)) } - struct __StubbingProxy_CustomCrowdloanDelegate: Cuckoo.StubbingProxy { + struct __StubbingProxy_AccountExportPasswordInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -14242,14 +13298,14 @@ import Foundation } - func didReceive(bonusService: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanBonusServiceProtocol)> where M1.MatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanBonusServiceProtocol)>] = [wrap(matchable: bonusService) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomCrowdloanDelegate.self, method: "didReceive(bonusService: CrowdloanBonusServiceProtocol)", parameterMatchers: matchers)) + func exportAccount(password: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: password) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordInteractorInputProtocol.self, method: "exportAccount(password: String)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CustomCrowdloanDelegate: Cuckoo.VerificationProxy { + struct __VerificationProxy_AccountExportPasswordInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -14264,15 +13320,15 @@ import Foundation @discardableResult - func didReceive(bonusService: M1) -> Cuckoo.__DoNotUse<(CrowdloanBonusServiceProtocol), Void> where M1.MatchedType == CrowdloanBonusServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(CrowdloanBonusServiceProtocol)>] = [wrap(matchable: bonusService) { $0 }] - return cuckoo_manager.verify("didReceive(bonusService: CrowdloanBonusServiceProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func exportAccount(password: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: password) { $0 }] + return cuckoo_manager.verify("exportAccount(password: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CustomCrowdloanDelegateStub: CustomCrowdloanDelegate { + class AccountExportPasswordInteractorInputProtocolStub: AccountExportPasswordInteractorInputProtocol { @@ -14280,205 +13336,209 @@ import Foundation - func didReceive(bonusService: CrowdloanBonusServiceProtocol) { + func exportAccount(password: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import SoraFoundation - - class MockReferralCrowdloanViewProtocol: ReferralCrowdloanViewProtocol, Cuckoo.ProtocolMock { + class MockAccountExportPasswordInteractorOutputProtocol: AccountExportPasswordInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ReferralCrowdloanViewProtocol + typealias MocksType = AccountExportPasswordInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_ReferralCrowdloanViewProtocol - typealias Verification = __VerificationProxy_ReferralCrowdloanViewProtocol + typealias Stubbing = __StubbingProxy_AccountExportPasswordInteractorOutputProtocol + typealias Verification = __VerificationProxy_AccountExportPasswordInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ReferralCrowdloanViewProtocol? + private var __defaultImplStub: AccountExportPasswordInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: ReferralCrowdloanViewProtocol) { + func enableDefaultImplementation(_ stub: AccountExportPasswordInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } + - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func didExport(json: RestoreJson) { + + return cuckoo_manager.call("didExport(json: RestoreJson)", + parameters: (json), + escapingParameters: (json), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didExport(json: json)) } - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } + func didReceive(error: Error) { - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } + return cuckoo_manager.call("didReceive(error: Error)", + parameters: (error), + escapingParameters: (error), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(error: error)) } + struct __StubbingProxy_AccountExportPasswordInteractorOutputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func didExport(json: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RestoreJson)> where M1.MatchedType == RestoreJson { + let matchers: [Cuckoo.ParameterMatcher<(RestoreJson)>] = [wrap(matchable: json) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordInteractorOutputProtocol.self, method: "didExport(json: RestoreJson)", parameterMatchers: matchers)) + } + + func didReceive(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordInteractorOutputProtocol.self, method: "didReceive(error: Error)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_AccountExportPasswordInteractorOutputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didExport(json: M1) -> Cuckoo.__DoNotUse<(RestoreJson), Void> where M1.MatchedType == RestoreJson { + let matchers: [Cuckoo.ParameterMatcher<(RestoreJson)>] = [wrap(matchable: json) { $0 }] + return cuckoo_manager.verify("didExport(json: RestoreJson)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return cuckoo_manager.verify("didReceive(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class AccountExportPasswordInteractorOutputProtocolStub: AccountExportPasswordInteractorOutputProtocol { + + - func didReceiveLearnMore(viewModel: LearnMoreViewModel) { - - return cuckoo_manager.call("didReceiveLearnMore(viewModel: LearnMoreViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveLearnMore(viewModel: viewModel)) - + func didExport(json: RestoreJson) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveReferral(viewModel: ReferralCrowdloanViewModel) { - - return cuckoo_manager.call("didReceiveReferral(viewModel: ReferralCrowdloanViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveReferral(viewModel: viewModel)) - + func didReceive(error: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockAccountExportPasswordWireframeProtocol: AccountExportPasswordWireframeProtocol, Cuckoo.ProtocolMock { + typealias MocksType = AccountExportPasswordWireframeProtocol - func didReceiveInput(viewModel: InputViewModelProtocol) { - - return cuckoo_manager.call("didReceiveInput(viewModel: InputViewModelProtocol)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) - + typealias Stubbing = __StubbingProxy_AccountExportPasswordWireframeProtocol + typealias Verification = __VerificationProxy_AccountExportPasswordWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: AccountExportPasswordWireframeProtocol? + + func enableDefaultImplementation(_ stub: AccountExportPasswordWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didReceiveShouldInputCode() { - - return cuckoo_manager.call("didReceiveShouldInputCode()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveShouldInputCode()) - - } + - func didReceiveShouldAgreeTerms() { + func showJSONExport(_ json: RestoreJson, from view: AccountExportPasswordViewProtocol?) { - return cuckoo_manager.call("didReceiveShouldAgreeTerms()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("showJSONExport(_: RestoreJson, from: AccountExportPasswordViewProtocol?)", + parameters: (json, view), + escapingParameters: (json, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveShouldAgreeTerms()) + defaultCall: __defaultImplStub!.showJSONExport(json, from: view)) } - func didStartLoading() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didStartLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func didStopLoading() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didStopLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_ReferralCrowdloanViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_AccountExportPasswordWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -14486,64 +13546,185 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") + func showJSONExport(_ json: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(RestoreJson, AccountExportPasswordViewProtocol?)> where M1.MatchedType == RestoreJson, M2.OptionalMatchedType == AccountExportPasswordViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(RestoreJson, AccountExportPasswordViewProtocol?)>] = [wrap(matchable: json) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordWireframeProtocol.self, method: "showJSONExport(_: RestoreJson, from: AccountExportPasswordViewProtocol?)", parameterMatchers: matchers)) } - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + } + + struct __VerificationProxy_AccountExportPasswordWireframeProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation } + + - func didReceiveLearnMore(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LearnMoreViewModel)> where M1.MatchedType == LearnMoreViewModel { - let matchers: [Cuckoo.ParameterMatcher<(LearnMoreViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveLearnMore(viewModel: LearnMoreViewModel)", parameterMatchers: matchers)) + @discardableResult + func showJSONExport(_ json: M1, from view: M2) -> Cuckoo.__DoNotUse<(RestoreJson, AccountExportPasswordViewProtocol?), Void> where M1.MatchedType == RestoreJson, M2.OptionalMatchedType == AccountExportPasswordViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(RestoreJson, AccountExportPasswordViewProtocol?)>] = [wrap(matchable: json) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("showJSONExport(_: RestoreJson, from: AccountExportPasswordViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - func didReceiveReferral(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ReferralCrowdloanViewModel)> where M1.MatchedType == ReferralCrowdloanViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ReferralCrowdloanViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveReferral(viewModel: ReferralCrowdloanViewModel)", parameterMatchers: matchers)) + @discardableResult + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(InputViewModelProtocol)> where M1.MatchedType == InputViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveInput(viewModel: InputViewModelProtocol)", parameterMatchers: matchers)) + @discardableResult + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - func didReceiveShouldInputCode() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveShouldInputCode()", parameterMatchers: matchers)) + } +} + + class AccountExportPasswordWireframeProtocolStub: AccountExportPasswordWireframeProtocol { + + + + + + + + func showJSONExport(_ json: RestoreJson, from view: AccountExportPasswordViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + +import Cuckoo +@testable import novawallet + +import Foundation +import SoraFoundation + + + class MockExportGenericViewProtocol: ExportGenericViewProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = ExportGenericViewProtocol + + typealias Stubbing = __StubbingProxy_ExportGenericViewProtocol + typealias Verification = __VerificationProxy_ExportGenericViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: ExportGenericViewProtocol? + + func enableDefaultImplementation(_ stub: ExportGenericViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + + } + + + + + + + + func set(viewModel: ExportGenericViewModel) { + + return cuckoo_manager.call("set(viewModel: ExportGenericViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.set(viewModel: viewModel)) + + } + + + struct __StubbingProxy_ExportGenericViewProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager } - func didReceiveShouldAgreeTerms() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveShouldAgreeTerms()", parameterMatchers: matchers)) + + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + + func set(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewModel)> where M1.MatchedType == ExportGenericViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericViewProtocol.self, method: "set(viewModel: ExportGenericViewModel)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ReferralCrowdloanViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ExportGenericViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -14565,64 +13746,18 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveLearnMore(viewModel: M1) -> Cuckoo.__DoNotUse<(LearnMoreViewModel), Void> where M1.MatchedType == LearnMoreViewModel { - let matchers: [Cuckoo.ParameterMatcher<(LearnMoreViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveLearnMore(viewModel: LearnMoreViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveReferral(viewModel: M1) -> Cuckoo.__DoNotUse<(ReferralCrowdloanViewModel), Void> where M1.MatchedType == ReferralCrowdloanViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ReferralCrowdloanViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveReferral(viewModel: ReferralCrowdloanViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(InputViewModelProtocol), Void> where M1.MatchedType == InputViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveInput(viewModel: InputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveShouldInputCode() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didReceiveShouldInputCode()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveShouldAgreeTerms() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didReceiveShouldAgreeTerms()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func set(viewModel: M1) -> Cuckoo.__DoNotUse<(ExportGenericViewModel), Void> where M1.MatchedType == ExportGenericViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("set(viewModel: ExportGenericViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ReferralCrowdloanViewProtocolStub: ReferralCrowdloanViewProtocol { + class ExportGenericViewProtocolStub: ExportGenericViewProtocol { @@ -14641,24 +13776,6 @@ import SoraFoundation } } - - - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } @@ -14666,43 +13783,7 @@ import SoraFoundation - func didReceiveLearnMore(viewModel: LearnMoreViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveReferral(viewModel: ReferralCrowdloanViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveInput(viewModel: InputViewModelProtocol) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveShouldInputCode() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveShouldAgreeTerms() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didStartLoading() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didStopLoading() { + func set(viewModel: ExportGenericViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -14710,19 +13791,19 @@ import SoraFoundation - class MockReferralCrowdloanPresenterProtocol: ReferralCrowdloanPresenterProtocol, Cuckoo.ProtocolMock { + class MockExportGenericPresenterProtocol: ExportGenericPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ReferralCrowdloanPresenterProtocol + typealias MocksType = ExportGenericPresenterProtocol - typealias Stubbing = __StubbingProxy_ReferralCrowdloanPresenterProtocol - typealias Verification = __VerificationProxy_ReferralCrowdloanPresenterProtocol + typealias Stubbing = __StubbingProxy_ExportGenericPresenterProtocol + typealias Verification = __VerificationProxy_ExportGenericPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ReferralCrowdloanPresenterProtocol? + private var __defaultImplStub: ExportGenericPresenterProtocol? - func enableDefaultImplementation(_ stub: ReferralCrowdloanPresenterProtocol) { + func enableDefaultImplementation(_ stub: ExportGenericPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -14750,96 +13831,36 @@ import SoraFoundation - func update(referralCode: String) { - - return cuckoo_manager.call("update(referralCode: String)", - parameters: (referralCode), - escapingParameters: (referralCode), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.update(referralCode: referralCode)) - - } - - - - func applyDefaultCode() { + func activateExport() { - return cuckoo_manager.call("applyDefaultCode()", + return cuckoo_manager.call("activateExport()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyDefaultCode()) + defaultCall: __defaultImplStub!.activateExport()) } - func applyInputCode() { + func activateAdvancedSettings() { - return cuckoo_manager.call("applyInputCode()", + return cuckoo_manager.call("activateAdvancedSettings()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyInputCode()) - - } - - - - func setTermsAgreed(value: Bool) { - - return cuckoo_manager.call("setTermsAgreed(value: Bool)", - parameters: (value), - escapingParameters: (value), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setTermsAgreed(value: value)) - - } - - - - func presentTerms() { - - return cuckoo_manager.call("presentTerms()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentTerms()) - - } - - - - func presentLearnMore() { - - return cuckoo_manager.call("presentLearnMore()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentLearnMore()) + defaultCall: __defaultImplStub!.activateAdvancedSettings()) } - struct __StubbingProxy_ReferralCrowdloanPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ExportGenericPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -14849,42 +13870,22 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func update(referralCode: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: referralCode) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "update(referralCode: String)", parameterMatchers: matchers)) - } - - func applyDefaultCode() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "applyDefaultCode()", parameterMatchers: matchers)) - } - - func applyInputCode() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "applyInputCode()", parameterMatchers: matchers)) - } - - func setTermsAgreed(value: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: value) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "setTermsAgreed(value: Bool)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func presentTerms() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func activateExport() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "presentTerms()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericPresenterProtocol.self, method: "activateExport()", parameterMatchers: matchers)) } - func presentLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func activateAdvancedSettings() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "presentLearnMore()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericPresenterProtocol.self, method: "activateAdvancedSettings()", parameterMatchers: matchers)) } } - struct __VerificationProxy_ReferralCrowdloanPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ExportGenericPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -14905,45 +13906,21 @@ import SoraFoundation } @discardableResult - func update(referralCode: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: referralCode) { $0 }] - return cuckoo_manager.verify("update(referralCode: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func applyDefaultCode() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyDefaultCode()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func applyInputCode() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyInputCode()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func setTermsAgreed(value: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: value) { $0 }] - return cuckoo_manager.verify("setTermsAgreed(value: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentTerms() -> Cuckoo.__DoNotUse<(), Void> { + func activateExport() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentTerms()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("activateExport()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentLearnMore() -> Cuckoo.__DoNotUse<(), Void> { + func activateAdvancedSettings() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("activateAdvancedSettings()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ReferralCrowdloanPresenterProtocolStub: ReferralCrowdloanPresenterProtocol { + class ExportGenericPresenterProtocolStub: ExportGenericPresenterProtocol { @@ -14957,37 +13934,13 @@ import SoraFoundation - func update(referralCode: String) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func applyDefaultCode() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func applyInputCode() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func setTermsAgreed(value: Bool) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentTerms() { + func activateExport() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentLearnMore() { + func activateAdvancedSettings() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -14995,19 +13948,19 @@ import SoraFoundation - class MockReferralCrowdloanWireframeProtocol: ReferralCrowdloanWireframeProtocol, Cuckoo.ProtocolMock { + class MockExportGenericWireframeProtocol: ExportGenericWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ReferralCrowdloanWireframeProtocol + typealias MocksType = ExportGenericWireframeProtocol - typealias Stubbing = __StubbingProxy_ReferralCrowdloanWireframeProtocol - typealias Verification = __VerificationProxy_ReferralCrowdloanWireframeProtocol + typealias Stubbing = __StubbingProxy_ExportGenericWireframeProtocol + typealias Verification = __VerificationProxy_ExportGenericWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ReferralCrowdloanWireframeProtocol? + private var __defaultImplStub: ExportGenericWireframeProtocol? - func enableDefaultImplementation(_ stub: ReferralCrowdloanWireframeProtocol) { + func enableDefaultImplementation(_ stub: ExportGenericWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -15020,31 +13973,31 @@ import SoraFoundation - func complete(on view: ReferralCrowdloanViewProtocol?) { + func close(view: ExportGenericViewProtocol?) { - return cuckoo_manager.call("complete(on: ReferralCrowdloanViewProtocol?)", + return cuckoo_manager.call("close(view: ExportGenericViewProtocol?)", parameters: (view), escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.complete(on: view)) + defaultCall: __defaultImplStub!.close(view: view)) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), + return cuckoo_manager.call("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", + parameters: (view, secretSource, settings), + escapingParameters: (view, secretSource, settings), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + defaultCall: __defaultImplStub!.showAdvancedSettings(from: view, secretSource: secretSource, settings: settings)) } @@ -15078,8 +14031,23 @@ import SoraFoundation } + + + func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { + + return cuckoo_manager.call("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", + parameters: (source, view, completionHandler), + escapingParameters: (source, view, completionHandler), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.share(source: source, from: view, with: completionHandler)) + + } + - struct __StubbingProxy_ReferralCrowdloanWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ExportGenericWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -15087,29 +14055,34 @@ import SoraFoundation } - func complete(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ReferralCrowdloanViewProtocol?)> where M1.OptionalMatchedType == ReferralCrowdloanViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ReferralCrowdloanViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanWireframeProtocol.self, method: "complete(on: ReferralCrowdloanViewProtocol?)", parameterMatchers: matchers)) + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?)> where M1.OptionalMatchedType == ExportGenericViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "close(view: ExportGenericViewProtocol?)", parameterMatchers: matchers)) } - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { + let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ReferralCrowdloanWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ExportGenericWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -15124,15 +14097,15 @@ import SoraFoundation @discardableResult - func complete(on view: M1) -> Cuckoo.__DoNotUse<(ReferralCrowdloanViewProtocol?), Void> where M1.OptionalMatchedType == ReferralCrowdloanViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ReferralCrowdloanViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(on: ReferralCrowdloanViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close(view: M1) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: ExportGenericViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] + return cuckoo_manager.verify("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -15147,10 +14120,16 @@ import SoraFoundation return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.__DoNotUse<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?), Void> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { + let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] + return cuckoo_manager.verify("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class ReferralCrowdloanWireframeProtocolStub: ReferralCrowdloanWireframeProtocol { + class ExportGenericWireframeProtocolStub: ExportGenericWireframeProtocol { @@ -15158,13 +14137,13 @@ import SoraFoundation - func complete(on view: ReferralCrowdloanViewProtocol?) { + func close(view: ExportGenericViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -15180,81 +14159,61 @@ import SoraFoundation return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } import Cuckoo @testable import novawallet +import IrohaCrypto + - class MockDAppAuthConfirmViewProtocol: DAppAuthConfirmViewProtocol, Cuckoo.ProtocolMock { + class MockExportMnemonicInteractorInputProtocol: ExportMnemonicInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppAuthConfirmViewProtocol + typealias MocksType = ExportMnemonicInteractorInputProtocol - typealias Stubbing = __StubbingProxy_DAppAuthConfirmViewProtocol - typealias Verification = __VerificationProxy_DAppAuthConfirmViewProtocol + typealias Stubbing = __StubbingProxy_ExportMnemonicInteractorInputProtocol + typealias Verification = __VerificationProxy_ExportMnemonicInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppAuthConfirmViewProtocol? + private var __defaultImplStub: ExportMnemonicInteractorInputProtocol? - func enableDefaultImplementation(_ stub: DAppAuthConfirmViewProtocol) { + func enableDefaultImplementation(_ stub: ExportMnemonicInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } - - - - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - - } - - func didReceive(viewModel: DAppAuthViewModel) { + func fetchExportData() { - return cuckoo_manager.call("didReceive(viewModel: DAppAuthViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("fetchExportData()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) + defaultCall: __defaultImplStub!.fetchExportData()) } - struct __StubbingProxy_DAppAuthConfirmViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ExportMnemonicInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -15262,24 +14221,14 @@ import Cuckoo } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthViewModel)> where M1.MatchedType == DAppAuthViewModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmViewProtocol.self, method: "didReceive(viewModel: DAppAuthViewModel)", parameterMatchers: matchers)) + func fetchExportData() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicInteractorInputProtocol.self, method: "fetchExportData()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppAuthConfirmViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ExportMnemonicInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -15291,46 +14240,18 @@ import Cuckoo } - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(DAppAuthViewModel), Void> where M1.MatchedType == DAppAuthViewModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceive(viewModel: DAppAuthViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func fetchExportData() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("fetchExportData()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppAuthConfirmViewProtocolStub: DAppAuthConfirmViewProtocol { - - - - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - - - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } + class ExportMnemonicInteractorInputProtocolStub: ExportMnemonicInteractorInputProtocol { @@ -15338,7 +14259,7 @@ import Cuckoo - func didReceive(viewModel: DAppAuthViewModel) { + func fetchExportData() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -15346,19 +14267,19 @@ import Cuckoo - class MockDAppAuthConfirmPresenterProtocol: DAppAuthConfirmPresenterProtocol, Cuckoo.ProtocolMock { + class MockExportMnemonicInteractorOutputProtocol: ExportMnemonicInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppAuthConfirmPresenterProtocol + typealias MocksType = ExportMnemonicInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_DAppAuthConfirmPresenterProtocol - typealias Verification = __VerificationProxy_DAppAuthConfirmPresenterProtocol + typealias Stubbing = __StubbingProxy_ExportMnemonicInteractorOutputProtocol + typealias Verification = __VerificationProxy_ExportMnemonicInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppAuthConfirmPresenterProtocol? + private var __defaultImplStub: ExportMnemonicInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: DAppAuthConfirmPresenterProtocol) { + func enableDefaultImplementation(_ stub: ExportMnemonicInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -15371,51 +14292,36 @@ import Cuckoo - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func allow() { + func didReceive(exportData: ExportMnemonicData) { - return cuckoo_manager.call("allow()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(exportData: ExportMnemonicData)", + parameters: (exportData), + escapingParameters: (exportData), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.allow()) + defaultCall: __defaultImplStub!.didReceive(exportData: exportData)) } - func deny() { + func didReceive(error: Error) { - return cuckoo_manager.call("deny()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(error: Error)", + parameters: (error), + escapingParameters: (error), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.deny()) + defaultCall: __defaultImplStub!.didReceive(error: error)) } - struct __StubbingProxy_DAppAuthConfirmPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ExportMnemonicInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -15423,24 +14329,19 @@ import Cuckoo } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func allow() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmPresenterProtocol.self, method: "allow()", parameterMatchers: matchers)) + func didReceive(exportData: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportMnemonicData)> where M1.MatchedType == ExportMnemonicData { + let matchers: [Cuckoo.ParameterMatcher<(ExportMnemonicData)>] = [wrap(matchable: exportData) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicInteractorOutputProtocol.self, method: "didReceive(exportData: ExportMnemonicData)", parameterMatchers: matchers)) } - func deny() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmPresenterProtocol.self, method: "deny()", parameterMatchers: matchers)) + func didReceive(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicInteractorOutputProtocol.self, method: "didReceive(error: Error)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppAuthConfirmPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ExportMnemonicInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -15455,27 +14356,21 @@ import Cuckoo @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func allow() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("allow()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(exportData: M1) -> Cuckoo.__DoNotUse<(ExportMnemonicData), Void> where M1.MatchedType == ExportMnemonicData { + let matchers: [Cuckoo.ParameterMatcher<(ExportMnemonicData)>] = [wrap(matchable: exportData) { $0 }] + return cuckoo_manager.verify("didReceive(exportData: ExportMnemonicData)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func deny() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("deny()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return cuckoo_manager.verify("didReceive(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppAuthConfirmPresenterProtocolStub: DAppAuthConfirmPresenterProtocol { + class ExportMnemonicInteractorOutputProtocolStub: ExportMnemonicInteractorOutputProtocol { @@ -15483,19 +14378,13 @@ import Cuckoo - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func allow() { + func didReceive(exportData: ExportMnemonicData) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func deny() { + func didReceive(error: Error) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -15503,19 +14392,19 @@ import Cuckoo - class MockDAppAuthConfirmWireframeProtocol: DAppAuthConfirmWireframeProtocol, Cuckoo.ProtocolMock { + class MockExportMnemonicWireframeProtocol: ExportMnemonicWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppAuthConfirmWireframeProtocol + typealias MocksType = ExportMnemonicWireframeProtocol - typealias Stubbing = __StubbingProxy_DAppAuthConfirmWireframeProtocol - typealias Verification = __VerificationProxy_DAppAuthConfirmWireframeProtocol + typealias Stubbing = __StubbingProxy_ExportMnemonicWireframeProtocol + typealias Verification = __VerificationProxy_ExportMnemonicWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppAuthConfirmWireframeProtocol? + private var __defaultImplStub: ExportMnemonicWireframeProtocol? - func enableDefaultImplementation(_ stub: DAppAuthConfirmWireframeProtocol) { + func enableDefaultImplementation(_ stub: ExportMnemonicWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -15528,286 +14417,96 @@ import Cuckoo - func close(from view: DAppAuthConfirmViewProtocol?) { + func openConfirmationForMnemonic(_ mnemonic: IRMnemonicProtocol, from view: ExportGenericViewProtocol?) { - return cuckoo_manager.call("close(from: DAppAuthConfirmViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("openConfirmationForMnemonic(_: IRMnemonicProtocol, from: ExportGenericViewProtocol?)", + parameters: (mnemonic, view), + escapingParameters: (mnemonic, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(from: view)) + defaultCall: __defaultImplStub!.openConfirmationForMnemonic(mnemonic, from: view)) } - - struct __StubbingProxy_DAppAuthConfirmWireframeProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func close(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthConfirmViewProtocol?)> where M1.OptionalMatchedType == DAppAuthConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthConfirmWireframeProtocol.self, method: "close(from: DAppAuthConfirmViewProtocol?)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_DAppAuthConfirmWireframeProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func close(from view: M1) -> Cuckoo.__DoNotUse<(DAppAuthConfirmViewProtocol?), Void> where M1.OptionalMatchedType == DAppAuthConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(from: DAppAuthConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class DAppAuthConfirmWireframeProtocolStub: DAppAuthConfirmWireframeProtocol { - - - - - - func close(from view: DAppAuthConfirmViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - - - class MockDAppAuthDelegate: DAppAuthDelegate, Cuckoo.ProtocolMock { - - typealias MocksType = DAppAuthDelegate - - typealias Stubbing = __StubbingProxy_DAppAuthDelegate - typealias Verification = __VerificationProxy_DAppAuthDelegate - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: DAppAuthDelegate? - - func enableDefaultImplementation(_ stub: DAppAuthDelegate) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func didReceiveAuthResponse(_ response: DAppAuthResponse, for request: DAppAuthRequest) { + func close(view: ExportGenericViewProtocol?) { - return cuckoo_manager.call("didReceiveAuthResponse(_: DAppAuthResponse, for: DAppAuthRequest)", - parameters: (response, request), - escapingParameters: (response, request), + return cuckoo_manager.call("close(view: ExportGenericViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAuthResponse(response, for: request)) - - } - - - struct __StubbingProxy_DAppAuthDelegate: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didReceiveAuthResponse(_ response: M1, for request: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthResponse, DAppAuthRequest)> where M1.MatchedType == DAppAuthResponse, M2.MatchedType == DAppAuthRequest { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthResponse, DAppAuthRequest)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: request) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppAuthDelegate.self, method: "didReceiveAuthResponse(_: DAppAuthResponse, for: DAppAuthRequest)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_DAppAuthDelegate: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func didReceiveAuthResponse(_ response: M1, for request: M2) -> Cuckoo.__DoNotUse<(DAppAuthResponse, DAppAuthRequest), Void> where M1.MatchedType == DAppAuthResponse, M2.MatchedType == DAppAuthRequest { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthResponse, DAppAuthRequest)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: request) { $0.1 }] - return cuckoo_manager.verify("didReceiveAuthResponse(_: DAppAuthResponse, for: DAppAuthRequest)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class DAppAuthDelegateStub: DAppAuthDelegate { - - - - - - - - func didReceiveAuthResponse(_ response: DAppAuthResponse, for request: DAppAuthRequest) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - -import Cuckoo -@testable import novawallet - -import Foundation -import RobinHood - - - class MockDAppBrowserViewProtocol: DAppBrowserViewProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = DAppBrowserViewProtocol - - typealias Stubbing = __StubbingProxy_DAppBrowserViewProtocol - typealias Verification = __VerificationProxy_DAppBrowserViewProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: DAppBrowserViewProtocol? - - func enableDefaultImplementation(_ stub: DAppBrowserViewProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } - - - - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + defaultCall: __defaultImplStub!.close(view: view)) } - - - - - func didReceive(viewModel: DAppBrowserModel) { + func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { - return cuckoo_manager.call("didReceive(viewModel: DAppBrowserModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", + parameters: (view, secretSource, settings), + escapingParameters: (view, secretSource, settings), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) + defaultCall: __defaultImplStub!.showAdvancedSettings(from: view, secretSource: secretSource, settings: settings)) } - func didReceive(response: DAppScriptResponse, forTransport name: String) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didReceive(response: DAppScriptResponse, forTransport: String)", - parameters: (response, name), - escapingParameters: (response, name), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(response: response, forTransport: name)) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func didReceiveReplacement(transports: [DAppTransportModel], postExecution script: DAppScriptResponse) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", - parameters: (transports, script), - escapingParameters: (transports, script), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveReplacement(transports: transports, postExecution: script)) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - func didReceiveFavorite(flag: Bool) { + func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { - return cuckoo_manager.call("didReceiveFavorite(flag: Bool)", - parameters: (flag), - escapingParameters: (flag), + return cuckoo_manager.call("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", + parameters: (source, view, completionHandler), + escapingParameters: (source, view, completionHandler), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFavorite(flag: flag)) + defaultCall: __defaultImplStub!.share(source: source, from: view, with: completionHandler)) } - struct __StubbingProxy_DAppBrowserViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ExportMnemonicWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -15815,39 +14514,39 @@ import RobinHood } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") + func openConfirmationForMnemonic(_ mnemonic: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(IRMnemonicProtocol, ExportGenericViewProtocol?)> where M1.MatchedType == IRMnemonicProtocol, M2.OptionalMatchedType == ExportGenericViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(IRMnemonicProtocol, ExportGenericViewProtocol?)>] = [wrap(matchable: mnemonic) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "openConfirmationForMnemonic(_: IRMnemonicProtocol, from: ExportGenericViewProtocol?)", parameterMatchers: matchers)) } - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?)> where M1.OptionalMatchedType == ExportGenericViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "close(view: ExportGenericViewProtocol?)", parameterMatchers: matchers)) } - - func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserModel)> where M1.MatchedType == DAppBrowserModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceive(viewModel: DAppBrowserModel)", parameterMatchers: matchers)) + func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", parameterMatchers: matchers)) } - func didReceive(response: M1, forTransport name: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppScriptResponse, String)> where M1.MatchedType == DAppScriptResponse, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(DAppScriptResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceive(response: DAppScriptResponse, forTransport: String)", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func didReceiveReplacement(transports: M1, postExecution script: M2) -> Cuckoo.ProtocolStubNoReturnFunction<([DAppTransportModel], DAppScriptResponse)> where M1.MatchedType == [DAppTransportModel], M2.MatchedType == DAppScriptResponse { - let matchers: [Cuckoo.ParameterMatcher<([DAppTransportModel], DAppScriptResponse)>] = [wrap(matchable: transports) { $0.0 }, wrap(matchable: script) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func didReceiveFavorite(flag: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: flag) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceiveFavorite(flag: Bool)", parameterMatchers: matchers)) + func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { + let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppBrowserViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ExportMnemonicWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -15859,110 +14558,111 @@ import RobinHood } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func openConfirmationForMnemonic(_ mnemonic: M1, from view: M2) -> Cuckoo.__DoNotUse<(IRMnemonicProtocol, ExportGenericViewProtocol?), Void> where M1.MatchedType == IRMnemonicProtocol, M2.OptionalMatchedType == ExportGenericViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(IRMnemonicProtocol, ExportGenericViewProtocol?)>] = [wrap(matchable: mnemonic) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("openConfirmationForMnemonic(_: IRMnemonicProtocol, from: ExportGenericViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func close(view: M1) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: ExportGenericViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - @discardableResult - func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(DAppBrowserModel), Void> where M1.MatchedType == DAppBrowserModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceive(viewModel: DAppBrowserModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] + return cuckoo_manager.verify("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(response: M1, forTransport name: M2) -> Cuckoo.__DoNotUse<(DAppScriptResponse, String), Void> where M1.MatchedType == DAppScriptResponse, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(DAppScriptResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] - return cuckoo_manager.verify("didReceive(response: DAppScriptResponse, forTransport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveReplacement(transports: M1, postExecution script: M2) -> Cuckoo.__DoNotUse<([DAppTransportModel], DAppScriptResponse), Void> where M1.MatchedType == [DAppTransportModel], M2.MatchedType == DAppScriptResponse { - let matchers: [Cuckoo.ParameterMatcher<([DAppTransportModel], DAppScriptResponse)>] = [wrap(matchable: transports) { $0.0 }, wrap(matchable: script) { $0.1 }] - return cuckoo_manager.verify("didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFavorite(flag: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: flag) { $0 }] - return cuckoo_manager.verify("didReceiveFavorite(flag: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.__DoNotUse<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?), Void> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { + let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] + return cuckoo_manager.verify("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppBrowserViewProtocolStub: DAppBrowserViewProtocol { - + class ExportMnemonicWireframeProtocolStub: ExportMnemonicWireframeProtocol { + - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - + - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - + + func openConfirmationForMnemonic(_ mnemonic: IRMnemonicProtocol, from view: ExportGenericViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - + + func close(view: ExportGenericViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func didReceive(viewModel: DAppBrowserModel) { + func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(response: DAppScriptResponse, forTransport name: String) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveReplacement(transports: [DAppTransportModel], postExecution script: DAppScriptResponse) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFavorite(flag: Bool) { + func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet + +import Foundation - class MockDAppBrowserPresenterProtocol: DAppBrowserPresenterProtocol, Cuckoo.ProtocolMock { + + class MockExportRestoreJsonWireframeProtocol: ExportRestoreJsonWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppBrowserPresenterProtocol + typealias MocksType = ExportRestoreJsonWireframeProtocol - typealias Stubbing = __StubbingProxy_DAppBrowserPresenterProtocol - typealias Verification = __VerificationProxy_DAppBrowserPresenterProtocol + typealias Stubbing = __StubbingProxy_ExportRestoreJsonWireframeProtocol + typealias Verification = __VerificationProxy_ExportRestoreJsonWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppBrowserPresenterProtocol? + private var __defaultImplStub: ExportRestoreJsonWireframeProtocol? - func enableDefaultImplementation(_ stub: DAppBrowserPresenterProtocol) { + func enableDefaultImplementation(_ stub: ExportRestoreJsonWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -15975,96 +14675,81 @@ import RobinHood - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func process(page: DAppBrowserPage) { + func close(view: ExportGenericViewProtocol?) { - return cuckoo_manager.call("process(page: DAppBrowserPage)", - parameters: (page), - escapingParameters: (page), + return cuckoo_manager.call("close(view: ExportGenericViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.process(page: page)) + defaultCall: __defaultImplStub!.close(view: view)) } - func process(message: Any, host: String, transport name: String) { + func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { - return cuckoo_manager.call("process(message: Any, host: String, transport: String)", - parameters: (message, host, name), - escapingParameters: (message, host, name), + return cuckoo_manager.call("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", + parameters: (view, secretSource, settings), + escapingParameters: (view, secretSource, settings), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.process(message: message, host: host, transport: name)) + defaultCall: __defaultImplStub!.showAdvancedSettings(from: view, secretSource: secretSource, settings: settings)) } - func activateSearch(with query: String?) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("activateSearch(with: String?)", - parameters: (query), - escapingParameters: (query), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateSearch(with: query)) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func toggleFavorite() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("toggleFavorite()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.toggleFavorite()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - func close() { + func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { - return cuckoo_manager.call("close()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", + parameters: (source, view, completionHandler), + escapingParameters: (source, view, completionHandler), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close()) + defaultCall: __defaultImplStub!.share(source: source, from: view, with: completionHandler)) } - struct __StubbingProxy_DAppBrowserPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ExportRestoreJsonWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -16072,39 +14757,34 @@ import RobinHood } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func process(page: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserPage)> where M1.MatchedType == DAppBrowserPage { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserPage)>] = [wrap(matchable: page) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "process(page: DAppBrowserPage)", parameterMatchers: matchers)) + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?)> where M1.OptionalMatchedType == ExportGenericViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "close(view: ExportGenericViewProtocol?)", parameterMatchers: matchers)) } - func process(message: M1, host: M2, transport name: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(Any, String, String)> where M1.MatchedType == Any, M2.MatchedType == String, M3.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(Any, String, String)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: host) { $0.1 }, wrap(matchable: name) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "process(message: Any, host: String, transport: String)", parameterMatchers: matchers)) + func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", parameterMatchers: matchers)) } - func activateSearch(with query: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: query) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "activateSearch(with: String?)", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func toggleFavorite() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "toggleFavorite()", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func close() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserPresenterProtocol.self, method: "close()", parameterMatchers: matchers)) + func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { + let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppBrowserPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ExportRestoreJsonWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -16119,45 +14799,39 @@ import RobinHood @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func process(page: M1) -> Cuckoo.__DoNotUse<(DAppBrowserPage), Void> where M1.MatchedType == DAppBrowserPage { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserPage)>] = [wrap(matchable: page) { $0 }] - return cuckoo_manager.verify("process(page: DAppBrowserPage)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close(view: M1) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: ExportGenericViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func process(message: M1, host: M2, transport name: M3) -> Cuckoo.__DoNotUse<(Any, String, String), Void> where M1.MatchedType == Any, M2.MatchedType == String, M3.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(Any, String, String)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: host) { $0.1 }, wrap(matchable: name) { $0.2 }] - return cuckoo_manager.verify("process(message: Any, host: String, transport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { + let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] + return cuckoo_manager.verify("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func activateSearch(with query: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: query) { $0 }] - return cuckoo_manager.verify("activateSearch(with: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func toggleFavorite() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("toggleFavorite()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func close() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("close()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.__DoNotUse<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?), Void> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { + let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] + return cuckoo_manager.verify("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppBrowserPresenterProtocolStub: DAppBrowserPresenterProtocol { + class ExportRestoreJsonWireframeProtocolStub: ExportRestoreJsonWireframeProtocol { @@ -16165,189 +14839,300 @@ import RobinHood - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func process(page: DAppBrowserPage) { + func close(view: ExportGenericViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func process(message: Any, host: String, transport name: String) { + func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func activateSearch(with query: String?) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func toggleFavorite() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func close() { + func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet + +import Foundation + - class MockDAppBrowserInteractorInputProtocol: DAppBrowserInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockOnboardingMainViewProtocol: OnboardingMainViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppBrowserInteractorInputProtocol + typealias MocksType = OnboardingMainViewProtocol - typealias Stubbing = __StubbingProxy_DAppBrowserInteractorInputProtocol - typealias Verification = __VerificationProxy_DAppBrowserInteractorInputProtocol + typealias Stubbing = __StubbingProxy_OnboardingMainViewProtocol + typealias Verification = __VerificationProxy_OnboardingMainViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppBrowserInteractorInputProtocol? + private var __defaultImplStub: OnboardingMainViewProtocol? - func enableDefaultImplementation(_ stub: DAppBrowserInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: OnboardingMainViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - - - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } - func process(host: String) { + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } - return cuckoo_manager.call("process(host: String)", - parameters: (host), - escapingParameters: (host), + } + + + + + + + struct __StubbingProxy_OnboardingMainViewProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") + } + + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") + } + + + } + + struct __VerificationProxy_OnboardingMainViewProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + + } +} + + class OnboardingMainViewProtocolStub: OnboardingMainViewProtocol { + + + + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } + + + + + +} + + + + class MockOnboardingMainPresenterProtocol: OnboardingMainPresenterProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = OnboardingMainPresenterProtocol + + typealias Stubbing = __StubbingProxy_OnboardingMainPresenterProtocol + typealias Verification = __VerificationProxy_OnboardingMainPresenterProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: OnboardingMainPresenterProtocol? + + func enableDefaultImplementation(_ stub: OnboardingMainPresenterProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + + + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.process(host: host)) + defaultCall: __defaultImplStub!.setup()) } - func process(message: Any, host: String, transport name: String) { + func activateSignup() { - return cuckoo_manager.call("process(message: Any, host: String, transport: String)", - parameters: (message, host, name), - escapingParameters: (message, host, name), + return cuckoo_manager.call("activateSignup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.process(message: message, host: host, transport: name)) + defaultCall: __defaultImplStub!.activateSignup()) } - func processConfirmation(response: DAppOperationResponse, forTransport name: String) { + func activateAccountRestore() { - return cuckoo_manager.call("processConfirmation(response: DAppOperationResponse, forTransport: String)", - parameters: (response, name), - escapingParameters: (response, name), + return cuckoo_manager.call("activateAccountRestore()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.processConfirmation(response: response, forTransport: name)) + defaultCall: __defaultImplStub!.activateAccountRestore()) } - func process(newQuery: DAppSearchResult) { + func activateWatchOnlyCreate() { - return cuckoo_manager.call("process(newQuery: DAppSearchResult)", - parameters: (newQuery), - escapingParameters: (newQuery), + return cuckoo_manager.call("activateWatchOnlyCreate()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.process(newQuery: newQuery)) + defaultCall: __defaultImplStub!.activateWatchOnlyCreate()) } - func processAuth(response: DAppAuthResponse, forTransport name: String) { + func activateHardwareWalletCreate() { - return cuckoo_manager.call("processAuth(response: DAppAuthResponse, forTransport: String)", - parameters: (response, name), - escapingParameters: (response, name), + return cuckoo_manager.call("activateHardwareWalletCreate()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.processAuth(response: response, forTransport: name)) + defaultCall: __defaultImplStub!.activateHardwareWalletCreate()) } - func removeFromFavorites(record: DAppFavorite) { + func activateTerms() { - return cuckoo_manager.call("removeFromFavorites(record: DAppFavorite)", - parameters: (record), - escapingParameters: (record), + return cuckoo_manager.call("activateTerms()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.removeFromFavorites(record: record)) + defaultCall: __defaultImplStub!.activateTerms()) } - func reload() { + func activatePrivacy() { - return cuckoo_manager.call("reload()", + return cuckoo_manager.call("activatePrivacy()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload()) + defaultCall: __defaultImplStub!.activatePrivacy()) } - struct __StubbingProxy_DAppBrowserInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_OnboardingMainPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -16357,47 +15142,42 @@ import RobinHood func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func process(host: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: host) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "process(host: String)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func process(message: M1, host: M2, transport name: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(Any, String, String)> where M1.MatchedType == Any, M2.MatchedType == String, M3.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(Any, String, String)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: host) { $0.1 }, wrap(matchable: name) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "process(message: Any, host: String, transport: String)", parameterMatchers: matchers)) + func activateSignup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateSignup()", parameterMatchers: matchers)) } - func processConfirmation(response: M1, forTransport name: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationResponse, String)> where M1.MatchedType == DAppOperationResponse, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "processConfirmation(response: DAppOperationResponse, forTransport: String)", parameterMatchers: matchers)) + func activateAccountRestore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateAccountRestore()", parameterMatchers: matchers)) } - func process(newQuery: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppSearchResult)> where M1.MatchedType == DAppSearchResult { - let matchers: [Cuckoo.ParameterMatcher<(DAppSearchResult)>] = [wrap(matchable: newQuery) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "process(newQuery: DAppSearchResult)", parameterMatchers: matchers)) + func activateWatchOnlyCreate() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateWatchOnlyCreate()", parameterMatchers: matchers)) } - func processAuth(response: M1, forTransport name: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthResponse, String)> where M1.MatchedType == DAppAuthResponse, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "processAuth(response: DAppAuthResponse, forTransport: String)", parameterMatchers: matchers)) + func activateHardwareWalletCreate() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateHardwareWalletCreate()", parameterMatchers: matchers)) } - func removeFromFavorites(record: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppFavorite)> where M1.MatchedType == DAppFavorite { - let matchers: [Cuckoo.ParameterMatcher<(DAppFavorite)>] = [wrap(matchable: record) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "removeFromFavorites(record: DAppFavorite)", parameterMatchers: matchers)) + func activateTerms() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateTerms()", parameterMatchers: matchers)) } - func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func activatePrivacy() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorInputProtocol.self, method: "reload()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activatePrivacy()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppBrowserInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_OnboardingMainPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -16418,51 +15198,45 @@ import RobinHood } @discardableResult - func process(host: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: host) { $0 }] - return cuckoo_manager.verify("process(host: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func process(message: M1, host: M2, transport name: M3) -> Cuckoo.__DoNotUse<(Any, String, String), Void> where M1.MatchedType == Any, M2.MatchedType == String, M3.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(Any, String, String)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: host) { $0.1 }, wrap(matchable: name) { $0.2 }] - return cuckoo_manager.verify("process(message: Any, host: String, transport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func activateSignup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("activateSignup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func processConfirmation(response: M1, forTransport name: M2) -> Cuckoo.__DoNotUse<(DAppOperationResponse, String), Void> where M1.MatchedType == DAppOperationResponse, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] - return cuckoo_manager.verify("processConfirmation(response: DAppOperationResponse, forTransport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func activateAccountRestore() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("activateAccountRestore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func process(newQuery: M1) -> Cuckoo.__DoNotUse<(DAppSearchResult), Void> where M1.MatchedType == DAppSearchResult { - let matchers: [Cuckoo.ParameterMatcher<(DAppSearchResult)>] = [wrap(matchable: newQuery) { $0 }] - return cuckoo_manager.verify("process(newQuery: DAppSearchResult)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func activateWatchOnlyCreate() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("activateWatchOnlyCreate()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func processAuth(response: M1, forTransport name: M2) -> Cuckoo.__DoNotUse<(DAppAuthResponse, String), Void> where M1.MatchedType == DAppAuthResponse, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] - return cuckoo_manager.verify("processAuth(response: DAppAuthResponse, forTransport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func activateHardwareWalletCreate() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("activateHardwareWalletCreate()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func removeFromFavorites(record: M1) -> Cuckoo.__DoNotUse<(DAppFavorite), Void> where M1.MatchedType == DAppFavorite { - let matchers: [Cuckoo.ParameterMatcher<(DAppFavorite)>] = [wrap(matchable: record) { $0 }] - return cuckoo_manager.verify("removeFromFavorites(record: DAppFavorite)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func activateTerms() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("activateTerms()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func reload() -> Cuckoo.__DoNotUse<(), Void> { + func activatePrivacy() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("activatePrivacy()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppBrowserInteractorInputProtocolStub: DAppBrowserInteractorInputProtocol { + class OnboardingMainPresenterProtocolStub: OnboardingMainPresenterProtocol { @@ -16476,43 +15250,37 @@ import RobinHood - func process(host: String) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func process(message: Any, host: String, transport name: String) { + func activateSignup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func processConfirmation(response: DAppOperationResponse, forTransport name: String) { + func activateAccountRestore() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func process(newQuery: DAppSearchResult) { + func activateWatchOnlyCreate() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func processAuth(response: DAppAuthResponse, forTransport name: String) { + func activateHardwareWalletCreate() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func removeFromFavorites(record: DAppFavorite) { + func activateTerms() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func reload() { + func activatePrivacy() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -16520,19 +15288,19 @@ import RobinHood - class MockDAppBrowserInteractorOutputProtocol: DAppBrowserInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockOnboardingMainWireframeProtocol: OnboardingMainWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppBrowserInteractorOutputProtocol + typealias MocksType = OnboardingMainWireframeProtocol - typealias Stubbing = __StubbingProxy_DAppBrowserInteractorOutputProtocol - typealias Verification = __VerificationProxy_DAppBrowserInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_OnboardingMainWireframeProtocol + typealias Verification = __VerificationProxy_OnboardingMainWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppBrowserInteractorOutputProtocol? + private var __defaultImplStub: OnboardingMainWireframeProtocol? - func enableDefaultImplementation(_ stub: DAppBrowserInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: OnboardingMainWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -16545,126 +15313,141 @@ import RobinHood - func didReceive(error: Error) { + func showSignup(from view: OnboardingMainViewProtocol?) { - return cuckoo_manager.call("didReceive(error: Error)", - parameters: (error), - escapingParameters: (error), + return cuckoo_manager.call("showSignup(from: OnboardingMainViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(error: error)) + defaultCall: __defaultImplStub!.showSignup(from: view)) } - func didReceiveDApp(model: DAppBrowserModel) { + func showAccountRestore(from view: OnboardingMainViewProtocol?) { - return cuckoo_manager.call("didReceiveDApp(model: DAppBrowserModel)", - parameters: (model), - escapingParameters: (model), + return cuckoo_manager.call("showAccountRestore(from: OnboardingMainViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveDApp(model: model)) + defaultCall: __defaultImplStub!.showAccountRestore(from: view)) } - func didReceiveReplacement(transports: [DAppTransportModel], postExecution script: DAppScriptResponse) { + func showKeystoreImport(from view: OnboardingMainViewProtocol?) { - return cuckoo_manager.call("didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", - parameters: (transports, script), - escapingParameters: (transports, script), + return cuckoo_manager.call("showKeystoreImport(from: OnboardingMainViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveReplacement(transports: transports, postExecution: script)) + defaultCall: __defaultImplStub!.showKeystoreImport(from: view)) } - func didReceive(response: DAppScriptResponse, forTransport name: String) { + func showWatchOnlyCreate(from view: OnboardingMainViewProtocol?) { - return cuckoo_manager.call("didReceive(response: DAppScriptResponse, forTransport: String)", - parameters: (response, name), - escapingParameters: (response, name), + return cuckoo_manager.call("showWatchOnlyCreate(from: OnboardingMainViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(response: response, forTransport: name)) + defaultCall: __defaultImplStub!.showWatchOnlyCreate(from: view)) } - func didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType) { + func showParitySignerWalletCreation(from view: OnboardingMainViewProtocol?) { - return cuckoo_manager.call("didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType)", - parameters: (request, type), - escapingParameters: (request, type), + return cuckoo_manager.call("showParitySignerWalletCreation(from: OnboardingMainViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveConfirmation(request: request, type: type)) + defaultCall: __defaultImplStub!.showParitySignerWalletCreation(from: view)) } - func didReceiveAuth(request: DAppAuthRequest) { + func showLedgerWalletCreation(from view: OnboardingMainViewProtocol?) { - return cuckoo_manager.call("didReceiveAuth(request: DAppAuthRequest)", - parameters: (request), - escapingParameters: (request), + return cuckoo_manager.call("showLedgerWalletCreation(from: OnboardingMainViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAuth(request: request)) + defaultCall: __defaultImplStub!.showLedgerWalletCreation(from: view)) } - func didDetectPhishing(host: String) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return cuckoo_manager.call("didDetectPhishing(host: String)", - parameters: (host), - escapingParameters: (host), + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didDetectPhishing(host: host)) + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) } - func didReceiveFavorite(changes: [DataProviderChange]) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didReceiveFavorite(changes: [DataProviderChange])", - parameters: (changes), - escapingParameters: (changes), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFavorite(changes: changes)) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_DAppBrowserInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_OnboardingMainWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -16672,49 +15455,54 @@ import RobinHood } - func didReceive(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceive(error: Error)", parameterMatchers: matchers)) + func showSignup(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showSignup(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) } - func didReceiveDApp(model: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserModel)> where M1.MatchedType == DAppBrowserModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserModel)>] = [wrap(matchable: model) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveDApp(model: DAppBrowserModel)", parameterMatchers: matchers)) + func showAccountRestore(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showAccountRestore(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) } - func didReceiveReplacement(transports: M1, postExecution script: M2) -> Cuckoo.ProtocolStubNoReturnFunction<([DAppTransportModel], DAppScriptResponse)> where M1.MatchedType == [DAppTransportModel], M2.MatchedType == DAppScriptResponse { - let matchers: [Cuckoo.ParameterMatcher<([DAppTransportModel], DAppScriptResponse)>] = [wrap(matchable: transports) { $0.0 }, wrap(matchable: script) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", parameterMatchers: matchers)) + func showKeystoreImport(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showKeystoreImport(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) } - func didReceive(response: M1, forTransport name: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppScriptResponse, String)> where M1.MatchedType == DAppScriptResponse, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(DAppScriptResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceive(response: DAppScriptResponse, forTransport: String)", parameterMatchers: matchers)) + func showWatchOnlyCreate(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showWatchOnlyCreate(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) } - func didReceiveConfirmation(request: M1, type: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationRequest, DAppSigningType)> where M1.MatchedType == DAppOperationRequest, M2.MatchedType == DAppSigningType { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationRequest, DAppSigningType)>] = [wrap(matchable: request) { $0.0 }, wrap(matchable: type) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType)", parameterMatchers: matchers)) + func showParitySignerWalletCreation(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showParitySignerWalletCreation(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) } - func didReceiveAuth(request: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppAuthRequest)> where M1.MatchedType == DAppAuthRequest { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthRequest)>] = [wrap(matchable: request) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveAuth(request: DAppAuthRequest)", parameterMatchers: matchers)) + func showLedgerWalletCreation(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showLedgerWalletCreation(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) } - func didDetectPhishing(host: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: host) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didDetectPhishing(host: String)", parameterMatchers: matchers)) + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) } - func didReceiveFavorite(changes: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([DataProviderChange])> where M1.MatchedType == [DataProviderChange] { - let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveFavorite(changes: [DataProviderChange])", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppBrowserInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_OnboardingMainWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -16729,57 +15517,63 @@ import RobinHood @discardableResult - func didReceive(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return cuckoo_manager.verify("didReceive(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showSignup(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showSignup(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveDApp(model: M1) -> Cuckoo.__DoNotUse<(DAppBrowserModel), Void> where M1.MatchedType == DAppBrowserModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserModel)>] = [wrap(matchable: model) { $0 }] - return cuckoo_manager.verify("didReceiveDApp(model: DAppBrowserModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showAccountRestore(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showAccountRestore(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveReplacement(transports: M1, postExecution script: M2) -> Cuckoo.__DoNotUse<([DAppTransportModel], DAppScriptResponse), Void> where M1.MatchedType == [DAppTransportModel], M2.MatchedType == DAppScriptResponse { - let matchers: [Cuckoo.ParameterMatcher<([DAppTransportModel], DAppScriptResponse)>] = [wrap(matchable: transports) { $0.0 }, wrap(matchable: script) { $0.1 }] - return cuckoo_manager.verify("didReceiveReplacement(transports: [DAppTransportModel], postExecution: DAppScriptResponse)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showKeystoreImport(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showKeystoreImport(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(response: M1, forTransport name: M2) -> Cuckoo.__DoNotUse<(DAppScriptResponse, String), Void> where M1.MatchedType == DAppScriptResponse, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(DAppScriptResponse, String)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: name) { $0.1 }] - return cuckoo_manager.verify("didReceive(response: DAppScriptResponse, forTransport: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showWatchOnlyCreate(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showWatchOnlyCreate(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveConfirmation(request: M1, type: M2) -> Cuckoo.__DoNotUse<(DAppOperationRequest, DAppSigningType), Void> where M1.MatchedType == DAppOperationRequest, M2.MatchedType == DAppSigningType { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationRequest, DAppSigningType)>] = [wrap(matchable: request) { $0.0 }, wrap(matchable: type) { $0.1 }] - return cuckoo_manager.verify("didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showParitySignerWalletCreation(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showParitySignerWalletCreation(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveAuth(request: M1) -> Cuckoo.__DoNotUse<(DAppAuthRequest), Void> where M1.MatchedType == DAppAuthRequest { - let matchers: [Cuckoo.ParameterMatcher<(DAppAuthRequest)>] = [wrap(matchable: request) { $0 }] - return cuckoo_manager.verify("didReceiveAuth(request: DAppAuthRequest)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showLedgerWalletCreation(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showLedgerWalletCreation(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didDetectPhishing(host: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: host) { $0 }] - return cuckoo_manager.verify("didDetectPhishing(host: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFavorite(changes: M1) -> Cuckoo.__DoNotUse<([DataProviderChange]), Void> where M1.MatchedType == [DataProviderChange] { - let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] - return cuckoo_manager.verify("didReceiveFavorite(changes: [DataProviderChange])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } } } - class DAppBrowserInteractorOutputProtocolStub: DAppBrowserInteractorOutputProtocol { + class OnboardingMainWireframeProtocolStub: OnboardingMainWireframeProtocol { @@ -16787,49 +15581,55 @@ import RobinHood - func didReceive(error: Error) { + func showSignup(from view: OnboardingMainViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveDApp(model: DAppBrowserModel) { + func showAccountRestore(from view: OnboardingMainViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveReplacement(transports: [DAppTransportModel], postExecution script: DAppScriptResponse) { + func showKeystoreImport(from view: OnboardingMainViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(response: DAppScriptResponse, forTransport name: String) { + func showWatchOnlyCreate(from view: OnboardingMainViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveConfirmation(request: DAppOperationRequest, type: DAppSigningType) { + func showParitySignerWalletCreation(from view: OnboardingMainViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveAuth(request: DAppAuthRequest) { + func showLedgerWalletCreation(from view: OnboardingMainViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didDetectPhishing(host: String) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFavorite(changes: [DataProviderChange]) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -16837,19 +15637,19 @@ import RobinHood - class MockDAppBrowserWireframeProtocol: DAppBrowserWireframeProtocol, Cuckoo.ProtocolMock { + class MockOnboardingMainInteractorInputProtocol: OnboardingMainInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppBrowserWireframeProtocol + typealias MocksType = OnboardingMainInteractorInputProtocol - typealias Stubbing = __StubbingProxy_DAppBrowserWireframeProtocol - typealias Verification = __VerificationProxy_DAppBrowserWireframeProtocol + typealias Stubbing = __StubbingProxy_OnboardingMainInteractorInputProtocol + typealias Verification = __VerificationProxy_OnboardingMainInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppBrowserWireframeProtocol? + private var __defaultImplStub: OnboardingMainInteractorInputProtocol? - func enableDefaultImplementation(_ stub: DAppBrowserWireframeProtocol) { + func enableDefaultImplementation(_ stub: OnboardingMainInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -16862,96 +15662,114 @@ import RobinHood - func presentOperationConfirm(from view: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate) { + func setup() { - return cuckoo_manager.call("presentOperationConfirm(from: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate)", - parameters: (view, request, type, delegate), - escapingParameters: (view, request, type, delegate), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentOperationConfirm(from: view, request: request, type: type, delegate: delegate)) + defaultCall: __defaultImplStub!.setup()) } + + struct __StubbingProxy_OnboardingMainInteractorInputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_OnboardingMainInteractorInputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class OnboardingMainInteractorInputProtocolStub: OnboardingMainInteractorInputProtocol { + - func presentSearch(from view: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate) { - - return cuckoo_manager.call("presentSearch(from: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate)", - parameters: (view, initialQuery, delegate), - escapingParameters: (view, initialQuery, delegate), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentSearch(from: view, initialQuery: initialQuery, delegate: delegate)) - - } + - func presentAuth(from view: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate) { - - return cuckoo_manager.call("presentAuth(from: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate)", - parameters: (view, request, delegate), - escapingParameters: (view, request, delegate), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentAuth(from: view, request: request, delegate: delegate)) - + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockOnboardingMainInteractorOutputProtocol: OnboardingMainInteractorOutputProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = OnboardingMainInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_OnboardingMainInteractorOutputProtocol + typealias Verification = __VerificationProxy_OnboardingMainInteractorOutputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func presentPhishingDetected(from view: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate) { - - return cuckoo_manager.call("presentPhishingDetected(from: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate)", - parameters: (view, delegate), - escapingParameters: (view, delegate), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentPhishingDetected(from: view, delegate: delegate)) - + private var __defaultImplStub: OnboardingMainInteractorOutputProtocol? + + func enableDefaultImplementation(_ stub: OnboardingMainInteractorOutputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func presentAddToFavoriteForm(from view: DAppBrowserViewProtocol?, page: DAppBrowserPage) { - - return cuckoo_manager.call("presentAddToFavoriteForm(from: DAppBrowserViewProtocol?, page: DAppBrowserPage)", - parameters: (view, page), - escapingParameters: (view, page), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentAddToFavoriteForm(from: view, page: page)) - - } + - func close(view: DAppBrowserViewProtocol?) { + func didSuggestKeystoreImport() { - return cuckoo_manager.call("close(view: DAppBrowserViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didSuggestKeystoreImport()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(view: view)) + defaultCall: __defaultImplStub!.didSuggestKeystoreImport()) } - struct __StubbingProxy_DAppBrowserWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_OnboardingMainInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -16959,39 +15777,14 @@ import RobinHood } - func presentOperationConfirm(from view: M1, request: M2, type: M3, delegate: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, DAppOperationRequest, DAppSigningType, DAppOperationConfirmDelegate)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppOperationRequest, M3.MatchedType == DAppSigningType, M4.MatchedType == DAppOperationConfirmDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppOperationRequest, DAppSigningType, DAppOperationConfirmDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: request) { $0.1 }, wrap(matchable: type) { $0.2 }, wrap(matchable: delegate) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentOperationConfirm(from: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate)", parameterMatchers: matchers)) - } - - func presentSearch(from view: M1, initialQuery: M2, delegate: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, String?, DAppSearchDelegate)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.OptionalMatchedType == String, M3.MatchedType == DAppSearchDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, String?, DAppSearchDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: initialQuery) { $0.1 }, wrap(matchable: delegate) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentSearch(from: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate)", parameterMatchers: matchers)) - } - - func presentAuth(from view: M1, request: M2, delegate: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, DAppAuthRequest, DAppAuthDelegate)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppAuthRequest, M3.MatchedType == DAppAuthDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppAuthRequest, DAppAuthDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: request) { $0.1 }, wrap(matchable: delegate) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentAuth(from: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate)", parameterMatchers: matchers)) - } - - func presentPhishingDetected(from view: M1, delegate: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, DAppPhishingViewDelegate)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppPhishingViewDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppPhishingViewDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentPhishingDetected(from: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate)", parameterMatchers: matchers)) - } - - func presentAddToFavoriteForm(from view: M1, page: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?, DAppBrowserPage)> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppBrowserPage { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppBrowserPage)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: page) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "presentAddToFavoriteForm(from: DAppBrowserViewProtocol?, page: DAppBrowserPage)", parameterMatchers: matchers)) - } - - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppBrowserViewProtocol?)> where M1.OptionalMatchedType == DAppBrowserViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserWireframeProtocol.self, method: "close(view: DAppBrowserViewProtocol?)", parameterMatchers: matchers)) + func didSuggestKeystoreImport() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainInteractorOutputProtocol.self, method: "didSuggestKeystoreImport()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppBrowserWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_OnboardingMainInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -17006,45 +15799,15 @@ import RobinHood @discardableResult - func presentOperationConfirm(from view: M1, request: M2, type: M3, delegate: M4) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, DAppOperationRequest, DAppSigningType, DAppOperationConfirmDelegate), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppOperationRequest, M3.MatchedType == DAppSigningType, M4.MatchedType == DAppOperationConfirmDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppOperationRequest, DAppSigningType, DAppOperationConfirmDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: request) { $0.1 }, wrap(matchable: type) { $0.2 }, wrap(matchable: delegate) { $0.3 }] - return cuckoo_manager.verify("presentOperationConfirm(from: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentSearch(from view: M1, initialQuery: M2, delegate: M3) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, String?, DAppSearchDelegate), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.OptionalMatchedType == String, M3.MatchedType == DAppSearchDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, String?, DAppSearchDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: initialQuery) { $0.1 }, wrap(matchable: delegate) { $0.2 }] - return cuckoo_manager.verify("presentSearch(from: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentAuth(from view: M1, request: M2, delegate: M3) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, DAppAuthRequest, DAppAuthDelegate), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppAuthRequest, M3.MatchedType == DAppAuthDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppAuthRequest, DAppAuthDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: request) { $0.1 }, wrap(matchable: delegate) { $0.2 }] - return cuckoo_manager.verify("presentAuth(from: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentPhishingDetected(from view: M1, delegate: M2) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, DAppPhishingViewDelegate), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppPhishingViewDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppPhishingViewDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }] - return cuckoo_manager.verify("presentPhishingDetected(from: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentAddToFavoriteForm(from view: M1, page: M2) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?, DAppBrowserPage), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol, M2.MatchedType == DAppBrowserPage { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?, DAppBrowserPage)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: page) { $0.1 }] - return cuckoo_manager.verify("presentAddToFavoriteForm(from: DAppBrowserViewProtocol?, page: DAppBrowserPage)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(DAppBrowserViewProtocol?), Void> where M1.OptionalMatchedType == DAppBrowserViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppBrowserViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: DAppBrowserViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didSuggestKeystoreImport() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didSuggestKeystoreImport()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppBrowserWireframeProtocolStub: DAppBrowserWireframeProtocol { + class OnboardingMainInteractorOutputProtocolStub: OnboardingMainInteractorOutputProtocol { @@ -17052,37 +15815,7 @@ import RobinHood - func presentOperationConfirm(from view: DAppBrowserViewProtocol?, request: DAppOperationRequest, type: DAppSigningType, delegate: DAppOperationConfirmDelegate) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentSearch(from view: DAppBrowserViewProtocol?, initialQuery: String?, delegate: DAppSearchDelegate) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentAuth(from view: DAppBrowserViewProtocol?, request: DAppAuthRequest, delegate: DAppAuthDelegate) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentPhishingDetected(from view: DAppBrowserViewProtocol?, delegate: DAppPhishingViewDelegate) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentAddToFavoriteForm(from view: DAppBrowserViewProtocol?, page: DAppBrowserPage) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func close(view: DAppBrowserViewProtocol?) { + func didSuggestKeystoreImport() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -17092,23 +15825,22 @@ import RobinHood import Cuckoo @testable import novawallet -import RobinHood -import SubstrateSdk +import CommonWallet - class MockDAppListViewProtocol: DAppListViewProtocol, Cuckoo.ProtocolMock { + class MockOperationDetailsViewProtocol: OperationDetailsViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppListViewProtocol + typealias MocksType = OperationDetailsViewProtocol - typealias Stubbing = __StubbingProxy_DAppListViewProtocol - typealias Verification = __VerificationProxy_DAppListViewProtocol + typealias Stubbing = __StubbingProxy_OperationDetailsViewProtocol + typealias Verification = __VerificationProxy_OperationDetailsViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppListViewProtocol? + private var __defaultImplStub: OperationDetailsViewProtocol? - func enableDefaultImplementation(_ stub: DAppListViewProtocol) { + func enableDefaultImplementation(_ stub: OperationDetailsViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -17149,51 +15881,21 @@ import SubstrateSdk - func didReceiveWalletSwitch(viewModel: WalletSwitchViewModel) { + func didReceive(viewModel: OperationDetailsViewModel) { - return cuckoo_manager.call("didReceiveWalletSwitch(viewModel: WalletSwitchViewModel)", + return cuckoo_manager.call("didReceive(viewModel: OperationDetailsViewModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveWalletSwitch(viewModel: viewModel)) - - } - - - - func didReceive(state: DAppListState) { - - return cuckoo_manager.call("didReceive(state: DAppListState)", - parameters: (state), - escapingParameters: (state), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(state: state)) - - } - - - - func didCompleteRefreshing() { - - return cuckoo_manager.call("didCompleteRefreshing()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didCompleteRefreshing()) + defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) } - struct __StubbingProxy_DAppListViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_OperationDetailsViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -17201,34 +15903,24 @@ import SubstrateSdk } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - func didReceiveWalletSwitch(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(WalletSwitchViewModel)> where M1.MatchedType == WalletSwitchViewModel { - let matchers: [Cuckoo.ParameterMatcher<(WalletSwitchViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListViewProtocol.self, method: "didReceiveWalletSwitch(viewModel: WalletSwitchViewModel)", parameterMatchers: matchers)) - } - - func didReceive(state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListState)> where M1.MatchedType == DAppListState { - let matchers: [Cuckoo.ParameterMatcher<(DAppListState)>] = [wrap(matchable: state) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListViewProtocol.self, method: "didReceive(state: DAppListState)", parameterMatchers: matchers)) - } - - func didCompleteRefreshing() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListViewProtocol.self, method: "didCompleteRefreshing()", parameterMatchers: matchers)) + func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OperationDetailsViewModel)> where M1.MatchedType == OperationDetailsViewModel { + let matchers: [Cuckoo.ParameterMatcher<(OperationDetailsViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsViewProtocol.self, method: "didReceive(viewModel: OperationDetailsViewModel)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppListViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_OperationDetailsViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -17253,27 +15945,15 @@ import SubstrateSdk @discardableResult - func didReceiveWalletSwitch(viewModel: M1) -> Cuckoo.__DoNotUse<(WalletSwitchViewModel), Void> where M1.MatchedType == WalletSwitchViewModel { - let matchers: [Cuckoo.ParameterMatcher<(WalletSwitchViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveWalletSwitch(viewModel: WalletSwitchViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(state: M1) -> Cuckoo.__DoNotUse<(DAppListState), Void> where M1.MatchedType == DAppListState { - let matchers: [Cuckoo.ParameterMatcher<(DAppListState)>] = [wrap(matchable: state) { $0 }] - return cuckoo_manager.verify("didReceive(state: DAppListState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didCompleteRefreshing() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didCompleteRefreshing()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(OperationDetailsViewModel), Void> where M1.MatchedType == OperationDetailsViewModel { + let matchers: [Cuckoo.ParameterMatcher<(OperationDetailsViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceive(viewModel: OperationDetailsViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppListViewProtocolStub: DAppListViewProtocol { + class OperationDetailsViewProtocolStub: OperationDetailsViewProtocol { @@ -17299,19 +15979,7 @@ import SubstrateSdk - func didReceiveWalletSwitch(viewModel: WalletSwitchViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(state: DAppListState) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didCompleteRefreshing() { + func didReceive(viewModel: OperationDetailsViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -17319,19 +15987,19 @@ import SubstrateSdk - class MockDAppListPresenterProtocol: DAppListPresenterProtocol, Cuckoo.ProtocolMock { + class MockOperationDetailsPresenterProtocol: OperationDetailsPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppListPresenterProtocol + typealias MocksType = OperationDetailsPresenterProtocol - typealias Stubbing = __StubbingProxy_DAppListPresenterProtocol - typealias Verification = __VerificationProxy_DAppListPresenterProtocol + typealias Stubbing = __StubbingProxy_OperationDetailsPresenterProtocol + typealias Verification = __VerificationProxy_OperationDetailsPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppListPresenterProtocol? + private var __defaultImplStub: OperationDetailsPresenterProtocol? - func enableDefaultImplementation(_ stub: DAppListPresenterProtocol) { + func enableDefaultImplementation(_ stub: OperationDetailsPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -17359,186 +16027,227 @@ import SubstrateSdk - func refresh() { + func showSenderActions() { - return cuckoo_manager.call("refresh()", + return cuckoo_manager.call("showSenderActions()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.refresh()) + defaultCall: __defaultImplStub!.showSenderActions()) } - func activateAccount() { + func showRecepientActions() { - return cuckoo_manager.call("activateAccount()", + return cuckoo_manager.call("showRecepientActions()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateAccount()) + defaultCall: __defaultImplStub!.showRecepientActions()) } - func activateSearch() { + func showOperationActions() { - return cuckoo_manager.call("activateSearch()", + return cuckoo_manager.call("showOperationActions()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateSearch()) + defaultCall: __defaultImplStub!.showOperationActions()) } - func activateSettings() { + func send() { - return cuckoo_manager.call("activateSettings()", + return cuckoo_manager.call("send()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateSettings()) + defaultCall: __defaultImplStub!.send()) } + + struct __StubbingProxy_OperationDetailsPresenterProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func showSenderActions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "showSenderActions()", parameterMatchers: matchers)) + } + + func showRecepientActions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "showRecepientActions()", parameterMatchers: matchers)) + } + + func showOperationActions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "showOperationActions()", parameterMatchers: matchers)) + } + + func send() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "send()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_OperationDetailsPresenterProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showSenderActions() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("showSenderActions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showRecepientActions() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("showRecepientActions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showOperationActions() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("showOperationActions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func send() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("send()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class OperationDetailsPresenterProtocolStub: OperationDetailsPresenterProtocol { + - func numberOfCategories() -> Int { - - return cuckoo_manager.call("numberOfCategories() -> Int", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.numberOfCategories()) - - } + - func category(at index: Int) -> String { - - return cuckoo_manager.call("category(at: Int) -> String", - parameters: (index), - escapingParameters: (index), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.category(at: index)) - + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectedCategoryIndex() -> Int { - - return cuckoo_manager.call("selectedCategoryIndex() -> Int", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.selectedCategoryIndex()) - + func showSenderActions() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectCategory(at index: Int) { - - return cuckoo_manager.call("selectCategory(at: Int)", - parameters: (index), - escapingParameters: (index), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.selectCategory(at: index)) - + func showRecepientActions() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func numberOfDApps() -> Int { - - return cuckoo_manager.call("numberOfDApps() -> Int", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.numberOfDApps()) - + func showOperationActions() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func dApp(at index: Int) -> DAppViewModel { - - return cuckoo_manager.call("dApp(at: Int) -> DAppViewModel", - parameters: (index), - escapingParameters: (index), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.dApp(at: index)) - + func send() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockOperationDetailsInteractorInputProtocol: OperationDetailsInteractorInputProtocol, Cuckoo.ProtocolMock { + typealias MocksType = OperationDetailsInteractorInputProtocol - func selectDApp(at index: Int) { - - return cuckoo_manager.call("selectDApp(at: Int)", - parameters: (index), - escapingParameters: (index), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.selectDApp(at: index)) - + typealias Stubbing = __StubbingProxy_OperationDetailsInteractorInputProtocol + typealias Verification = __VerificationProxy_OperationDetailsInteractorInputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: OperationDetailsInteractorInputProtocol? + + func enableDefaultImplementation(_ stub: OperationDetailsInteractorInputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func toogleFavoriteForDApp(at index: Int) { + + + + + func setup() { - return cuckoo_manager.call("toogleFavoriteForDApp(at: Int)", - parameters: (index), - escapingParameters: (index), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.toogleFavoriteForDApp(at: index)) + defaultCall: __defaultImplStub!.setup()) } - struct __StubbingProxy_DAppListPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_OperationDetailsInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -17548,72 +16257,12 @@ import SubstrateSdk func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func refresh() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "refresh()", parameterMatchers: matchers)) - } - - func activateAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "activateAccount()", parameterMatchers: matchers)) - } - - func activateSearch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "activateSearch()", parameterMatchers: matchers)) - } - - func activateSettings() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "activateSettings()", parameterMatchers: matchers)) - } - - func numberOfCategories() -> Cuckoo.ProtocolStubFunction<(), Int> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "numberOfCategories() -> Int", parameterMatchers: matchers)) - } - - func category(at index: M1) -> Cuckoo.ProtocolStubFunction<(Int), String> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "category(at: Int) -> String", parameterMatchers: matchers)) - } - - func selectedCategoryIndex() -> Cuckoo.ProtocolStubFunction<(), Int> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "selectedCategoryIndex() -> Int", parameterMatchers: matchers)) - } - - func selectCategory(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "selectCategory(at: Int)", parameterMatchers: matchers)) - } - - func numberOfDApps() -> Cuckoo.ProtocolStubFunction<(), Int> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "numberOfDApps() -> Int", parameterMatchers: matchers)) - } - - func dApp(at index: M1) -> Cuckoo.ProtocolStubFunction<(Int), DAppViewModel> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "dApp(at: Int) -> DAppViewModel", parameterMatchers: matchers)) - } - - func selectDApp(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "selectDApp(at: Int)", parameterMatchers: matchers)) - } - - func toogleFavoriteForDApp(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListPresenterProtocol.self, method: "toogleFavoriteForDApp(at: Int)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppListPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_OperationDetailsInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -17633,82 +16282,10 @@ import SubstrateSdk return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - @discardableResult - func refresh() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("refresh()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func activateAccount() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func activateSearch() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateSearch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func activateSettings() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateSettings()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func numberOfCategories() -> Cuckoo.__DoNotUse<(), Int> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("numberOfCategories() -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func category(at index: M1) -> Cuckoo.__DoNotUse<(Int), String> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("category(at: Int) -> String", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func selectedCategoryIndex() -> Cuckoo.__DoNotUse<(), Int> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectedCategoryIndex() -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func selectCategory(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("selectCategory(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func numberOfDApps() -> Cuckoo.__DoNotUse<(), Int> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("numberOfDApps() -> Int", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func dApp(at index: M1) -> Cuckoo.__DoNotUse<(Int), DAppViewModel> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("dApp(at: Int) -> DAppViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func selectDApp(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("selectDApp(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func toogleFavoriteForDApp(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("toogleFavoriteForDApp(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - } } - class DAppListPresenterProtocolStub: DAppListPresenterProtocol { + class OperationDetailsInteractorInputProtocolStub: OperationDetailsInteractorInputProtocol { @@ -17720,75 +16297,96 @@ import SubstrateSdk return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockOperationDetailsInteractorOutputProtocol: OperationDetailsInteractorOutputProtocol, Cuckoo.ProtocolMock { + typealias MocksType = OperationDetailsInteractorOutputProtocol - func refresh() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func activateAccount() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func activateSearch() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func activateSettings() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func numberOfCategories() -> Int { - return DefaultValueRegistry.defaultValue(for: (Int).self) - } - - - - func category(at index: Int) -> String { - return DefaultValueRegistry.defaultValue(for: (String).self) - } - - - - func selectedCategoryIndex() -> Int { - return DefaultValueRegistry.defaultValue(for: (Int).self) - } - - + typealias Stubbing = __StubbingProxy_OperationDetailsInteractorOutputProtocol + typealias Verification = __VerificationProxy_OperationDetailsInteractorOutputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func selectCategory(at index: Int) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + private var __defaultImplStub: OperationDetailsInteractorOutputProtocol? + + func enableDefaultImplementation(_ stub: OperationDetailsInteractorOutputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func numberOfDApps() -> Int { - return DefaultValueRegistry.defaultValue(for: (Int).self) - } + - func dApp(at index: Int) -> DAppViewModel { - return DefaultValueRegistry.defaultValue(for: (DAppViewModel).self) + func didReceiveDetails(result: Result) { + + return cuckoo_manager.call("didReceiveDetails(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveDetails(result: result)) + } + + struct __StubbingProxy_OperationDetailsInteractorOutputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func didReceiveDetails(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsInteractorOutputProtocol.self, method: "didReceiveDetails(result: Result)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_OperationDetailsInteractorOutputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didReceiveDetails(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveDetails(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class OperationDetailsInteractorOutputProtocolStub: OperationDetailsInteractorOutputProtocol { + - func selectDApp(at index: Int) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func toogleFavoriteForDApp(at index: Int) { + func didReceiveDetails(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -17796,19 +16394,19 @@ import SubstrateSdk - class MockDAppListInteractorInputProtocol: DAppListInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockOperationDetailsWireframeProtocol: OperationDetailsWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppListInteractorInputProtocol + typealias MocksType = OperationDetailsWireframeProtocol - typealias Stubbing = __StubbingProxy_DAppListInteractorInputProtocol - typealias Verification = __VerificationProxy_DAppListInteractorInputProtocol + typealias Stubbing = __StubbingProxy_OperationDetailsWireframeProtocol + typealias Verification = __VerificationProxy_OperationDetailsWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppListInteractorInputProtocol? + private var __defaultImplStub: OperationDetailsWireframeProtocol? - func enableDefaultImplementation(_ stub: DAppListInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: OperationDetailsWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -17821,66 +16419,51 @@ import SubstrateSdk - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func refresh() { + func showSend(from view: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset) { - return cuckoo_manager.call("refresh()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("showSend(from: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset)", + parameters: (view, displayAddress, chainAsset), + escapingParameters: (view, displayAddress, chainAsset), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.refresh()) + defaultCall: __defaultImplStub!.showSend(from: view, displayAddress: displayAddress, chainAsset: chainAsset)) } - func addToFavorites(dApp: DApp) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("addToFavorites(dApp: DApp)", - parameters: (dApp), - escapingParameters: (dApp), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.addToFavorites(dApp: dApp)) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func removeFromFavorites(dAppIdentifier: String) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("removeFromFavorites(dAppIdentifier: String)", - parameters: (dAppIdentifier), - escapingParameters: (dAppIdentifier), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.removeFromFavorites(dAppIdentifier: dAppIdentifier)) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_DAppListInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_OperationDetailsWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -17888,29 +16471,24 @@ import SubstrateSdk } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func refresh() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorInputProtocol.self, method: "refresh()", parameterMatchers: matchers)) + func showSend(from view: M1, displayAddress: M2, chainAsset: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(OperationDetailsViewProtocol?, DisplayAddress, ChainAsset)> where M1.OptionalMatchedType == OperationDetailsViewProtocol, M2.MatchedType == DisplayAddress, M3.MatchedType == ChainAsset { + let matchers: [Cuckoo.ParameterMatcher<(OperationDetailsViewProtocol?, DisplayAddress, ChainAsset)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: displayAddress) { $0.1 }, wrap(matchable: chainAsset) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsWireframeProtocol.self, method: "showSend(from: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset)", parameterMatchers: matchers)) } - func addToFavorites(dApp: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DApp)> where M1.MatchedType == DApp { - let matchers: [Cuckoo.ParameterMatcher<(DApp)>] = [wrap(matchable: dApp) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorInputProtocol.self, method: "addToFavorites(dApp: DApp)", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func removeFromFavorites(dAppIdentifier: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: dAppIdentifier) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorInputProtocol.self, method: "removeFromFavorites(dAppIdentifier: String)", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppListInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_OperationDetailsWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -17925,33 +16503,27 @@ import SubstrateSdk @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func refresh() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("refresh()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showSend(from view: M1, displayAddress: M2, chainAsset: M3) -> Cuckoo.__DoNotUse<(OperationDetailsViewProtocol?, DisplayAddress, ChainAsset), Void> where M1.OptionalMatchedType == OperationDetailsViewProtocol, M2.MatchedType == DisplayAddress, M3.MatchedType == ChainAsset { + let matchers: [Cuckoo.ParameterMatcher<(OperationDetailsViewProtocol?, DisplayAddress, ChainAsset)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: displayAddress) { $0.1 }, wrap(matchable: chainAsset) { $0.2 }] + return cuckoo_manager.verify("showSend(from: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func addToFavorites(dApp: M1) -> Cuckoo.__DoNotUse<(DApp), Void> where M1.MatchedType == DApp { - let matchers: [Cuckoo.ParameterMatcher<(DApp)>] = [wrap(matchable: dApp) { $0 }] - return cuckoo_manager.verify("addToFavorites(dApp: DApp)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func removeFromFavorites(dAppIdentifier: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: dAppIdentifier) { $0 }] - return cuckoo_manager.verify("removeFromFavorites(dAppIdentifier: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppListInteractorInputProtocolStub: DAppListInteractorInputProtocol { + class OperationDetailsWireframeProtocolStub: OperationDetailsWireframeProtocol { @@ -17959,102 +16531,129 @@ import SubstrateSdk - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func refresh() { + func showSend(from view: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func addToFavorites(dApp: DApp) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func removeFromFavorites(dAppIdentifier: String) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet - class MockDAppListInteractorOutputProtocol: DAppListInteractorOutputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = DAppListInteractorOutputProtocol +import UIKit + + + class MockPinSetupViewProtocol: PinSetupViewProtocol, Cuckoo.ProtocolMock { - typealias Stubbing = __StubbingProxy_DAppListInteractorOutputProtocol - typealias Verification = __VerificationProxy_DAppListInteractorOutputProtocol + typealias MocksType = PinSetupViewProtocol + + typealias Stubbing = __StubbingProxy_PinSetupViewProtocol + typealias Verification = __VerificationProxy_PinSetupViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppListInteractorOutputProtocol? + private var __defaultImplStub: PinSetupViewProtocol? - func enableDefaultImplementation(_ stub: DAppListInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: PinSetupViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + + } + - func didReceive(walletResult: Result) { + func didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void) { - return cuckoo_manager.call("didReceive(walletResult: Result)", - parameters: (walletResult), - escapingParameters: (walletResult), + return cuckoo_manager.call("didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", + parameters: (biometryType, completionBlock), + escapingParameters: (biometryType, completionBlock), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(walletResult: walletResult)) + defaultCall: __defaultImplStub!.didRequestBiometryUsage(biometryType: biometryType, completionBlock: completionBlock)) } - func didReceive(dAppsResult: Result?) { + func didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType) { - return cuckoo_manager.call("didReceive(dAppsResult: Result?)", - parameters: (dAppsResult), - escapingParameters: (dAppsResult), + return cuckoo_manager.call("didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType)", + parameters: (enabled, availableBiometryType), + escapingParameters: (enabled, availableBiometryType), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(dAppsResult: dAppsResult)) + defaultCall: __defaultImplStub!.didChangeAccessoryState(enabled: enabled, availableBiometryType: availableBiometryType)) } - func didReceiveFavoriteDapp(changes: [DataProviderChange]) { + func didReceiveWrongPincode() { - return cuckoo_manager.call("didReceiveFavoriteDapp(changes: [DataProviderChange])", - parameters: (changes), - escapingParameters: (changes), + return cuckoo_manager.call("didReceiveWrongPincode()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFavoriteDapp(changes: changes)) + defaultCall: __defaultImplStub!.didReceiveWrongPincode()) } - struct __StubbingProxy_DAppListInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_PinSetupViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -18062,24 +16661,34 @@ import SubstrateSdk } - func didReceive(walletResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: walletResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorOutputProtocol.self, method: "didReceive(walletResult: Result)", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func didReceive(dAppsResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result?)> where M1.OptionalMatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result?)>] = [wrap(matchable: dAppsResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorOutputProtocol.self, method: "didReceive(dAppsResult: Result?)", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func didReceiveFavoriteDapp(changes: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([DataProviderChange])> where M1.MatchedType == [DataProviderChange] { - let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListInteractorOutputProtocol.self, method: "didReceiveFavoriteDapp(changes: [DataProviderChange])", parameterMatchers: matchers)) + + func didRequestBiometryUsage(biometryType: M1, completionBlock: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(AvailableBiometryType, (Bool) -> Void)> where M1.MatchedType == AvailableBiometryType, M2.MatchedType == (Bool) -> Void { + let matchers: [Cuckoo.ParameterMatcher<(AvailableBiometryType, (Bool) -> Void)>] = [wrap(matchable: biometryType) { $0.0 }, wrap(matchable: completionBlock) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupViewProtocol.self, method: "didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", parameterMatchers: matchers)) + } + + func didChangeAccessoryState(enabled: M1, availableBiometryType: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool, AvailableBiometryType)> where M1.MatchedType == Bool, M2.MatchedType == AvailableBiometryType { + let matchers: [Cuckoo.ParameterMatcher<(Bool, AvailableBiometryType)>] = [wrap(matchable: enabled) { $0.0 }, wrap(matchable: availableBiometryType) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupViewProtocol.self, method: "didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType)", parameterMatchers: matchers)) + } + + func didReceiveWrongPincode() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupViewProtocol.self, method: "didReceiveWrongPincode()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppListInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_PinSetupViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -18091,30 +16700,58 @@ import SubstrateSdk } + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func didReceive(walletResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: walletResult) { $0 }] - return cuckoo_manager.verify("didReceive(walletResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didRequestBiometryUsage(biometryType: M1, completionBlock: M2) -> Cuckoo.__DoNotUse<(AvailableBiometryType, (Bool) -> Void), Void> where M1.MatchedType == AvailableBiometryType, M2.MatchedType == (Bool) -> Void { + let matchers: [Cuckoo.ParameterMatcher<(AvailableBiometryType, (Bool) -> Void)>] = [wrap(matchable: biometryType) { $0.0 }, wrap(matchable: completionBlock) { $0.1 }] + return cuckoo_manager.verify("didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(dAppsResult: M1) -> Cuckoo.__DoNotUse<(Result?), Void> where M1.OptionalMatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result?)>] = [wrap(matchable: dAppsResult) { $0 }] - return cuckoo_manager.verify("didReceive(dAppsResult: Result?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didChangeAccessoryState(enabled: M1, availableBiometryType: M2) -> Cuckoo.__DoNotUse<(Bool, AvailableBiometryType), Void> where M1.MatchedType == Bool, M2.MatchedType == AvailableBiometryType { + let matchers: [Cuckoo.ParameterMatcher<(Bool, AvailableBiometryType)>] = [wrap(matchable: enabled) { $0.0 }, wrap(matchable: availableBiometryType) { $0.1 }] + return cuckoo_manager.verify("didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFavoriteDapp(changes: M1) -> Cuckoo.__DoNotUse<([DataProviderChange]), Void> where M1.MatchedType == [DataProviderChange] { - let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] - return cuckoo_manager.verify("didReceiveFavoriteDapp(changes: [DataProviderChange])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveWrongPincode() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didReceiveWrongPincode()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppListInteractorOutputProtocolStub: DAppListInteractorOutputProtocol { + class PinSetupViewProtocolStub: PinSetupViewProtocol { + + + + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } @@ -18122,19 +16759,19 @@ import SubstrateSdk - func didReceive(walletResult: Result) { + func didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(dAppsResult: Result?) { + func didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFavoriteDapp(changes: [DataProviderChange]) { + func didReceiveWrongPincode() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -18142,19 +16779,19 @@ import SubstrateSdk - class MockDAppListWireframeProtocol: DAppListWireframeProtocol, Cuckoo.ProtocolMock { + class MockPinSetupPresenterProtocol: PinSetupPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppListWireframeProtocol + typealias MocksType = PinSetupPresenterProtocol - typealias Stubbing = __StubbingProxy_DAppListWireframeProtocol - typealias Verification = __VerificationProxy_DAppListWireframeProtocol + typealias Stubbing = __StubbingProxy_PinSetupPresenterProtocol + typealias Verification = __VerificationProxy_PinSetupPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppListWireframeProtocol? + private var __defaultImplStub: PinSetupPresenterProtocol? - func enableDefaultImplementation(_ stub: DAppListWireframeProtocol) { + func enableDefaultImplementation(_ stub: PinSetupPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -18167,66 +16804,66 @@ import SubstrateSdk - func showSearch(from view: DAppListViewProtocol?, delegate: DAppSearchDelegate) { + func start() { - return cuckoo_manager.call("showSearch(from: DAppListViewProtocol?, delegate: DAppSearchDelegate)", - parameters: (view, delegate), - escapingParameters: (view, delegate), + return cuckoo_manager.call("start()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showSearch(from: view, delegate: delegate)) + defaultCall: __defaultImplStub!.start()) } - func showBrowser(from view: DAppListViewProtocol?, for result: DAppSearchResult) { + func cancel() { - return cuckoo_manager.call("showBrowser(from: DAppListViewProtocol?, for: DAppSearchResult)", - parameters: (view, result), - escapingParameters: (view, result), + return cuckoo_manager.call("cancel()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showBrowser(from: view, for: result)) + defaultCall: __defaultImplStub!.cancel()) } - func showSetting(from view: DAppListViewProtocol?) { + func activateBiometricAuth() { - return cuckoo_manager.call("showSetting(from: DAppListViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("activateBiometricAuth()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showSetting(from: view)) + defaultCall: __defaultImplStub!.activateBiometricAuth()) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func submit(pin: String) { - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), + return cuckoo_manager.call("submit(pin: String)", + parameters: (pin), + escapingParameters: (pin), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + defaultCall: __defaultImplStub!.submit(pin: pin)) } - struct __StubbingProxy_DAppListWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_PinSetupPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -18234,29 +16871,29 @@ import SubstrateSdk } - func showSearch(from view: M1, delegate: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListViewProtocol?, DAppSearchDelegate)> where M1.OptionalMatchedType == DAppListViewProtocol, M2.MatchedType == DAppSearchDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?, DAppSearchDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showSearch(from: DAppListViewProtocol?, delegate: DAppSearchDelegate)", parameterMatchers: matchers)) + func start() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupPresenterProtocol.self, method: "start()", parameterMatchers: matchers)) } - func showBrowser(from view: M1, for result: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListViewProtocol?, DAppSearchResult)> where M1.OptionalMatchedType == DAppListViewProtocol, M2.MatchedType == DAppSearchResult { - let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?, DAppSearchResult)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: result) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showBrowser(from: DAppListViewProtocol?, for: DAppSearchResult)", parameterMatchers: matchers)) + func cancel() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupPresenterProtocol.self, method: "cancel()", parameterMatchers: matchers)) } - func showSetting(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListViewProtocol?)> where M1.OptionalMatchedType == DAppListViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showSetting(from: DAppListViewProtocol?)", parameterMatchers: matchers)) + func activateBiometricAuth() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupPresenterProtocol.self, method: "activateBiometricAuth()", parameterMatchers: matchers)) } - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + func submit(pin: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: pin) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupPresenterProtocol.self, method: "submit(pin: String)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppListWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_PinSetupPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -18271,33 +16908,33 @@ import SubstrateSdk @discardableResult - func showSearch(from view: M1, delegate: M2) -> Cuckoo.__DoNotUse<(DAppListViewProtocol?, DAppSearchDelegate), Void> where M1.OptionalMatchedType == DAppListViewProtocol, M2.MatchedType == DAppSearchDelegate { - let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?, DAppSearchDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }] - return cuckoo_manager.verify("showSearch(from: DAppListViewProtocol?, delegate: DAppSearchDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func start() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("start()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showBrowser(from view: M1, for result: M2) -> Cuckoo.__DoNotUse<(DAppListViewProtocol?, DAppSearchResult), Void> where M1.OptionalMatchedType == DAppListViewProtocol, M2.MatchedType == DAppSearchResult { - let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?, DAppSearchResult)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: result) { $0.1 }] - return cuckoo_manager.verify("showBrowser(from: DAppListViewProtocol?, for: DAppSearchResult)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func cancel() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("cancel()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showSetting(from view: M1) -> Cuckoo.__DoNotUse<(DAppListViewProtocol?), Void> where M1.OptionalMatchedType == DAppListViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showSetting(from: DAppListViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func activateBiometricAuth() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("activateBiometricAuth()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func submit(pin: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: pin) { $0 }] + return cuckoo_manager.verify("submit(pin: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppListWireframeProtocolStub: DAppListWireframeProtocol { + class PinSetupPresenterProtocolStub: PinSetupPresenterProtocol { @@ -18305,120 +16942,72 @@ import SubstrateSdk - func showSearch(from view: DAppListViewProtocol?, delegate: DAppSearchDelegate) { + func start() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showBrowser(from view: DAppListViewProtocol?, for result: DAppSearchResult) { + func cancel() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showSetting(from view: DAppListViewProtocol?) { + func activateBiometricAuth() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func submit(pin: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import SubstrateSdk - - class MockDAppOperationConfirmViewProtocol: DAppOperationConfirmViewProtocol, Cuckoo.ProtocolMock { + class MockPinSetupInteractorInputProtocol: PinSetupInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppOperationConfirmViewProtocol + typealias MocksType = PinSetupInteractorInputProtocol - typealias Stubbing = __StubbingProxy_DAppOperationConfirmViewProtocol - typealias Verification = __VerificationProxy_DAppOperationConfirmViewProtocol + typealias Stubbing = __StubbingProxy_PinSetupInteractorInputProtocol + typealias Verification = __VerificationProxy_PinSetupInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppOperationConfirmViewProtocol? + private var __defaultImplStub: PinSetupInteractorInputProtocol? - func enableDefaultImplementation(_ stub: DAppOperationConfirmViewProtocol) { + func enableDefaultImplementation(_ stub: PinSetupInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } - - - - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - - } - - func didReceive(confimationViewModel: DAppOperationConfirmViewModel) { - - return cuckoo_manager.call("didReceive(confimationViewModel: DAppOperationConfirmViewModel)", - parameters: (confimationViewModel), - escapingParameters: (confimationViewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(confimationViewModel: confimationViewModel)) - - } - - - - func didReceive(feeViewModel: DAppOperationFeeViewModel) { + func process(pin: String) { - return cuckoo_manager.call("didReceive(feeViewModel: DAppOperationFeeViewModel)", - parameters: (feeViewModel), - escapingParameters: (feeViewModel), + return cuckoo_manager.call("process(pin: String)", + parameters: (pin), + escapingParameters: (pin), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(feeViewModel: feeViewModel)) + defaultCall: __defaultImplStub!.process(pin: pin)) } - struct __StubbingProxy_DAppOperationConfirmViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_PinSetupInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -18426,29 +17015,14 @@ import SubstrateSdk } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - func didReceive(confimationViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationConfirmViewModel)> where M1.MatchedType == DAppOperationConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewModel)>] = [wrap(matchable: confimationViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmViewProtocol.self, method: "didReceive(confimationViewModel: DAppOperationConfirmViewModel)", parameterMatchers: matchers)) - } - - func didReceive(feeViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationFeeViewModel)> where M1.MatchedType == DAppOperationFeeViewModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationFeeViewModel)>] = [wrap(matchable: feeViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmViewProtocol.self, method: "didReceive(feeViewModel: DAppOperationFeeViewModel)", parameterMatchers: matchers)) + func process(pin: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: pin) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupInteractorInputProtocol.self, method: "process(pin: String)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppOperationConfirmViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_PinSetupInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -18460,52 +17034,18 @@ import SubstrateSdk } - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceive(confimationViewModel: M1) -> Cuckoo.__DoNotUse<(DAppOperationConfirmViewModel), Void> where M1.MatchedType == DAppOperationConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewModel)>] = [wrap(matchable: confimationViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(confimationViewModel: DAppOperationConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(feeViewModel: M1) -> Cuckoo.__DoNotUse<(DAppOperationFeeViewModel), Void> where M1.MatchedType == DAppOperationFeeViewModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationFeeViewModel)>] = [wrap(matchable: feeViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(feeViewModel: DAppOperationFeeViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func process(pin: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: pin) { $0 }] + return cuckoo_manager.verify("process(pin: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppOperationConfirmViewProtocolStub: DAppOperationConfirmViewProtocol { - - - - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - - - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } + class PinSetupInteractorInputProtocolStub: PinSetupInteractorInputProtocol { @@ -18513,13 +17053,7 @@ import SubstrateSdk - func didReceive(confimationViewModel: DAppOperationConfirmViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(feeViewModel: DAppOperationFeeViewModel) { + func process(pin: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -18527,19 +17061,19 @@ import SubstrateSdk - class MockDAppOperationConfirmPresenterProtocol: DAppOperationConfirmPresenterProtocol, Cuckoo.ProtocolMock { + class MockPinSetupInteractorOutputProtocol: PinSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppOperationConfirmPresenterProtocol + typealias MocksType = PinSetupInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_DAppOperationConfirmPresenterProtocol - typealias Verification = __VerificationProxy_DAppOperationConfirmPresenterProtocol + typealias Stubbing = __StubbingProxy_PinSetupInteractorOutputProtocol + typealias Verification = __VerificationProxy_PinSetupInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppOperationConfirmPresenterProtocol? + private var __defaultImplStub: PinSetupInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: DAppOperationConfirmPresenterProtocol) { + func enableDefaultImplementation(_ stub: PinSetupInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -18552,66 +17086,51 @@ import SubstrateSdk - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func confirm() { + func didSavePin() { - return cuckoo_manager.call("confirm()", + return cuckoo_manager.call("didSavePin()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.confirm()) + defaultCall: __defaultImplStub!.didSavePin()) } - func reject() { + func didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void) { - return cuckoo_manager.call("reject()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", + parameters: (type, completionBlock), + escapingParameters: (type, completionBlock), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reject()) + defaultCall: __defaultImplStub!.didStartWaitingBiometryDecision(type: type, completionBlock: completionBlock)) } - func activateTxDetails() { + func didChangeState(from: PinSetupInteractor.PinSetupState) { - return cuckoo_manager.call("activateTxDetails()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didChangeState(from: PinSetupInteractor.PinSetupState)", + parameters: (from), + escapingParameters: (from), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateTxDetails()) + defaultCall: __defaultImplStub!.didChangeState(from: from)) } - struct __StubbingProxy_DAppOperationConfirmPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_PinSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -18619,29 +17138,24 @@ import SubstrateSdk } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func didSavePin() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupInteractorOutputProtocol.self, method: "didSavePin()", parameterMatchers: matchers)) } - func reject() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmPresenterProtocol.self, method: "reject()", parameterMatchers: matchers)) + func didStartWaitingBiometryDecision(type: M1, completionBlock: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(AvailableBiometryType, (Bool) -> Void)> where M1.MatchedType == AvailableBiometryType, M2.MatchedType == (Bool) -> Void { + let matchers: [Cuckoo.ParameterMatcher<(AvailableBiometryType, (Bool) -> Void)>] = [wrap(matchable: type) { $0.0 }, wrap(matchable: completionBlock) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupInteractorOutputProtocol.self, method: "didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", parameterMatchers: matchers)) } - func activateTxDetails() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmPresenterProtocol.self, method: "activateTxDetails()", parameterMatchers: matchers)) + func didChangeState(from: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PinSetupInteractor.PinSetupState)> where M1.MatchedType == PinSetupInteractor.PinSetupState { + let matchers: [Cuckoo.ParameterMatcher<(PinSetupInteractor.PinSetupState)>] = [wrap(matchable: from) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupInteractorOutputProtocol.self, method: "didChangeState(from: PinSetupInteractor.PinSetupState)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppOperationConfirmPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_PinSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -18656,33 +17170,27 @@ import SubstrateSdk @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { + func didSavePin() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("didSavePin()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func confirm() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStartWaitingBiometryDecision(type: M1, completionBlock: M2) -> Cuckoo.__DoNotUse<(AvailableBiometryType, (Bool) -> Void), Void> where M1.MatchedType == AvailableBiometryType, M2.MatchedType == (Bool) -> Void { + let matchers: [Cuckoo.ParameterMatcher<(AvailableBiometryType, (Bool) -> Void)>] = [wrap(matchable: type) { $0.0 }, wrap(matchable: completionBlock) { $0.1 }] + return cuckoo_manager.verify("didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func reject() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("reject()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func activateTxDetails() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateTxDetails()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didChangeState(from: M1) -> Cuckoo.__DoNotUse<(PinSetupInteractor.PinSetupState), Void> where M1.MatchedType == PinSetupInteractor.PinSetupState { + let matchers: [Cuckoo.ParameterMatcher<(PinSetupInteractor.PinSetupState)>] = [wrap(matchable: from) { $0 }] + return cuckoo_manager.verify("didChangeState(from: PinSetupInteractor.PinSetupState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppOperationConfirmPresenterProtocolStub: DAppOperationConfirmPresenterProtocol { + class PinSetupInteractorOutputProtocolStub: PinSetupInteractorOutputProtocol { @@ -18690,25 +17198,19 @@ import SubstrateSdk - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func confirm() { + func didSavePin() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func reject() { + func didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func activateTxDetails() { + func didChangeState(from: PinSetupInteractor.PinSetupState) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -18716,19 +17218,19 @@ import SubstrateSdk - class MockDAppOperationConfirmInteractorInputProtocol: DAppOperationConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockPinSetupWireframeProtocol: PinSetupWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppOperationConfirmInteractorInputProtocol + typealias MocksType = PinSetupWireframeProtocol - typealias Stubbing = __StubbingProxy_DAppOperationConfirmInteractorInputProtocol - typealias Verification = __VerificationProxy_DAppOperationConfirmInteractorInputProtocol + typealias Stubbing = __StubbingProxy_PinSetupWireframeProtocol + typealias Verification = __VerificationProxy_PinSetupWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppOperationConfirmInteractorInputProtocol? + private var __defaultImplStub: PinSetupWireframeProtocol? - func enableDefaultImplementation(_ stub: DAppOperationConfirmInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: PinSetupWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -18741,81 +17243,36 @@ import SubstrateSdk - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func estimateFee() { - - return cuckoo_manager.call("estimateFee()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.estimateFee()) - - } - - - - func confirm() { - - return cuckoo_manager.call("confirm()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.confirm()) - - } - - - - func reject() { + func showMain(from view: PinSetupViewProtocol?) { - return cuckoo_manager.call("reject()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("showMain(from: PinSetupViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reject()) + defaultCall: __defaultImplStub!.showMain(from: view)) } - func prepareTxDetails() { + func showSignup(from view: PinSetupViewProtocol?) { - return cuckoo_manager.call("prepareTxDetails()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("showSignup(from: PinSetupViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.prepareTxDetails()) + defaultCall: __defaultImplStub!.showSignup(from: view)) } - struct __StubbingProxy_DAppOperationConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_PinSetupWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -18823,34 +17280,19 @@ import SubstrateSdk } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) - } - - func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "confirm()", parameterMatchers: matchers)) - } - - func reject() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "reject()", parameterMatchers: matchers)) + func showMain(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PinSetupViewProtocol?)> where M1.OptionalMatchedType == PinSetupViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(PinSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupWireframeProtocol.self, method: "showMain(from: PinSetupViewProtocol?)", parameterMatchers: matchers)) } - func prepareTxDetails() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorInputProtocol.self, method: "prepareTxDetails()", parameterMatchers: matchers)) + func showSignup(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PinSetupViewProtocol?)> where M1.OptionalMatchedType == PinSetupViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(PinSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockPinSetupWireframeProtocol.self, method: "showSignup(from: PinSetupViewProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppOperationConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_PinSetupWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -18865,39 +17307,21 @@ import SubstrateSdk @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func confirm() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func reject() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("reject()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showMain(from view: M1) -> Cuckoo.__DoNotUse<(PinSetupViewProtocol?), Void> where M1.OptionalMatchedType == PinSetupViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(PinSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showMain(from: PinSetupViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func prepareTxDetails() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("prepareTxDetails()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showSignup(from view: M1) -> Cuckoo.__DoNotUse<(PinSetupViewProtocol?), Void> where M1.OptionalMatchedType == PinSetupViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(PinSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showSignup(from: PinSetupViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppOperationConfirmInteractorInputProtocolStub: DAppOperationConfirmInteractorInputProtocol { + class PinSetupWireframeProtocolStub: PinSetupWireframeProtocol { @@ -18905,51 +17329,38 @@ import SubstrateSdk - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func estimateFee() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func confirm() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func reject() { + func showMain(from view: PinSetupViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func prepareTxDetails() { + func showSignup(from view: PinSetupViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet + +import UIKit + - class MockDAppOperationConfirmInteractorOutputProtocol: DAppOperationConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockRootPresenterProtocol: RootPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppOperationConfirmInteractorOutputProtocol + typealias MocksType = RootPresenterProtocol - typealias Stubbing = __StubbingProxy_DAppOperationConfirmInteractorOutputProtocol - typealias Verification = __VerificationProxy_DAppOperationConfirmInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_RootPresenterProtocol + typealias Verification = __VerificationProxy_RootPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppOperationConfirmInteractorOutputProtocol? + private var __defaultImplStub: RootPresenterProtocol? - func enableDefaultImplementation(_ stub: DAppOperationConfirmInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: RootPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -18962,81 +17373,21 @@ import SubstrateSdk - func didReceive(modelResult: Result) { - - return cuckoo_manager.call("didReceive(modelResult: Result)", - parameters: (modelResult), - escapingParameters: (modelResult), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(modelResult: modelResult)) - - } - - - - func didReceive(feeResult: Result) { - - return cuckoo_manager.call("didReceive(feeResult: Result)", - parameters: (feeResult), - escapingParameters: (feeResult), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(feeResult: feeResult)) - - } - - - - func didReceive(priceResult: Result) { - - return cuckoo_manager.call("didReceive(priceResult: Result)", - parameters: (priceResult), - escapingParameters: (priceResult), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(priceResult: priceResult)) - - } - - - - func didReceive(responseResult: Result, for request: DAppOperationRequest) { - - return cuckoo_manager.call("didReceive(responseResult: Result, for: DAppOperationRequest)", - parameters: (responseResult, request), - escapingParameters: (responseResult, request), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(responseResult: responseResult, for: request)) - - } - - - - func didReceive(txDetailsResult: Result) { + func loadOnLaunch() { - return cuckoo_manager.call("didReceive(txDetailsResult: Result)", - parameters: (txDetailsResult), - escapingParameters: (txDetailsResult), + return cuckoo_manager.call("loadOnLaunch()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(txDetailsResult: txDetailsResult)) + defaultCall: __defaultImplStub!.loadOnLaunch()) } - struct __StubbingProxy_DAppOperationConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_RootPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -19044,34 +17395,14 @@ import SubstrateSdk } - func didReceive(modelResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: modelResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(modelResult: Result)", parameterMatchers: matchers)) - } - - func didReceive(feeResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: feeResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(feeResult: Result)", parameterMatchers: matchers)) - } - - func didReceive(priceResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(priceResult: Result)", parameterMatchers: matchers)) - } - - func didReceive(responseResult: M1, for request: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Result, DAppOperationRequest)> where M1.MatchedType == Result, M2.MatchedType == DAppOperationRequest { - let matchers: [Cuckoo.ParameterMatcher<(Result, DAppOperationRequest)>] = [wrap(matchable: responseResult) { $0.0 }, wrap(matchable: request) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(responseResult: Result, for: DAppOperationRequest)", parameterMatchers: matchers)) - } - - func didReceive(txDetailsResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: txDetailsResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmInteractorOutputProtocol.self, method: "didReceive(txDetailsResult: Result)", parameterMatchers: matchers)) + func loadOnLaunch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRootPresenterProtocol.self, method: "loadOnLaunch()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppOperationConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_RootPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -19086,39 +17417,15 @@ import SubstrateSdk @discardableResult - func didReceive(modelResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: modelResult) { $0 }] - return cuckoo_manager.verify("didReceive(modelResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(feeResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: feeResult) { $0 }] - return cuckoo_manager.verify("didReceive(feeResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(priceResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] - return cuckoo_manager.verify("didReceive(priceResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(responseResult: M1, for request: M2) -> Cuckoo.__DoNotUse<(Result, DAppOperationRequest), Void> where M1.MatchedType == Result, M2.MatchedType == DAppOperationRequest { - let matchers: [Cuckoo.ParameterMatcher<(Result, DAppOperationRequest)>] = [wrap(matchable: responseResult) { $0.0 }, wrap(matchable: request) { $0.1 }] - return cuckoo_manager.verify("didReceive(responseResult: Result, for: DAppOperationRequest)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(txDetailsResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: txDetailsResult) { $0 }] - return cuckoo_manager.verify("didReceive(txDetailsResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func loadOnLaunch() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("loadOnLaunch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppOperationConfirmInteractorOutputProtocolStub: DAppOperationConfirmInteractorOutputProtocol { + class RootPresenterProtocolStub: RootPresenterProtocol { @@ -19126,31 +17433,7 @@ import SubstrateSdk - func didReceive(modelResult: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(feeResult: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(priceResult: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(responseResult: Result, for request: DAppOperationRequest) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(txDetailsResult: Result) { + func loadOnLaunch() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -19158,19 +17441,19 @@ import SubstrateSdk - class MockDAppOperationConfirmWireframeProtocol: DAppOperationConfirmWireframeProtocol, Cuckoo.ProtocolMock { + class MockRootWireframeProtocol: RootWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppOperationConfirmWireframeProtocol + typealias MocksType = RootWireframeProtocol - typealias Stubbing = __StubbingProxy_DAppOperationConfirmWireframeProtocol - typealias Verification = __VerificationProxy_DAppOperationConfirmWireframeProtocol + typealias Stubbing = __StubbingProxy_RootWireframeProtocol + typealias Verification = __VerificationProxy_RootWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppOperationConfirmWireframeProtocol? + private var __defaultImplStub: RootWireframeProtocol? - func enableDefaultImplementation(_ stub: DAppOperationConfirmWireframeProtocol) { + func enableDefaultImplementation(_ stub: RootWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -19183,66 +17466,66 @@ import SubstrateSdk - func close(view: DAppOperationConfirmViewProtocol?) { + func showLocalAuthentication(on view: UIWindow) { - return cuckoo_manager.call("close(view: DAppOperationConfirmViewProtocol?)", + return cuckoo_manager.call("showLocalAuthentication(on: UIWindow)", parameters: (view), escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(view: view)) + defaultCall: __defaultImplStub!.showLocalAuthentication(on: view)) } - func showTxDetails(from view: DAppOperationConfirmViewProtocol?, json: JSON) { + func showOnboarding(on view: UIWindow) { - return cuckoo_manager.call("showTxDetails(from: DAppOperationConfirmViewProtocol?, json: JSON)", - parameters: (view, json), - escapingParameters: (view, json), + return cuckoo_manager.call("showOnboarding(on: UIWindow)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showTxDetails(from: view, json: json)) + defaultCall: __defaultImplStub!.showOnboarding(on: view)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func showPincodeSetup(on view: UIWindow) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("showPincodeSetup(on: UIWindow)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.showPincodeSetup(on: view)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func showBroken(on view: UIWindow) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("showBroken(on: UIWindow)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.showBroken(on: view)) } - struct __StubbingProxy_DAppOperationConfirmWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_RootWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -19250,29 +17533,29 @@ import SubstrateSdk } - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationConfirmViewProtocol?)> where M1.OptionalMatchedType == DAppOperationConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmWireframeProtocol.self, method: "close(view: DAppOperationConfirmViewProtocol?)", parameterMatchers: matchers)) + func showLocalAuthentication(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(UIWindow)> where M1.MatchedType == UIWindow { + let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockRootWireframeProtocol.self, method: "showLocalAuthentication(on: UIWindow)", parameterMatchers: matchers)) } - func showTxDetails(from view: M1, json: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationConfirmViewProtocol?, JSON)> where M1.OptionalMatchedType == DAppOperationConfirmViewProtocol, M2.MatchedType == JSON { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewProtocol?, JSON)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: json) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmWireframeProtocol.self, method: "showTxDetails(from: DAppOperationConfirmViewProtocol?, json: JSON)", parameterMatchers: matchers)) + func showOnboarding(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(UIWindow)> where M1.MatchedType == UIWindow { + let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockRootWireframeProtocol.self, method: "showOnboarding(on: UIWindow)", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func showPincodeSetup(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(UIWindow)> where M1.MatchedType == UIWindow { + let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockRootWireframeProtocol.self, method: "showPincodeSetup(on: UIWindow)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func showBroken(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(UIWindow)> where M1.MatchedType == UIWindow { + let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockRootWireframeProtocol.self, method: "showBroken(on: UIWindow)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppOperationConfirmWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_RootWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -19287,33 +17570,33 @@ import SubstrateSdk @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(DAppOperationConfirmViewProtocol?), Void> where M1.OptionalMatchedType == DAppOperationConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: DAppOperationConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showLocalAuthentication(on view: M1) -> Cuckoo.__DoNotUse<(UIWindow), Void> where M1.MatchedType == UIWindow { + let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showLocalAuthentication(on: UIWindow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showTxDetails(from view: M1, json: M2) -> Cuckoo.__DoNotUse<(DAppOperationConfirmViewProtocol?, JSON), Void> where M1.OptionalMatchedType == DAppOperationConfirmViewProtocol, M2.MatchedType == JSON { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationConfirmViewProtocol?, JSON)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: json) { $0.1 }] - return cuckoo_manager.verify("showTxDetails(from: DAppOperationConfirmViewProtocol?, json: JSON)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showOnboarding(on view: M1) -> Cuckoo.__DoNotUse<(UIWindow), Void> where M1.MatchedType == UIWindow { + let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showOnboarding(on: UIWindow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showPincodeSetup(on view: M1) -> Cuckoo.__DoNotUse<(UIWindow), Void> where M1.MatchedType == UIWindow { + let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showPincodeSetup(on: UIWindow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showBroken(on view: M1) -> Cuckoo.__DoNotUse<(UIWindow), Void> where M1.MatchedType == UIWindow { + let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showBroken(on: UIWindow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppOperationConfirmWireframeProtocolStub: DAppOperationConfirmWireframeProtocol { + class RootWireframeProtocolStub: RootWireframeProtocol { @@ -19321,25 +17604,25 @@ import SubstrateSdk - func close(view: DAppOperationConfirmViewProtocol?) { + func showLocalAuthentication(on view: UIWindow) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showTxDetails(from view: DAppOperationConfirmViewProtocol?, json: JSON) { + func showOnboarding(on view: UIWindow) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func showPincodeSetup(on view: UIWindow) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func showBroken(on view: UIWindow) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -19347,19 +17630,19 @@ import SubstrateSdk - class MockDAppOperationConfirmDelegate: DAppOperationConfirmDelegate, Cuckoo.ProtocolMock { + class MockRootInteractorInputProtocol: RootInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppOperationConfirmDelegate + typealias MocksType = RootInteractorInputProtocol - typealias Stubbing = __StubbingProxy_DAppOperationConfirmDelegate - typealias Verification = __VerificationProxy_DAppOperationConfirmDelegate + typealias Stubbing = __StubbingProxy_RootInteractorInputProtocol + typealias Verification = __VerificationProxy_RootInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppOperationConfirmDelegate? + private var __defaultImplStub: RootInteractorInputProtocol? - func enableDefaultImplementation(_ stub: DAppOperationConfirmDelegate) { + func enableDefaultImplementation(_ stub: RootInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -19372,21 +17655,36 @@ import SubstrateSdk - func didReceiveConfirmationResponse(_ response: DAppOperationResponse, for request: DAppOperationRequest) { + func setup() { - return cuckoo_manager.call("didReceiveConfirmationResponse(_: DAppOperationResponse, for: DAppOperationRequest)", - parameters: (response, request), - escapingParameters: (response, request), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveConfirmationResponse(response, for: request)) + defaultCall: __defaultImplStub!.setup()) + + } + + + + func decideModuleSynchroniously() { + + return cuckoo_manager.call("decideModuleSynchroniously()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.decideModuleSynchroniously()) } - struct __StubbingProxy_DAppOperationConfirmDelegate: Cuckoo.StubbingProxy { + struct __StubbingProxy_RootInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -19394,14 +17692,19 @@ import SubstrateSdk } - func didReceiveConfirmationResponse(_ response: M1, for request: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppOperationResponse, DAppOperationRequest)> where M1.MatchedType == DAppOperationResponse, M2.MatchedType == DAppOperationRequest { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationResponse, DAppOperationRequest)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: request) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppOperationConfirmDelegate.self, method: "didReceiveConfirmationResponse(_: DAppOperationResponse, for: DAppOperationRequest)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func decideModuleSynchroniously() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorInputProtocol.self, method: "decideModuleSynchroniously()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppOperationConfirmDelegate: Cuckoo.VerificationProxy { + struct __VerificationProxy_RootInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -19416,15 +17719,21 @@ import SubstrateSdk @discardableResult - func didReceiveConfirmationResponse(_ response: M1, for request: M2) -> Cuckoo.__DoNotUse<(DAppOperationResponse, DAppOperationRequest), Void> where M1.MatchedType == DAppOperationResponse, M2.MatchedType == DAppOperationRequest { - let matchers: [Cuckoo.ParameterMatcher<(DAppOperationResponse, DAppOperationRequest)>] = [wrap(matchable: response) { $0.0 }, wrap(matchable: request) { $0.1 }] - return cuckoo_manager.verify("didReceiveConfirmationResponse(_: DAppOperationResponse, for: DAppOperationRequest)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func decideModuleSynchroniously() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("decideModuleSynchroniously()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppOperationConfirmDelegateStub: DAppOperationConfirmDelegate { + class RootInteractorInputProtocolStub: RootInteractorInputProtocol { @@ -19432,7 +17741,202 @@ import SubstrateSdk - func didReceiveConfirmationResponse(_ response: DAppOperationResponse, for request: DAppOperationRequest) { + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func decideModuleSynchroniously() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + + class MockRootInteractorOutputProtocol: RootInteractorOutputProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = RootInteractorOutputProtocol + + typealias Stubbing = __StubbingProxy_RootInteractorOutputProtocol + typealias Verification = __VerificationProxy_RootInteractorOutputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: RootInteractorOutputProtocol? + + func enableDefaultImplementation(_ stub: RootInteractorOutputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + + + + + func didDecideOnboarding() { + + return cuckoo_manager.call("didDecideOnboarding()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didDecideOnboarding()) + + } + + + + func didDecideLocalAuthentication() { + + return cuckoo_manager.call("didDecideLocalAuthentication()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didDecideLocalAuthentication()) + + } + + + + func didDecidePincodeSetup() { + + return cuckoo_manager.call("didDecidePincodeSetup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didDecidePincodeSetup()) + + } + + + + func didDecideBroken() { + + return cuckoo_manager.call("didDecideBroken()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didDecideBroken()) + + } + + + struct __StubbingProxy_RootInteractorOutputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func didDecideOnboarding() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorOutputProtocol.self, method: "didDecideOnboarding()", parameterMatchers: matchers)) + } + + func didDecideLocalAuthentication() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorOutputProtocol.self, method: "didDecideLocalAuthentication()", parameterMatchers: matchers)) + } + + func didDecidePincodeSetup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorOutputProtocol.self, method: "didDecidePincodeSetup()", parameterMatchers: matchers)) + } + + func didDecideBroken() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorOutputProtocol.self, method: "didDecideBroken()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_RootInteractorOutputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didDecideOnboarding() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didDecideOnboarding()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didDecideLocalAuthentication() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didDecideLocalAuthentication()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didDecidePincodeSetup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didDecidePincodeSetup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didDecideBroken() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didDecideBroken()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class RootInteractorOutputProtocolStub: RootInteractorOutputProtocol { + + + + + + + + func didDecideOnboarding() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didDecideLocalAuthentication() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didDecidePincodeSetup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didDecideBroken() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -19442,22 +17946,23 @@ import SubstrateSdk import Cuckoo @testable import novawallet -import RobinHood +import Foundation +import UIKit.UIImage - class MockDAppSearchViewProtocol: DAppSearchViewProtocol, Cuckoo.ProtocolMock { + class MockSettingsViewProtocol: SettingsViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppSearchViewProtocol + typealias MocksType = SettingsViewProtocol - typealias Stubbing = __StubbingProxy_DAppSearchViewProtocol - typealias Verification = __VerificationProxy_DAppSearchViewProtocol + typealias Stubbing = __StubbingProxy_SettingsViewProtocol + typealias Verification = __VerificationProxy_SettingsViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppSearchViewProtocol? + private var __defaultImplStub: SettingsViewProtocol? - func enableDefaultImplementation(_ stub: DAppSearchViewProtocol) { + func enableDefaultImplementation(_ stub: SettingsViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -19498,36 +18003,36 @@ import RobinHood - func didReceive(initialQuery: String) { + func reload(sections: [(SettingsSection, [SettingsCellViewModel])]) { - return cuckoo_manager.call("didReceive(initialQuery: String)", - parameters: (initialQuery), - escapingParameters: (initialQuery), + return cuckoo_manager.call("reload(sections: [(SettingsSection, [SettingsCellViewModel])])", + parameters: (sections), + escapingParameters: (sections), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(initialQuery: initialQuery)) + defaultCall: __defaultImplStub!.reload(sections: sections)) } - func didReceiveDApp(viewModels: [DAppViewModel]) { + func didLoad(userViewModel: SettingsAccountViewModel) { - return cuckoo_manager.call("didReceiveDApp(viewModels: [DAppViewModel])", - parameters: (viewModels), - escapingParameters: (viewModels), + return cuckoo_manager.call("didLoad(userViewModel: SettingsAccountViewModel)", + parameters: (userViewModel), + escapingParameters: (userViewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveDApp(viewModels: viewModels)) + defaultCall: __defaultImplStub!.didLoad(userViewModel: userViewModel)) } - struct __StubbingProxy_DAppSearchViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SettingsViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -19535,29 +18040,29 @@ import RobinHood } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - func didReceive(initialQuery: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: initialQuery) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchViewProtocol.self, method: "didReceive(initialQuery: String)", parameterMatchers: matchers)) + func reload(sections: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([(SettingsSection, [SettingsCellViewModel])])> where M1.MatchedType == [(SettingsSection, [SettingsCellViewModel])] { + let matchers: [Cuckoo.ParameterMatcher<([(SettingsSection, [SettingsCellViewModel])])>] = [wrap(matchable: sections) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsViewProtocol.self, method: "reload(sections: [(SettingsSection, [SettingsCellViewModel])])", parameterMatchers: matchers)) } - func didReceiveDApp(viewModels: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([DAppViewModel])> where M1.MatchedType == [DAppViewModel] { - let matchers: [Cuckoo.ParameterMatcher<([DAppViewModel])>] = [wrap(matchable: viewModels) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchViewProtocol.self, method: "didReceiveDApp(viewModels: [DAppViewModel])", parameterMatchers: matchers)) + func didLoad(userViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SettingsAccountViewModel)> where M1.MatchedType == SettingsAccountViewModel { + let matchers: [Cuckoo.ParameterMatcher<(SettingsAccountViewModel)>] = [wrap(matchable: userViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsViewProtocol.self, method: "didLoad(userViewModel: SettingsAccountViewModel)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppSearchViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SettingsViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -19582,21 +18087,21 @@ import RobinHood @discardableResult - func didReceive(initialQuery: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: initialQuery) { $0 }] - return cuckoo_manager.verify("didReceive(initialQuery: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload(sections: M1) -> Cuckoo.__DoNotUse<([(SettingsSection, [SettingsCellViewModel])]), Void> where M1.MatchedType == [(SettingsSection, [SettingsCellViewModel])] { + let matchers: [Cuckoo.ParameterMatcher<([(SettingsSection, [SettingsCellViewModel])])>] = [wrap(matchable: sections) { $0 }] + return cuckoo_manager.verify("reload(sections: [(SettingsSection, [SettingsCellViewModel])])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveDApp(viewModels: M1) -> Cuckoo.__DoNotUse<([DAppViewModel]), Void> where M1.MatchedType == [DAppViewModel] { - let matchers: [Cuckoo.ParameterMatcher<([DAppViewModel])>] = [wrap(matchable: viewModels) { $0 }] - return cuckoo_manager.verify("didReceiveDApp(viewModels: [DAppViewModel])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didLoad(userViewModel: M1) -> Cuckoo.__DoNotUse<(SettingsAccountViewModel), Void> where M1.MatchedType == SettingsAccountViewModel { + let matchers: [Cuckoo.ParameterMatcher<(SettingsAccountViewModel)>] = [wrap(matchable: userViewModel) { $0 }] + return cuckoo_manager.verify("didLoad(userViewModel: SettingsAccountViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppSearchViewProtocolStub: DAppSearchViewProtocol { + class SettingsViewProtocolStub: SettingsViewProtocol { @@ -19622,13 +18127,13 @@ import RobinHood - func didReceive(initialQuery: String) { + func reload(sections: [(SettingsSection, [SettingsCellViewModel])]) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveDApp(viewModels: [DAppViewModel]) { + func didLoad(userViewModel: SettingsAccountViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -19636,25 +18141,39 @@ import RobinHood - class MockDAppSearchPresenterProtocol: DAppSearchPresenterProtocol, Cuckoo.ProtocolMock { + class MockSettingsPresenterProtocol: SettingsPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppSearchPresenterProtocol + typealias MocksType = SettingsPresenterProtocol - typealias Stubbing = __StubbingProxy_DAppSearchPresenterProtocol - typealias Verification = __VerificationProxy_DAppSearchPresenterProtocol + typealias Stubbing = __StubbingProxy_SettingsPresenterProtocol + typealias Verification = __VerificationProxy_SettingsPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppSearchPresenterProtocol? + private var __defaultImplStub: SettingsPresenterProtocol? - func enableDefaultImplementation(_ stub: DAppSearchPresenterProtocol) { + func enableDefaultImplementation(_ stub: SettingsPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + + var appNameText: String { + get { + return cuckoo_manager.getter("appNameText", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.appNameText) + } + + } + @@ -19676,66 +18195,51 @@ import RobinHood - func updateSearch(query: String) { - - return cuckoo_manager.call("updateSearch(query: String)", - parameters: (query), - escapingParameters: (query), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.updateSearch(query: query)) - - } - - - - func selectDApp(viewModel: DAppViewModel) { + func actionRow(_ row: SettingsRow) { - return cuckoo_manager.call("selectDApp(viewModel: DAppViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("actionRow(_: SettingsRow)", + parameters: (row), + escapingParameters: (row), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectDApp(viewModel: viewModel)) + defaultCall: __defaultImplStub!.actionRow(row)) } - func selectSearchQuery() { + func handleWalletAction() { - return cuckoo_manager.call("selectSearchQuery()", + return cuckoo_manager.call("handleWalletAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectSearchQuery()) + defaultCall: __defaultImplStub!.handleWalletAction()) } - func cancel() { + func handleSwitchAction() { - return cuckoo_manager.call("cancel()", + return cuckoo_manager.call("handleSwitchAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.cancel()) + defaultCall: __defaultImplStub!.handleSwitchAction()) } - struct __StubbingProxy_DAppSearchPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SettingsPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -19743,34 +18247,34 @@ import RobinHood } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + var appNameText: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "appNameText") } - func updateSearch(query: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: query) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "updateSearch(query: String)", parameterMatchers: matchers)) + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func selectDApp(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppViewModel)> where M1.MatchedType == DAppViewModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "selectDApp(viewModel: DAppViewModel)", parameterMatchers: matchers)) + func actionRow(_ row: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SettingsRow)> where M1.MatchedType == SettingsRow { + let matchers: [Cuckoo.ParameterMatcher<(SettingsRow)>] = [wrap(matchable: row) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsPresenterProtocol.self, method: "actionRow(_: SettingsRow)", parameterMatchers: matchers)) } - func selectSearchQuery() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func handleWalletAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "selectSearchQuery()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSettingsPresenterProtocol.self, method: "handleWalletAction()", parameterMatchers: matchers)) } - func cancel() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func handleSwitchAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchPresenterProtocol.self, method: "cancel()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSettingsPresenterProtocol.self, method: "handleSwitchAction()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppSearchPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SettingsPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -19782,6 +18286,11 @@ import RobinHood } + + var appNameText: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "appNameText", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult @@ -19791,33 +18300,36 @@ import RobinHood } @discardableResult - func updateSearch(query: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: query) { $0 }] - return cuckoo_manager.verify("updateSearch(query: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func selectDApp(viewModel: M1) -> Cuckoo.__DoNotUse<(DAppViewModel), Void> where M1.MatchedType == DAppViewModel { - let matchers: [Cuckoo.ParameterMatcher<(DAppViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("selectDApp(viewModel: DAppViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func actionRow(_ row: M1) -> Cuckoo.__DoNotUse<(SettingsRow), Void> where M1.MatchedType == SettingsRow { + let matchers: [Cuckoo.ParameterMatcher<(SettingsRow)>] = [wrap(matchable: row) { $0 }] + return cuckoo_manager.verify("actionRow(_: SettingsRow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectSearchQuery() -> Cuckoo.__DoNotUse<(), Void> { + func handleWalletAction() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectSearchQuery()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("handleWalletAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func cancel() -> Cuckoo.__DoNotUse<(), Void> { + func handleSwitchAction() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("cancel()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("handleSwitchAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppSearchPresenterProtocolStub: DAppSearchPresenterProtocol { + class SettingsPresenterProtocolStub: SettingsPresenterProtocol { + + + + var appNameText: String { + get { + return DefaultValueRegistry.defaultValue(for: (String).self) + } + + } @@ -19831,25 +18343,19 @@ import RobinHood - func updateSearch(query: String) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func selectDApp(viewModel: DAppViewModel) { + func actionRow(_ row: SettingsRow) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectSearchQuery() { + func handleWalletAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func cancel() { + func handleSwitchAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -19857,19 +18363,19 @@ import RobinHood - class MockDAppSearchInteractorInputProtocol: DAppSearchInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockSettingsViewModelFactoryProtocol: SettingsViewModelFactoryProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppSearchInteractorInputProtocol + typealias MocksType = SettingsViewModelFactoryProtocol - typealias Stubbing = __StubbingProxy_DAppSearchInteractorInputProtocol - typealias Verification = __VerificationProxy_DAppSearchInteractorInputProtocol + typealias Stubbing = __StubbingProxy_SettingsViewModelFactoryProtocol + typealias Verification = __VerificationProxy_SettingsViewModelFactoryProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppSearchInteractorInputProtocol? + private var __defaultImplStub: SettingsViewModelFactoryProtocol? - func enableDefaultImplementation(_ stub: DAppSearchInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: SettingsViewModelFactoryProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -19882,21 +18388,36 @@ import RobinHood - func setup() { + func createAccountViewModel(for wallet: MetaAccountModel) -> SettingsAccountViewModel { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("createAccountViewModel(for: MetaAccountModel) -> SettingsAccountViewModel", + parameters: (wallet), + escapingParameters: (wallet), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.createAccountViewModel(for: wallet)) + + } + + + + func createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])] { + + return cuckoo_manager.call("createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])]", + parameters: (language, currency, locale), + escapingParameters: (language, currency, locale), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.createSectionViewModels(language: language, currency: currency, locale: locale)) } - struct __StubbingProxy_DAppSearchInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SettingsViewModelFactoryProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -19904,14 +18425,19 @@ import RobinHood } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + func createAccountViewModel(for wallet: M1) -> Cuckoo.ProtocolStubFunction<(MetaAccountModel), SettingsAccountViewModel> where M1.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsViewModelFactoryProtocol.self, method: "createAccountViewModel(for: MetaAccountModel) -> SettingsAccountViewModel", parameterMatchers: matchers)) + } + + func createSectionViewModels(language: M1, currency: M2, locale: M3) -> Cuckoo.ProtocolStubFunction<(Language?, String?, Locale), [(SettingsSection, [SettingsCellViewModel])]> where M1.OptionalMatchedType == Language, M2.OptionalMatchedType == String, M3.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<(Language?, String?, Locale)>] = [wrap(matchable: language) { $0.0 }, wrap(matchable: currency) { $0.1 }, wrap(matchable: locale) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsViewModelFactoryProtocol.self, method: "createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])]", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppSearchInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SettingsViewModelFactoryProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -19926,15 +18452,21 @@ import RobinHood @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func createAccountViewModel(for wallet: M1) -> Cuckoo.__DoNotUse<(MetaAccountModel), SettingsAccountViewModel> where M1.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] + return cuckoo_manager.verify("createAccountViewModel(for: MetaAccountModel) -> SettingsAccountViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func createSectionViewModels(language: M1, currency: M2, locale: M3) -> Cuckoo.__DoNotUse<(Language?, String?, Locale), [(SettingsSection, [SettingsCellViewModel])]> where M1.OptionalMatchedType == Language, M2.OptionalMatchedType == String, M3.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<(Language?, String?, Locale)>] = [wrap(matchable: language) { $0.0 }, wrap(matchable: currency) { $0.1 }, wrap(matchable: locale) { $0.2 }] + return cuckoo_manager.verify("createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])]", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppSearchInteractorInputProtocolStub: DAppSearchInteractorInputProtocol { + class SettingsViewModelFactoryProtocolStub: SettingsViewModelFactoryProtocol { @@ -19942,27 +18474,33 @@ import RobinHood - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func createAccountViewModel(for wallet: MetaAccountModel) -> SettingsAccountViewModel { + return DefaultValueRegistry.defaultValue(for: (SettingsAccountViewModel).self) + } + + + + func createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])] { + return DefaultValueRegistry.defaultValue(for: ([(SettingsSection, [SettingsCellViewModel])]).self) } } - class MockDAppSearchInteractorOutputProtocol: DAppSearchInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockSettingsInteractorInputProtocol: SettingsInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppSearchInteractorOutputProtocol + typealias MocksType = SettingsInteractorInputProtocol - typealias Stubbing = __StubbingProxy_DAppSearchInteractorOutputProtocol - typealias Verification = __VerificationProxy_DAppSearchInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_SettingsInteractorInputProtocol + typealias Verification = __VerificationProxy_SettingsInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppSearchInteractorOutputProtocol? + private var __defaultImplStub: SettingsInteractorInputProtocol? - func enableDefaultImplementation(_ stub: DAppSearchInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: SettingsInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -19975,36 +18513,21 @@ import RobinHood - func didReceive(dAppsResult: Result) { - - return cuckoo_manager.call("didReceive(dAppsResult: Result)", - parameters: (dAppsResult), - escapingParameters: (dAppsResult), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(dAppsResult: dAppsResult)) - - } - - - - func didReceiveFavorite(changes: [DataProviderChange]) { + func setup() { - return cuckoo_manager.call("didReceiveFavorite(changes: [DataProviderChange])", - parameters: (changes), - escapingParameters: (changes), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFavorite(changes: changes)) + defaultCall: __defaultImplStub!.setup()) } - struct __StubbingProxy_DAppSearchInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SettingsInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -20012,19 +18535,14 @@ import RobinHood } - func didReceive(dAppsResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: dAppsResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchInteractorOutputProtocol.self, method: "didReceive(dAppsResult: Result)", parameterMatchers: matchers)) - } - - func didReceiveFavorite(changes: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([DataProviderChange])> where M1.MatchedType == [DataProviderChange] { - let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchInteractorOutputProtocol.self, method: "didReceiveFavorite(changes: [DataProviderChange])", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppSearchInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SettingsInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -20039,21 +18557,15 @@ import RobinHood @discardableResult - func didReceive(dAppsResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: dAppsResult) { $0 }] - return cuckoo_manager.verify("didReceive(dAppsResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFavorite(changes: M1) -> Cuckoo.__DoNotUse<([DataProviderChange]), Void> where M1.MatchedType == [DataProviderChange] { - let matchers: [Cuckoo.ParameterMatcher<([DataProviderChange])>] = [wrap(matchable: changes) { $0 }] - return cuckoo_manager.verify("didReceiveFavorite(changes: [DataProviderChange])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppSearchInteractorOutputProtocolStub: DAppSearchInteractorOutputProtocol { + class SettingsInteractorInputProtocolStub: SettingsInteractorInputProtocol { @@ -20061,13 +18573,7 @@ import RobinHood - func didReceive(dAppsResult: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFavorite(changes: [DataProviderChange]) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -20075,19 +18581,19 @@ import RobinHood - class MockDAppSearchWireframeProtocol: DAppSearchWireframeProtocol, Cuckoo.ProtocolMock { + class MockSettingsInteractorOutputProtocol: SettingsInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppSearchWireframeProtocol + typealias MocksType = SettingsInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_DAppSearchWireframeProtocol - typealias Verification = __VerificationProxy_DAppSearchWireframeProtocol + typealias Stubbing = __StubbingProxy_SettingsInteractorOutputProtocol + typealias Verification = __VerificationProxy_SettingsInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppSearchWireframeProtocol? + private var __defaultImplStub: SettingsInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: DAppSearchWireframeProtocol) { + func enableDefaultImplementation(_ stub: SettingsInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -20100,21 +18606,51 @@ import RobinHood - func close(from view: DAppSearchViewProtocol?) { + func didReceive(wallet: MetaAccountModel) { - return cuckoo_manager.call("close(from: DAppSearchViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceive(wallet: MetaAccountModel)", + parameters: (wallet), + escapingParameters: (wallet), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(from: view)) + defaultCall: __defaultImplStub!.didReceive(wallet: wallet)) + + } + + + + func didReceiveUserDataProvider(error: Error) { + + return cuckoo_manager.call("didReceiveUserDataProvider(error: Error)", + parameters: (error), + escapingParameters: (error), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveUserDataProvider(error: error)) + + } + + + + func didReceive(currencyCode: String) { + + return cuckoo_manager.call("didReceive(currencyCode: String)", + parameters: (currencyCode), + escapingParameters: (currencyCode), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(currencyCode: currencyCode)) } - struct __StubbingProxy_DAppSearchWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SettingsInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -20122,14 +18658,24 @@ import RobinHood } - func close(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppSearchViewProtocol?)> where M1.OptionalMatchedType == DAppSearchViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppSearchViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchWireframeProtocol.self, method: "close(from: DAppSearchViewProtocol?)", parameterMatchers: matchers)) + func didReceive(wallet: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaAccountModel)> where M1.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsInteractorOutputProtocol.self, method: "didReceive(wallet: MetaAccountModel)", parameterMatchers: matchers)) + } + + func didReceiveUserDataProvider(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsInteractorOutputProtocol.self, method: "didReceiveUserDataProvider(error: Error)", parameterMatchers: matchers)) + } + + func didReceive(currencyCode: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: currencyCode) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsInteractorOutputProtocol.self, method: "didReceive(currencyCode: String)", parameterMatchers: matchers)) } } - struct __VerificationProxy_DAppSearchWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SettingsInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -20144,15 +18690,27 @@ import RobinHood @discardableResult - func close(from view: M1) -> Cuckoo.__DoNotUse<(DAppSearchViewProtocol?), Void> where M1.OptionalMatchedType == DAppSearchViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(DAppSearchViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(from: DAppSearchViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(wallet: M1) -> Cuckoo.__DoNotUse<(MetaAccountModel), Void> where M1.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] + return cuckoo_manager.verify("didReceive(wallet: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveUserDataProvider(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return cuckoo_manager.verify("didReceiveUserDataProvider(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(currencyCode: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: currencyCode) { $0 }] + return cuckoo_manager.verify("didReceive(currencyCode: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class DAppSearchWireframeProtocolStub: DAppSearchWireframeProtocol { + class SettingsInteractorOutputProtocolStub: SettingsInteractorOutputProtocol { @@ -20160,7 +18718,19 @@ import RobinHood - func close(from view: DAppSearchViewProtocol?) { + func didReceive(wallet: MetaAccountModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveUserDataProvider(error: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceive(currencyCode: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -20168,19 +18738,19 @@ import RobinHood - class MockDAppSearchDelegate: DAppSearchDelegate, Cuckoo.ProtocolMock { + class MockSettingsWireframeProtocol: SettingsWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = DAppSearchDelegate + typealias MocksType = SettingsWireframeProtocol - typealias Stubbing = __StubbingProxy_DAppSearchDelegate - typealias Verification = __VerificationProxy_DAppSearchDelegate + typealias Stubbing = __StubbingProxy_SettingsWireframeProtocol + typealias Verification = __VerificationProxy_SettingsWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: DAppSearchDelegate? + private var __defaultImplStub: SettingsWireframeProtocol? - func enableDefaultImplementation(_ stub: DAppSearchDelegate) { + func enableDefaultImplementation(_ stub: SettingsWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -20193,163 +18763,141 @@ import RobinHood - func didCompleteDAppSearchResult(_ result: DAppSearchResult) { + func showAccountDetails(for walletId: String, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didCompleteDAppSearchResult(_: DAppSearchResult)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("showAccountDetails(for: String, from: ControllerBackedProtocol?)", + parameters: (walletId, view), + escapingParameters: (walletId, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didCompleteDAppSearchResult(result)) + defaultCall: __defaultImplStub!.showAccountDetails(for: walletId, from: view)) } - - struct __StubbingProxy_DAppSearchDelegate: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didCompleteDAppSearchResult(_ result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppSearchResult)> where M1.MatchedType == DAppSearchResult { - let matchers: [Cuckoo.ParameterMatcher<(DAppSearchResult)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockDAppSearchDelegate.self, method: "didCompleteDAppSearchResult(_: DAppSearchResult)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_DAppSearchDelegate: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func didCompleteDAppSearchResult(_ result: M1) -> Cuckoo.__DoNotUse<(DAppSearchResult), Void> where M1.MatchedType == DAppSearchResult { - let matchers: [Cuckoo.ParameterMatcher<(DAppSearchResult)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didCompleteDAppSearchResult(_: DAppSearchResult)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class DAppSearchDelegateStub: DAppSearchDelegate { - - + func showAccountSelection(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showAccountSelection(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showAccountSelection(from: view)) + + } - func didCompleteDAppSearchResult(_ result: DAppSearchResult) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func showLanguageSelection(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showLanguageSelection(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showLanguageSelection(from: view)) + } -} - - -import Cuckoo -@testable import novawallet - -import Foundation -import SoraFoundation - - - class MockAccountExportPasswordViewProtocol: AccountExportPasswordViewProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = AccountExportPasswordViewProtocol - typealias Stubbing = __StubbingProxy_AccountExportPasswordViewProtocol - typealias Verification = __VerificationProxy_AccountExportPasswordViewProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: AccountExportPasswordViewProtocol? - - func enableDefaultImplementation(_ stub: AccountExportPasswordViewProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func showPincodeChange(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showPincodeChange(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showPincodeChange(from: view)) + } - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + func showCurrencies(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showCurrencies(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showCurrencies(from: view)) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - - + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + + } - func setPasswordInputViewModel(_ viewModel: InputViewModelProtocol) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return cuckoo_manager.call("setPasswordInputViewModel(_: InputViewModelProtocol)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setPasswordInputViewModel(viewModel)) + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) } - func setPasswordConfirmationViewModel(_ viewModel: InputViewModelProtocol) { + func presentSuccessNotification(_ title: String, from view: ControllerBackedProtocol?, completion closure: (() -> Void)?) { - return cuckoo_manager.call("setPasswordConfirmationViewModel(_: InputViewModelProtocol)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", + parameters: (title, view, closure), + escapingParameters: (title, view, closure), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setPasswordConfirmationViewModel(viewModel)) + defaultCall: __defaultImplStub!.presentSuccessNotification(title, from: view, completion: closure)) } - struct __StubbingProxy_AccountExportPasswordViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SettingsWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -20357,29 +18905,54 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") + func showAccountDetails(for walletId: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(String, ControllerBackedProtocol?)> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?)>] = [wrap(matchable: walletId) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showAccountDetails(for: String, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func showAccountSelection(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showAccountSelection(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } + func showLanguageSelection(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showLanguageSelection(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func showPincodeChange(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showPincodeChange(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } + func showCurrencies(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showCurrencies(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } - func setPasswordInputViewModel(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(InputViewModelProtocol)> where M1.MatchedType == InputViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordViewProtocol.self, method: "setPasswordInputViewModel(_: InputViewModelProtocol)", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func setPasswordConfirmationViewModel(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(InputViewModelProtocol)> where M1.MatchedType == InputViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordViewProtocol.self, method: "setPasswordConfirmationViewModel(_: InputViewModelProtocol)", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + } + + func presentSuccessNotification(_ title: M1, from view: M2, completion closure: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(String, ControllerBackedProtocol?, (() -> Void)?)> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == (() -> Void) { + let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?, (() -> Void)?)>] = [wrap(matchable: title) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: closure) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_AccountExportPasswordViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SettingsWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -20391,128 +18964,241 @@ import SoraFoundation } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func showAccountDetails(for walletId: M1, from view: M2) -> Cuckoo.__DoNotUse<(String, ControllerBackedProtocol?), Void> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?)>] = [wrap(matchable: walletId) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("showAccountDetails(for: String, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func showAccountSelection(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showAccountSelection(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func showLanguageSelection(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showLanguageSelection(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - + @discardableResult + func showPincodeChange(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showPincodeChange(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } @discardableResult - func setPasswordInputViewModel(_ viewModel: M1) -> Cuckoo.__DoNotUse<(InputViewModelProtocol), Void> where M1.MatchedType == InputViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("setPasswordInputViewModel(_: InputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showCurrencies(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showCurrencies(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func setPasswordConfirmationViewModel(_ viewModel: M1) -> Cuckoo.__DoNotUse<(InputViewModelProtocol), Void> where M1.MatchedType == InputViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("setPasswordConfirmationViewModel(_: InputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentSuccessNotification(_ title: M1, from view: M2, completion closure: M3) -> Cuckoo.__DoNotUse<(String, ControllerBackedProtocol?, (() -> Void)?), Void> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == (() -> Void) { + let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?, (() -> Void)?)>] = [wrap(matchable: title) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: closure) { $0.2 }] + return cuckoo_manager.verify("presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class AccountExportPasswordViewProtocolStub: AccountExportPasswordViewProtocol { - + class SettingsWireframeProtocolStub: SettingsWireframeProtocol { + - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - + - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - + + func showAccountDetails(for walletId: String, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - + + func showAccountSelection(from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func setPasswordInputViewModel(_ viewModel: InputViewModelProtocol) { + func showLanguageSelection(from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func setPasswordConfirmationViewModel(_ viewModel: InputViewModelProtocol) { + func showPincodeChange(from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockAccountExportPasswordPresenterProtocol: AccountExportPasswordPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = AccountExportPasswordPresenterProtocol - typealias Stubbing = __StubbingProxy_AccountExportPasswordPresenterProtocol - typealias Verification = __VerificationProxy_AccountExportPasswordPresenterProtocol + func showCurrencies(from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentSuccessNotification(_ title: String, from view: ControllerBackedProtocol?, completion closure: (() -> Void)?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + +import Cuckoo +@testable import novawallet + +import SoraFoundation + + + class MockAnalyticsRewardDetailsViewProtocol: AnalyticsRewardDetailsViewProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = AnalyticsRewardDetailsViewProtocol + + typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsViewProtocol + typealias Verification = __VerificationProxy_AnalyticsRewardDetailsViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: AccountExportPasswordPresenterProtocol? + private var __defaultImplStub: AnalyticsRewardDetailsViewProtocol? - func enableDefaultImplementation(_ stub: AccountExportPasswordPresenterProtocol) { + func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + + } + - func setup() { + func bind(viewModel: LocalizableResource) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("bind(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.bind(viewModel: viewModel)) } - func proceed() { + public func applyLocalization() { - return cuckoo_manager.call("proceed()", + return cuckoo_manager.call("applyLocalization()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_AccountExportPasswordPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_AnalyticsRewardDetailsViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -20520,19 +19206,34 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") + } + + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") + } + + + func bind(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsViewProtocol.self, method: "bind(viewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_AccountExportPasswordPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_AnalyticsRewardDetailsViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -20544,24 +19245,68 @@ import SoraFoundation } + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func bind(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("bind(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class AccountExportPasswordPresenterProtocolStub: AccountExportPasswordPresenterProtocol { + class AnalyticsRewardDetailsViewProtocolStub: AnalyticsRewardDetailsViewProtocol { + + + + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } @@ -20569,13 +19314,13 @@ import SoraFoundation - func setup() { + func bind(viewModel: LocalizableResource) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func proceed() { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -20583,19 +19328,19 @@ import SoraFoundation - class MockAccountExportPasswordInteractorInputProtocol: AccountExportPasswordInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockAnalyticsRewardDetailsPresenterProtocol: AnalyticsRewardDetailsPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = AccountExportPasswordInteractorInputProtocol + typealias MocksType = AnalyticsRewardDetailsPresenterProtocol - typealias Stubbing = __StubbingProxy_AccountExportPasswordInteractorInputProtocol - typealias Verification = __VerificationProxy_AccountExportPasswordInteractorInputProtocol + typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsPresenterProtocol + typealias Verification = __VerificationProxy_AnalyticsRewardDetailsPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: AccountExportPasswordInteractorInputProtocol? + private var __defaultImplStub: AnalyticsRewardDetailsPresenterProtocol? - func enableDefaultImplementation(_ stub: AccountExportPasswordInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -20608,21 +19353,36 @@ import SoraFoundation - func exportAccount(password: String) { + func setup() { - return cuckoo_manager.call("exportAccount(password: String)", - parameters: (password), - escapingParameters: (password), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.exportAccount(password: password)) + defaultCall: __defaultImplStub!.setup()) + + } + + + + func handleEventIdAction() { + + return cuckoo_manager.call("handleEventIdAction()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.handleEventIdAction()) } - struct __StubbingProxy_AccountExportPasswordInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_AnalyticsRewardDetailsPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -20630,14 +19390,19 @@ import SoraFoundation } - func exportAccount(password: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: password) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordInteractorInputProtocol.self, method: "exportAccount(password: String)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func handleEventIdAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsPresenterProtocol.self, method: "handleEventIdAction()", parameterMatchers: matchers)) } } - struct __VerificationProxy_AccountExportPasswordInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_AnalyticsRewardDetailsPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -20652,15 +19417,21 @@ import SoraFoundation @discardableResult - func exportAccount(password: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: password) { $0 }] - return cuckoo_manager.verify("exportAccount(password: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func handleEventIdAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("handleEventIdAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class AccountExportPasswordInteractorInputProtocolStub: AccountExportPasswordInteractorInputProtocol { + class AnalyticsRewardDetailsPresenterProtocolStub: AnalyticsRewardDetailsPresenterProtocol { @@ -20668,7 +19439,13 @@ import SoraFoundation - func exportAccount(password: String) { + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func handleEventIdAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -20676,19 +19453,19 @@ import SoraFoundation - class MockAccountExportPasswordInteractorOutputProtocol: AccountExportPasswordInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockAnalyticsRewardDetailsInteractorInputProtocol: AnalyticsRewardDetailsInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = AccountExportPasswordInteractorOutputProtocol + typealias MocksType = AnalyticsRewardDetailsInteractorInputProtocol - typealias Stubbing = __StubbingProxy_AccountExportPasswordInteractorOutputProtocol - typealias Verification = __VerificationProxy_AccountExportPasswordInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsInteractorInputProtocol + typealias Verification = __VerificationProxy_AnalyticsRewardDetailsInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: AccountExportPasswordInteractorOutputProtocol? + private var __defaultImplStub: AnalyticsRewardDetailsInteractorInputProtocol? - func enableDefaultImplementation(_ stub: AccountExportPasswordInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -20699,38 +19476,8 @@ import SoraFoundation - - - func didExport(json: RestoreJson) { - - return cuckoo_manager.call("didExport(json: RestoreJson)", - parameters: (json), - escapingParameters: (json), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didExport(json: json)) - - } - - - - func didReceive(error: Error) { - - return cuckoo_manager.call("didReceive(error: Error)", - parameters: (error), - escapingParameters: (error), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(error: error)) - - } - - struct __StubbingProxy_AccountExportPasswordInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_AnalyticsRewardDetailsInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -20738,19 +19485,9 @@ import SoraFoundation } - func didExport(json: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RestoreJson)> where M1.MatchedType == RestoreJson { - let matchers: [Cuckoo.ParameterMatcher<(RestoreJson)>] = [wrap(matchable: json) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordInteractorOutputProtocol.self, method: "didExport(json: RestoreJson)", parameterMatchers: matchers)) - } - - func didReceive(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordInteractorOutputProtocol.self, method: "didReceive(error: Error)", parameterMatchers: matchers)) - } - } - struct __VerificationProxy_AccountExportPasswordInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_AnalyticsRewardDetailsInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -20764,56 +19501,93 @@ import SoraFoundation - @discardableResult - func didExport(json: M1) -> Cuckoo.__DoNotUse<(RestoreJson), Void> where M1.MatchedType == RestoreJson { - let matchers: [Cuckoo.ParameterMatcher<(RestoreJson)>] = [wrap(matchable: json) { $0 }] - return cuckoo_manager.verify("didExport(json: RestoreJson)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return cuckoo_manager.verify("didReceive(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - } } - class AccountExportPasswordInteractorOutputProtocolStub: AccountExportPasswordInteractorOutputProtocol { + class AnalyticsRewardDetailsInteractorInputProtocolStub: AnalyticsRewardDetailsInteractorInputProtocol { + + +} + + + class MockAnalyticsRewardDetailsInteractorOutputProtocol: AnalyticsRewardDetailsInteractorOutputProtocol, Cuckoo.ProtocolMock { + typealias MocksType = AnalyticsRewardDetailsInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsInteractorOutputProtocol + typealias Verification = __VerificationProxy_AnalyticsRewardDetailsInteractorOutputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func didExport(json: RestoreJson) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + private var __defaultImplStub: AnalyticsRewardDetailsInteractorOutputProtocol? + + func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsInteractorOutputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didReceive(error: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + + + + struct __StubbingProxy_AnalyticsRewardDetailsInteractorOutputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + } + + struct __VerificationProxy_AnalyticsRewardDetailsInteractorOutputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + } +} + + class AnalyticsRewardDetailsInteractorOutputProtocolStub: AnalyticsRewardDetailsInteractorOutputProtocol { + + + + } - class MockAccountExportPasswordWireframeProtocol: AccountExportPasswordWireframeProtocol, Cuckoo.ProtocolMock { + class MockAnalyticsRewardDetailsWireframeProtocol: AnalyticsRewardDetailsWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = AccountExportPasswordWireframeProtocol + typealias MocksType = AnalyticsRewardDetailsWireframeProtocol - typealias Stubbing = __StubbingProxy_AccountExportPasswordWireframeProtocol - typealias Verification = __VerificationProxy_AccountExportPasswordWireframeProtocol + typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsWireframeProtocol + typealias Verification = __VerificationProxy_AnalyticsRewardDetailsWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: AccountExportPasswordWireframeProtocol? + private var __defaultImplStub: AnalyticsRewardDetailsWireframeProtocol? - func enableDefaultImplementation(_ stub: AccountExportPasswordWireframeProtocol) { + func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -20826,16 +19600,16 @@ import SoraFoundation - func showJSONExport(_ json: RestoreJson, from view: AccountExportPasswordViewProtocol?) { + func presentSuccessNotification(_ title: String, from view: ControllerBackedProtocol?, completion closure: (() -> Void)?) { - return cuckoo_manager.call("showJSONExport(_: RestoreJson, from: AccountExportPasswordViewProtocol?)", - parameters: (json, view), - escapingParameters: (json, view), + return cuckoo_manager.call("presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", + parameters: (title, view, closure), + escapingParameters: (title, view, closure), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showJSONExport(json, from: view)) + defaultCall: __defaultImplStub!.presentSuccessNotification(title, from: view, completion: closure)) } @@ -20869,8 +19643,23 @@ import SoraFoundation } + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + + } + - struct __StubbingProxy_AccountExportPasswordWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_AnalyticsRewardDetailsWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -20878,24 +19667,29 @@ import SoraFoundation } - func showJSONExport(_ json: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(RestoreJson, AccountExportPasswordViewProtocol?)> where M1.MatchedType == RestoreJson, M2.OptionalMatchedType == AccountExportPasswordViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(RestoreJson, AccountExportPasswordViewProtocol?)>] = [wrap(matchable: json) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordWireframeProtocol.self, method: "showJSONExport(_: RestoreJson, from: AccountExportPasswordViewProtocol?)", parameterMatchers: matchers)) + func presentSuccessNotification(_ title: M1, from view: M2, completion closure: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(String, ControllerBackedProtocol?, (() -> Void)?)> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == (() -> Void) { + let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?, (() -> Void)?)>] = [wrap(matchable: title) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: closure) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsWireframeProtocol.self, method: "presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockAccountExportPasswordWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) } } - struct __VerificationProxy_AccountExportPasswordWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_AnalyticsRewardDetailsWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -20910,9 +19704,9 @@ import SoraFoundation @discardableResult - func showJSONExport(_ json: M1, from view: M2) -> Cuckoo.__DoNotUse<(RestoreJson, AccountExportPasswordViewProtocol?), Void> where M1.MatchedType == RestoreJson, M2.OptionalMatchedType == AccountExportPasswordViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(RestoreJson, AccountExportPasswordViewProtocol?)>] = [wrap(matchable: json) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("showJSONExport(_: RestoreJson, from: AccountExportPasswordViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentSuccessNotification(_ title: M1, from view: M2, completion closure: M3) -> Cuckoo.__DoNotUse<(String, ControllerBackedProtocol?, (() -> Void)?), Void> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == (() -> Void) { + let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?, (() -> Void)?)>] = [wrap(matchable: title) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: closure) { $0.2 }] + return cuckoo_manager.verify("presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -20927,10 +19721,16 @@ import SoraFoundation return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class AccountExportPasswordWireframeProtocolStub: AccountExportPasswordWireframeProtocol { + class AnalyticsRewardDetailsWireframeProtocolStub: AnalyticsRewardDetailsWireframeProtocol { @@ -20938,7 +19738,7 @@ import SoraFoundation - func showJSONExport(_ json: RestoreJson, from view: AccountExportPasswordViewProtocol?) { + func presentSuccessNotification(_ title: String, from view: ControllerBackedProtocol?, completion closure: (() -> Void)?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -20954,41 +19754,139 @@ import SoraFoundation return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } -import Cuckoo -@testable import novawallet - -import Foundation -import SoraFoundation - - class MockExportGenericViewProtocol: ExportGenericViewProtocol, Cuckoo.ProtocolMock { + class MockAnalyticsRewardDetailsViewModelFactoryProtocol: AnalyticsRewardDetailsViewModelFactoryProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ExportGenericViewProtocol + typealias MocksType = AnalyticsRewardDetailsViewModelFactoryProtocol - typealias Stubbing = __StubbingProxy_ExportGenericViewProtocol - typealias Verification = __VerificationProxy_ExportGenericViewProtocol + typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsViewModelFactoryProtocol + typealias Verification = __VerificationProxy_AnalyticsRewardDetailsViewModelFactoryProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ExportGenericViewProtocol? + private var __defaultImplStub: AnalyticsRewardDetailsViewModelFactoryProtocol? - func enableDefaultImplementation(_ stub: ExportGenericViewProtocol) { + func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsViewModelFactoryProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: + + + func createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource { + + return cuckoo_manager.call("createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource", + parameters: (rewardModel), + escapingParameters: (rewardModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.createViweModel(rewardModel: rewardModel)) + + } + + + struct __StubbingProxy_AnalyticsRewardDetailsViewModelFactoryProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func createViweModel(rewardModel: M1) -> Cuckoo.ProtocolStubFunction<(AnalyticsRewardDetailsModel), LocalizableResource> where M1.MatchedType == AnalyticsRewardDetailsModel { + let matchers: [Cuckoo.ParameterMatcher<(AnalyticsRewardDetailsModel)>] = [wrap(matchable: rewardModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsViewModelFactoryProtocol.self, method: "createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_AnalyticsRewardDetailsViewModelFactoryProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func createViweModel(rewardModel: M1) -> Cuckoo.__DoNotUse<(AnalyticsRewardDetailsModel), LocalizableResource> where M1.MatchedType == AnalyticsRewardDetailsModel { + let matchers: [Cuckoo.ParameterMatcher<(AnalyticsRewardDetailsModel)>] = [wrap(matchable: rewardModel) { $0 }] + return cuckoo_manager.verify("createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class AnalyticsRewardDetailsViewModelFactoryProtocolStub: AnalyticsRewardDetailsViewModelFactoryProtocol { + + + + + + + + func createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource { + return DefaultValueRegistry.defaultValue(for: (LocalizableResource).self) + } + +} + + +import Cuckoo +@testable import novawallet + +import SoraFoundation + + + class MockControllerAccountViewProtocol: ControllerAccountViewProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = ControllerAccountViewProtocol + + typealias Stubbing = __StubbingProxy_ControllerAccountViewProtocol + typealias Verification = __VerificationProxy_ControllerAccountViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: ControllerAccountViewProtocol? + + func enableDefaultImplementation(_ stub: ControllerAccountViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , @@ -21011,27 +19909,81 @@ import SoraFoundation } + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + + } + - func set(viewModel: ExportGenericViewModel) { + func reload(with viewModel: ControllerAccountViewModel) { - return cuckoo_manager.call("set(viewModel: ExportGenericViewModel)", + return cuckoo_manager.call("reload(with: ControllerAccountViewModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.set(viewModel: viewModel)) + defaultCall: __defaultImplStub!.reload(with: viewModel)) + + } + + + + func didCompleteControllerSelection() { + + return cuckoo_manager.call("didCompleteControllerSelection()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didCompleteControllerSelection()) + + } + + + + public func applyLocalization() { + + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_ExportGenericViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ControllerAccountViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -21039,24 +19991,39 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - func set(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewModel)> where M1.MatchedType == ExportGenericViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericViewProtocol.self, method: "set(viewModel: ExportGenericViewModel)", parameterMatchers: matchers)) + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") + } + + + func reload(with viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerAccountViewModel)> where M1.MatchedType == ControllerAccountViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ControllerAccountViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountViewProtocol.self, method: "reload(with: ControllerAccountViewModel)", parameterMatchers: matchers)) + } + + func didCompleteControllerSelection() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountViewProtocol.self, method: "didCompleteControllerSelection()", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_ExportGenericViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ControllerAccountViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -21078,18 +20045,35 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func set(viewModel: M1) -> Cuckoo.__DoNotUse<(ExportGenericViewModel), Void> where M1.MatchedType == ExportGenericViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("set(viewModel: ExportGenericViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload(with viewModel: M1) -> Cuckoo.__DoNotUse<(ControllerAccountViewModel), Void> where M1.MatchedType == ControllerAccountViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ControllerAccountViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("reload(with: ControllerAccountViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didCompleteControllerSelection() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didCompleteControllerSelection()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ExportGenericViewProtocolStub: ExportGenericViewProtocol { + class ControllerAccountViewProtocolStub: ControllerAccountViewProtocol { @@ -21108,6 +20092,17 @@ import SoraFoundation } } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } @@ -21115,7 +20110,19 @@ import SoraFoundation - func set(viewModel: ExportGenericViewModel) { + func reload(with viewModel: ControllerAccountViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didCompleteControllerSelection() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -21123,19 +20130,19 @@ import SoraFoundation - class MockExportGenericPresenterProtocol: ExportGenericPresenterProtocol, Cuckoo.ProtocolMock { + class MockControllerAccountViewModelFactoryProtocol: ControllerAccountViewModelFactoryProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ExportGenericPresenterProtocol + typealias MocksType = ControllerAccountViewModelFactoryProtocol - typealias Stubbing = __StubbingProxy_ExportGenericPresenterProtocol - typealias Verification = __VerificationProxy_ExportGenericPresenterProtocol + typealias Stubbing = __StubbingProxy_ControllerAccountViewModelFactoryProtocol + typealias Verification = __VerificationProxy_ControllerAccountViewModelFactoryProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ExportGenericPresenterProtocol? + private var __defaultImplStub: ControllerAccountViewModelFactoryProtocol? - func enableDefaultImplementation(_ stub: ExportGenericPresenterProtocol) { + func enableDefaultImplementation(_ stub: ControllerAccountViewModelFactoryProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -21148,51 +20155,21 @@ import SoraFoundation - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func activateExport() { - - return cuckoo_manager.call("activateExport()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.activateExport()) - - } - - - - func activateAdvancedSettings() { + func createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel { - return cuckoo_manager.call("activateAdvancedSettings()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel", + parameters: (stashItem, stashAccountItem, chosenAccountItem), + escapingParameters: (stashItem, stashAccountItem, chosenAccountItem), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateAdvancedSettings()) + defaultCall: __defaultImplStub!.createViewModel(stashItem: stashItem, stashAccountItem: stashAccountItem, chosenAccountItem: chosenAccountItem)) } - struct __StubbingProxy_ExportGenericPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ControllerAccountViewModelFactoryProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -21200,24 +20177,14 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func activateExport() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericPresenterProtocol.self, method: "activateExport()", parameterMatchers: matchers)) - } - - func activateAdvancedSettings() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericPresenterProtocol.self, method: "activateAdvancedSettings()", parameterMatchers: matchers)) + func createViewModel(stashItem: M1, stashAccountItem: M2, chosenAccountItem: M3) -> Cuckoo.ProtocolStubFunction<(StashItem, MetaChainAccountResponse?, MetaChainAccountResponse?), ControllerAccountViewModel> where M1.MatchedType == StashItem, M2.OptionalMatchedType == MetaChainAccountResponse, M3.OptionalMatchedType == MetaChainAccountResponse { + let matchers: [Cuckoo.ParameterMatcher<(StashItem, MetaChainAccountResponse?, MetaChainAccountResponse?)>] = [wrap(matchable: stashItem) { $0.0 }, wrap(matchable: stashAccountItem) { $0.1 }, wrap(matchable: chosenAccountItem) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountViewModelFactoryProtocol.self, method: "createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel", parameterMatchers: matchers)) } } - struct __VerificationProxy_ExportGenericPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ControllerAccountViewModelFactoryProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -21232,27 +20199,15 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func activateExport() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateExport()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func activateAdvancedSettings() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateAdvancedSettings()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func createViewModel(stashItem: M1, stashAccountItem: M2, chosenAccountItem: M3) -> Cuckoo.__DoNotUse<(StashItem, MetaChainAccountResponse?, MetaChainAccountResponse?), ControllerAccountViewModel> where M1.MatchedType == StashItem, M2.OptionalMatchedType == MetaChainAccountResponse, M3.OptionalMatchedType == MetaChainAccountResponse { + let matchers: [Cuckoo.ParameterMatcher<(StashItem, MetaChainAccountResponse?, MetaChainAccountResponse?)>] = [wrap(matchable: stashItem) { $0.0 }, wrap(matchable: stashAccountItem) { $0.1 }, wrap(matchable: chosenAccountItem) { $0.2 }] + return cuckoo_manager.verify("createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ExportGenericPresenterProtocolStub: ExportGenericPresenterProtocol { + class ControllerAccountViewModelFactoryProtocolStub: ControllerAccountViewModelFactoryProtocol { @@ -21260,39 +20215,27 @@ import SoraFoundation - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func activateExport() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func activateAdvancedSettings() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel { + return DefaultValueRegistry.defaultValue(for: (ControllerAccountViewModel).self) } } - class MockExportGenericWireframeProtocol: ExportGenericWireframeProtocol, Cuckoo.ProtocolMock { + class MockControllerAccountPresenterProtocol: ControllerAccountPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ExportGenericWireframeProtocol + typealias MocksType = ControllerAccountPresenterProtocol - typealias Stubbing = __StubbingProxy_ExportGenericWireframeProtocol - typealias Verification = __VerificationProxy_ExportGenericWireframeProtocol + typealias Stubbing = __StubbingProxy_ControllerAccountPresenterProtocol + typealias Verification = __VerificationProxy_ControllerAccountPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ExportGenericWireframeProtocol? + private var __defaultImplStub: ControllerAccountPresenterProtocol? - func enableDefaultImplementation(_ stub: ExportGenericWireframeProtocol) { + func enableDefaultImplementation(_ stub: ControllerAccountPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -21305,81 +20248,81 @@ import SoraFoundation - func close(view: ExportGenericViewProtocol?) { + func setup() { - return cuckoo_manager.call("close(view: ExportGenericViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(view: view)) + defaultCall: __defaultImplStub!.setup()) } - func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { + func handleStashAction() { - return cuckoo_manager.call("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", - parameters: (view, secretSource, settings), - escapingParameters: (view, secretSource, settings), + return cuckoo_manager.call("handleStashAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showAdvancedSettings(from: view, secretSource: secretSource, settings: settings)) + defaultCall: __defaultImplStub!.handleStashAction()) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func handleControllerAction() { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("handleControllerAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.handleControllerAction()) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func selectLearnMore() { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("selectLearnMore()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.selectLearnMore()) } - func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { + func proceed() { - return cuckoo_manager.call("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", - parameters: (source, view, completionHandler), - escapingParameters: (source, view, completionHandler), + return cuckoo_manager.call("proceed()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.share(source: source, from: view, with: completionHandler)) + defaultCall: __defaultImplStub!.proceed()) } - struct __StubbingProxy_ExportGenericWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ControllerAccountPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -21387,34 +20330,34 @@ import SoraFoundation } - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?)> where M1.OptionalMatchedType == ExportGenericViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "close(view: ExportGenericViewProtocol?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", parameterMatchers: matchers)) + func handleStashAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "handleStashAction()", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func handleControllerAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "handleControllerAction()", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func selectLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "selectLearnMore()", parameterMatchers: matchers)) } - func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { - let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportGenericWireframeProtocol.self, method: "share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", parameterMatchers: matchers)) + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } } - struct __VerificationProxy_ExportGenericWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ControllerAccountPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -21429,39 +20372,39 @@ import SoraFoundation @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: ExportGenericViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] - return cuckoo_manager.verify("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func handleStashAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("handleStashAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func handleControllerAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("handleControllerAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectLearnMore() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.__DoNotUse<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?), Void> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { - let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] - return cuckoo_manager.verify("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ExportGenericWireframeProtocolStub: ExportGenericWireframeProtocol { + class ControllerAccountPresenterProtocolStub: ControllerAccountPresenterProtocol { @@ -21469,56 +20412,51 @@ import SoraFoundation - func close(view: ExportGenericViewProtocol?) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { + func handleStashAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func handleControllerAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func selectLearnMore() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { + func proceed() { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import IrohaCrypto - - class MockExportMnemonicInteractorInputProtocol: ExportMnemonicInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockControllerAccountInteractorInputProtocol: ControllerAccountInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ExportMnemonicInteractorInputProtocol + typealias MocksType = ControllerAccountInteractorInputProtocol - typealias Stubbing = __StubbingProxy_ExportMnemonicInteractorInputProtocol - typealias Verification = __VerificationProxy_ExportMnemonicInteractorInputProtocol + typealias Stubbing = __StubbingProxy_ControllerAccountInteractorInputProtocol + typealias Verification = __VerificationProxy_ControllerAccountInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ExportMnemonicInteractorInputProtocol? + private var __defaultImplStub: ControllerAccountInteractorInputProtocol? - func enableDefaultImplementation(_ stub: ExportMnemonicInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: ControllerAccountInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -21531,129 +20469,66 @@ import IrohaCrypto - func fetchExportData() { + func setup() { - return cuckoo_manager.call("fetchExportData()", + return cuckoo_manager.call("setup()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.fetchExportData()) + defaultCall: __defaultImplStub!.setup()) } - - struct __StubbingProxy_ExportMnemonicInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func fetchExportData() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicInteractorInputProtocol.self, method: "fetchExportData()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ExportMnemonicInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func fetchExportData() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("fetchExportData()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ExportMnemonicInteractorInputProtocolStub: ExportMnemonicInteractorInputProtocol { - - - - - - - - func fetchExportData() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - - - class MockExportMnemonicInteractorOutputProtocol: ExportMnemonicInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ExportMnemonicInteractorOutputProtocol - - typealias Stubbing = __StubbingProxy_ExportMnemonicInteractorOutputProtocol - typealias Verification = __VerificationProxy_ExportMnemonicInteractorOutputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ExportMnemonicInteractorOutputProtocol? - - func enableDefaultImplementation(_ stub: ExportMnemonicInteractorOutputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func estimateFee(for account: ChainAccountResponse) { + + return cuckoo_manager.call("estimateFee(for: ChainAccountResponse)", + parameters: (account), + escapingParameters: (account), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.estimateFee(for: account)) + } - - - - - - - func didReceive(exportData: ExportMnemonicData) { + func fetchLedger(controllerAddress: AccountAddress) { - return cuckoo_manager.call("didReceive(exportData: ExportMnemonicData)", - parameters: (exportData), - escapingParameters: (exportData), + return cuckoo_manager.call("fetchLedger(controllerAddress: AccountAddress)", + parameters: (controllerAddress), + escapingParameters: (controllerAddress), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(exportData: exportData)) + defaultCall: __defaultImplStub!.fetchLedger(controllerAddress: controllerAddress)) } - func didReceive(error: Error) { + func fetchControllerAccountInfo(controllerAddress: AccountAddress) { - return cuckoo_manager.call("didReceive(error: Error)", - parameters: (error), - escapingParameters: (error), + return cuckoo_manager.call("fetchControllerAccountInfo(controllerAddress: AccountAddress)", + parameters: (controllerAddress), + escapingParameters: (controllerAddress), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(error: error)) + defaultCall: __defaultImplStub!.fetchControllerAccountInfo(controllerAddress: controllerAddress)) } - struct __StubbingProxy_ExportMnemonicInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ControllerAccountInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -21661,19 +20536,29 @@ import IrohaCrypto } - func didReceive(exportData: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportMnemonicData)> where M1.MatchedType == ExportMnemonicData { - let matchers: [Cuckoo.ParameterMatcher<(ExportMnemonicData)>] = [wrap(matchable: exportData) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicInteractorOutputProtocol.self, method: "didReceive(exportData: ExportMnemonicData)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func didReceive(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicInteractorOutputProtocol.self, method: "didReceive(error: Error)", parameterMatchers: matchers)) + func estimateFee(for account: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainAccountResponse)> where M1.MatchedType == ChainAccountResponse { + let matchers: [Cuckoo.ParameterMatcher<(ChainAccountResponse)>] = [wrap(matchable: account) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorInputProtocol.self, method: "estimateFee(for: ChainAccountResponse)", parameterMatchers: matchers)) + } + + func fetchLedger(controllerAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: controllerAddress) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorInputProtocol.self, method: "fetchLedger(controllerAddress: AccountAddress)", parameterMatchers: matchers)) + } + + func fetchControllerAccountInfo(controllerAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: controllerAddress) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorInputProtocol.self, method: "fetchControllerAccountInfo(controllerAddress: AccountAddress)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ExportMnemonicInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ControllerAccountInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -21688,21 +20573,33 @@ import IrohaCrypto @discardableResult - func didReceive(exportData: M1) -> Cuckoo.__DoNotUse<(ExportMnemonicData), Void> where M1.MatchedType == ExportMnemonicData { - let matchers: [Cuckoo.ParameterMatcher<(ExportMnemonicData)>] = [wrap(matchable: exportData) { $0 }] - return cuckoo_manager.verify("didReceive(exportData: ExportMnemonicData)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return cuckoo_manager.verify("didReceive(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee(for account: M1) -> Cuckoo.__DoNotUse<(ChainAccountResponse), Void> where M1.MatchedType == ChainAccountResponse { + let matchers: [Cuckoo.ParameterMatcher<(ChainAccountResponse)>] = [wrap(matchable: account) { $0 }] + return cuckoo_manager.verify("estimateFee(for: ChainAccountResponse)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func fetchLedger(controllerAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: controllerAddress) { $0 }] + return cuckoo_manager.verify("fetchLedger(controllerAddress: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func fetchControllerAccountInfo(controllerAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: controllerAddress) { $0 }] + return cuckoo_manager.verify("fetchControllerAccountInfo(controllerAddress: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ExportMnemonicInteractorOutputProtocolStub: ExportMnemonicInteractorOutputProtocol { + class ControllerAccountInteractorInputProtocolStub: ControllerAccountInteractorInputProtocol { @@ -21710,13 +20607,25 @@ import IrohaCrypto - func didReceive(exportData: ExportMnemonicData) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(error: Error) { + func estimateFee(for account: ChainAccountResponse) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func fetchLedger(controllerAddress: AccountAddress) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func fetchControllerAccountInfo(controllerAddress: AccountAddress) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -21724,19 +20633,19 @@ import IrohaCrypto - class MockExportMnemonicWireframeProtocol: ExportMnemonicWireframeProtocol, Cuckoo.ProtocolMock { + class MockControllerAccountInteractorOutputProtocol: ControllerAccountInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ExportMnemonicWireframeProtocol + typealias MocksType = ControllerAccountInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_ExportMnemonicWireframeProtocol - typealias Verification = __VerificationProxy_ExportMnemonicWireframeProtocol + typealias Stubbing = __StubbingProxy_ControllerAccountInteractorOutputProtocol + typealias Verification = __VerificationProxy_ControllerAccountInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ExportMnemonicWireframeProtocol? + private var __defaultImplStub: ControllerAccountInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: ExportMnemonicWireframeProtocol) { + func enableDefaultImplementation(_ stub: ControllerAccountInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -21749,96 +20658,126 @@ import IrohaCrypto - func openConfirmationForMnemonic(_ mnemonic: IRMnemonicProtocol, from view: ExportGenericViewProtocol?) { + func didReceiveStashItem(result: Result) { - return cuckoo_manager.call("openConfirmationForMnemonic(_: IRMnemonicProtocol, from: ExportGenericViewProtocol?)", - parameters: (mnemonic, view), - escapingParameters: (mnemonic, view), + return cuckoo_manager.call("didReceiveStashItem(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.openConfirmationForMnemonic(mnemonic, from: view)) + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) } - func close(view: ExportGenericViewProtocol?) { + func didReceiveStashAccount(result: Result) { - return cuckoo_manager.call("close(view: ExportGenericViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceiveStashAccount(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(view: view)) + defaultCall: __defaultImplStub!.didReceiveStashAccount(result: result)) } - func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { + func didReceiveControllerAccount(result: Result) { - return cuckoo_manager.call("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", - parameters: (view, secretSource, settings), - escapingParameters: (view, secretSource, settings), + return cuckoo_manager.call("didReceiveControllerAccount(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showAdvancedSettings(from: view, secretSource: secretSource, settings: settings)) + defaultCall: __defaultImplStub!.didReceiveControllerAccount(result: result)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.didReceiveAccounts(result: result)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { + func didReceiveControllerAccountInfo(result: Result, address: AccountAddress) { - return cuckoo_manager.call("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", - parameters: (source, view, completionHandler), - escapingParameters: (source, view, completionHandler), + return cuckoo_manager.call("didReceiveControllerAccountInfo(result: Result, address: AccountAddress)", + parameters: (result, address), + escapingParameters: (result, address), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.share(source: source, from: view, with: completionHandler)) + defaultCall: __defaultImplStub!.didReceiveControllerAccountInfo(result: result, address: address)) + + } + + + + func didReceiveAccountInfo(result: Result, address: AccountAddress) { + + return cuckoo_manager.call("didReceiveAccountInfo(result: Result, address: AccountAddress)", + parameters: (result, address), + escapingParameters: (result, address), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result, address: address)) + + } + + + + func didReceiveStakingLedger(result: Result) { + + return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) } - struct __StubbingProxy_ExportMnemonicWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ControllerAccountInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -21846,39 +20785,49 @@ import IrohaCrypto } - func openConfirmationForMnemonic(_ mnemonic: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(IRMnemonicProtocol, ExportGenericViewProtocol?)> where M1.MatchedType == IRMnemonicProtocol, M2.OptionalMatchedType == ExportGenericViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(IRMnemonicProtocol, ExportGenericViewProtocol?)>] = [wrap(matchable: mnemonic) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "openConfirmationForMnemonic(_: IRMnemonicProtocol, from: ExportGenericViewProtocol?)", parameterMatchers: matchers)) + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) } - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?)> where M1.OptionalMatchedType == ExportGenericViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "close(view: ExportGenericViewProtocol?)", parameterMatchers: matchers)) + func didReceiveStashAccount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveStashAccount(result: Result)", parameterMatchers: matchers)) } - func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", parameterMatchers: matchers)) + func didReceiveControllerAccount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveControllerAccount(result: Result)", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveAccounts(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[MetaChainAccountResponse], Error>)> where M1.MatchedType == Result<[MetaChainAccountResponse], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[MetaChainAccountResponse], Error>)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { - let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportMnemonicWireframeProtocol.self, method: "share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", parameterMatchers: matchers)) + func didReceiveControllerAccountInfo(result: M1, address: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Result, AccountAddress)> where M1.MatchedType == Result, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(Result, AccountAddress)>] = [wrap(matchable: result) { $0.0 }, wrap(matchable: address) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveControllerAccountInfo(result: Result, address: AccountAddress)", parameterMatchers: matchers)) + } + + func didReceiveAccountInfo(result: M1, address: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Result, AccountAddress)> where M1.MatchedType == Result, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(Result, AccountAddress)>] = [wrap(matchable: result) { $0.0 }, wrap(matchable: address) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result, address: AccountAddress)", parameterMatchers: matchers)) + } + + func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ExportMnemonicWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ControllerAccountInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -21893,45 +20842,57 @@ import IrohaCrypto @discardableResult - func openConfirmationForMnemonic(_ mnemonic: M1, from view: M2) -> Cuckoo.__DoNotUse<(IRMnemonicProtocol, ExportGenericViewProtocol?), Void> where M1.MatchedType == IRMnemonicProtocol, M2.OptionalMatchedType == ExportGenericViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(IRMnemonicProtocol, ExportGenericViewProtocol?)>] = [wrap(matchable: mnemonic) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("openConfirmationForMnemonic(_: IRMnemonicProtocol, from: ExportGenericViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: ExportGenericViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStashAccount(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashAccount(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] - return cuckoo_manager.verify("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveControllerAccount(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveControllerAccount(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccounts(result: M1) -> Cuckoo.__DoNotUse<(Result<[MetaChainAccountResponse], Error>), Void> where M1.MatchedType == Result<[MetaChainAccountResponse], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[MetaChainAccountResponse], Error>)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.__DoNotUse<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?), Void> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { - let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] - return cuckoo_manager.verify("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveControllerAccountInfo(result: M1, address: M2) -> Cuckoo.__DoNotUse<(Result, AccountAddress), Void> where M1.MatchedType == Result, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(Result, AccountAddress)>] = [wrap(matchable: result) { $0.0 }, wrap(matchable: address) { $0.1 }] + return cuckoo_manager.verify("didReceiveControllerAccountInfo(result: Result, address: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveAccountInfo(result: M1, address: M2) -> Cuckoo.__DoNotUse<(Result, AccountAddress), Void> where M1.MatchedType == Result, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(Result, AccountAddress)>] = [wrap(matchable: result) { $0.0 }, wrap(matchable: address) { $0.1 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result, address: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ExportMnemonicWireframeProtocolStub: ExportMnemonicWireframeProtocol { + class ControllerAccountInteractorOutputProtocolStub: ControllerAccountInteractorOutputProtocol { @@ -21939,62 +20900,69 @@ import IrohaCrypto - func openConfirmationForMnemonic(_ mnemonic: IRMnemonicProtocol, from view: ExportGenericViewProtocol?) { + func didReceiveStashItem(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func close(view: ExportGenericViewProtocol?) { + func didReceiveStashAccount(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { + func didReceiveControllerAccount(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { + func didReceiveControllerAccountInfo(result: Result, address: AccountAddress) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveAccountInfo(result: Result, address: AccountAddress) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveStakingLedger(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import Foundation - - class MockExportRestoreJsonWireframeProtocol: ExportRestoreJsonWireframeProtocol, Cuckoo.ProtocolMock { + class MockControllerAccountWireframeProtocol: ControllerAccountWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ExportRestoreJsonWireframeProtocol + typealias MocksType = ControllerAccountWireframeProtocol - typealias Stubbing = __StubbingProxy_ExportRestoreJsonWireframeProtocol - typealias Verification = __VerificationProxy_ExportRestoreJsonWireframeProtocol + typealias Stubbing = __StubbingProxy_ControllerAccountWireframeProtocol + typealias Verification = __VerificationProxy_ControllerAccountWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ExportRestoreJsonWireframeProtocol? + private var __defaultImplStub: ControllerAccountWireframeProtocol? - func enableDefaultImplementation(_ stub: ExportRestoreJsonWireframeProtocol) { + func enableDefaultImplementation(_ stub: ControllerAccountWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -22007,9 +20975,24 @@ import Foundation - func close(view: ExportGenericViewProtocol?) { + func showConfirmation(from view: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse) { - return cuckoo_manager.call("close(view: ExportGenericViewProtocol?)", + return cuckoo_manager.call("showConfirmation(from: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse)", + parameters: (view, controllerAccountItem), + escapingParameters: (view, controllerAccountItem), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showConfirmation(from: view, controllerAccountItem: controllerAccountItem)) + + } + + + + func close(view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("close(view: ControllerBackedProtocol?)", parameters: (view), escapingParameters: (view), superclassCall: @@ -22022,66 +21005,66 @@ import Foundation - func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return cuckoo_manager.call("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", - parameters: (view, secretSource, settings), - escapingParameters: (view, secretSource, settings), + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showAdvancedSettings(from: view, secretSource: secretSource, settings: settings)) + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func presentAccountSelection(_ accounts: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from view: ControllerBackedProtocol?, context: AnyObject?) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", + parameters: (accounts, selectedAccountItem, title, delegate, view, context), + escapingParameters: (accounts, selectedAccountItem, title, delegate, view, context), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.presentAccountSelection(accounts, selectedAccountItem: selectedAccountItem, title: title, delegate: delegate, from: view, context: context)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", - parameters: (source, view, completionHandler), - escapingParameters: (source, view, completionHandler), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.share(source: source, from: view, with: completionHandler)) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_ExportRestoreJsonWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ControllerAccountWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -22089,34 +21072,39 @@ import Foundation } - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?)> where M1.OptionalMatchedType == ExportGenericViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "close(view: ExportGenericViewProtocol?)", parameterMatchers: matchers)) + func showConfirmation(from view: M1, controllerAccountItem: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, MetaChainAccountResponse)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaChainAccountResponse { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaChainAccountResponse)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: controllerAccountItem) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "showConfirmation(from: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse)", parameterMatchers: matchers)) } - func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", parameterMatchers: matchers)) + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "close(view: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + } + + func presentAccountSelection(_ accounts: M1, selectedAccountItem: M2, title: M3, delegate: M4, from view: M5, context: M6) -> Cuckoo.ProtocolStubNoReturnFunction<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)> where M1.MatchedType == [MetaChainAccountResponse], M2.OptionalMatchedType == MetaChainAccountResponse, M3.MatchedType == LocalizableResource, M4.MatchedType == ModalPickerViewControllerDelegate, M5.OptionalMatchedType == ControllerBackedProtocol, M6.OptionalMatchedType == AnyObject { + let matchers: [Cuckoo.ParameterMatcher<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)>] = [wrap(matchable: accounts) { $0.0 }, wrap(matchable: selectedAccountItem) { $0.1 }, wrap(matchable: title) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: view) { $0.4 }, wrap(matchable: context) { $0.5 }] + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { - let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockExportRestoreJsonWireframeProtocol.self, method: "share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ExportRestoreJsonWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ControllerAccountWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -22131,15 +21119,27 @@ import Foundation @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: ExportGenericViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showConfirmation(from view: M1, controllerAccountItem: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, MetaChainAccountResponse), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaChainAccountResponse { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaChainAccountResponse)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: controllerAccountItem) { $0.1 }] + return cuckoo_manager.verify("showConfirmation(from: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showAdvancedSettings(from view: M1, secretSource: M2, settings: M3) -> Cuckoo.__DoNotUse<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings), Void> where M1.OptionalMatchedType == ExportGenericViewProtocol, M2.MatchedType == SecretSource, M3.MatchedType == AdvancedWalletSettings { - let matchers: [Cuckoo.ParameterMatcher<(ExportGenericViewProtocol?, SecretSource, AdvancedWalletSettings)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: secretSource) { $0.1 }, wrap(matchable: settings) { $0.2 }] - return cuckoo_manager.verify("showAdvancedSettings(from: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close(view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentAccountSelection(_ accounts: M1, selectedAccountItem: M2, title: M3, delegate: M4, from view: M5, context: M6) -> Cuckoo.__DoNotUse<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?), Void> where M1.MatchedType == [MetaChainAccountResponse], M2.OptionalMatchedType == MetaChainAccountResponse, M3.MatchedType == LocalizableResource, M4.MatchedType == ModalPickerViewControllerDelegate, M5.OptionalMatchedType == ControllerBackedProtocol, M6.OptionalMatchedType == AnyObject { + let matchers: [Cuckoo.ParameterMatcher<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)>] = [wrap(matchable: accounts) { $0.0 }, wrap(matchable: selectedAccountItem) { $0.1 }, wrap(matchable: title) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: view) { $0.4 }, wrap(matchable: context) { $0.5 }] + return cuckoo_manager.verify("presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -22154,16 +21154,10 @@ import Foundation return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - @discardableResult - func share(source: M1, from view: M2, with completionHandler: M3) -> Cuckoo.__DoNotUse<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?), Void> where M1.MatchedType == UIActivityItemSource, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == SharingCompletionHandler { - let matchers: [Cuckoo.ParameterMatcher<(UIActivityItemSource, ControllerBackedProtocol?, SharingCompletionHandler?)>] = [wrap(matchable: source) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: completionHandler) { $0.2 }] - return cuckoo_manager.verify("share(source: UIActivityItemSource, from: ControllerBackedProtocol?, with: SharingCompletionHandler?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - } } - class ExportRestoreJsonWireframeProtocolStub: ExportRestoreJsonWireframeProtocol { + class ControllerAccountWireframeProtocolStub: ControllerAccountWireframeProtocol { @@ -22171,31 +21165,37 @@ import Foundation - func close(view: ExportGenericViewProtocol?) { + func showConfirmation(from view: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showAdvancedSettings(from view: ExportGenericViewProtocol?, secretSource: SecretSource, settings: AdvancedWalletSettings) { + func close(view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func presentAccountSelection(_ accounts: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from view: ControllerBackedProtocol?, context: AnyObject?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func share(source: UIActivityItemSource, from view: ControllerBackedProtocol?, with completionHandler: SharingCompletionHandler?) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -22205,62 +21205,51 @@ import Foundation import Cuckoo @testable import novawallet +import BigInt import Foundation +import RobinHood - class MockOnboardingMainViewProtocol: OnboardingMainViewProtocol, Cuckoo.ProtocolMock { + class MockNetworkStakingInfoOperationFactoryProtocol: NetworkStakingInfoOperationFactoryProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OnboardingMainViewProtocol + typealias MocksType = NetworkStakingInfoOperationFactoryProtocol - typealias Stubbing = __StubbingProxy_OnboardingMainViewProtocol - typealias Verification = __VerificationProxy_OnboardingMainViewProtocol + typealias Stubbing = __StubbingProxy_NetworkStakingInfoOperationFactoryProtocol + typealias Verification = __VerificationProxy_NetworkStakingInfoOperationFactoryProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OnboardingMainViewProtocol? + private var __defaultImplStub: NetworkStakingInfoOperationFactoryProtocol? - func enableDefaultImplementation(_ stub: OnboardingMainViewProtocol) { + func enableDefaultImplementation(_ stub: NetworkStakingInfoOperationFactoryProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } + - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func networkStakingOperation(for eraValidatorService: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper { + + return cuckoo_manager.call("networkStakingOperation(for: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper", + parameters: (eraValidatorService, runtimeService), + escapingParameters: (eraValidatorService, runtimeService), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.networkStakingOperation(for: eraValidatorService, runtimeService: runtimeService)) } - - - - - struct __StubbingProxy_OnboardingMainViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_NetworkStakingInfoOperationFactoryProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -22268,19 +21257,14 @@ import Foundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func networkStakingOperation(for eraValidatorService: M1, runtimeService: M2) -> Cuckoo.ProtocolStubFunction<(EraValidatorServiceProtocol, RuntimeCodingServiceProtocol), CompoundOperationWrapper> where M1.MatchedType == EraValidatorServiceProtocol, M2.MatchedType == RuntimeCodingServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(EraValidatorServiceProtocol, RuntimeCodingServiceProtocol)>] = [wrap(matchable: eraValidatorService) { $0.0 }, wrap(matchable: runtimeService) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockNetworkStakingInfoOperationFactoryProtocol.self, method: "networkStakingOperation(for: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper", parameterMatchers: matchers)) } - } - struct __VerificationProxy_OnboardingMainViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_NetworkStakingInfoOperationFactoryProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -22292,62 +21276,52 @@ import Foundation } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func networkStakingOperation(for eraValidatorService: M1, runtimeService: M2) -> Cuckoo.__DoNotUse<(EraValidatorServiceProtocol, RuntimeCodingServiceProtocol), CompoundOperationWrapper> where M1.MatchedType == EraValidatorServiceProtocol, M2.MatchedType == RuntimeCodingServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(EraValidatorServiceProtocol, RuntimeCodingServiceProtocol)>] = [wrap(matchable: eraValidatorService) { $0.0 }, wrap(matchable: runtimeService) { $0.1 }] + return cuckoo_manager.verify("networkStakingOperation(for: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - } } - class OnboardingMainViewProtocolStub: OnboardingMainViewProtocol { - + class NetworkStakingInfoOperationFactoryProtocolStub: NetworkStakingInfoOperationFactoryProtocol { + - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - + - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - + + func networkStakingOperation(for eraValidatorService: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper { + return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper).self) } +} - - -} +import Cuckoo +@testable import novawallet +import Foundation +import RobinHood - class MockOnboardingMainPresenterProtocol: OnboardingMainPresenterProtocol, Cuckoo.ProtocolMock { + class MockValidatorOperationFactoryProtocol: ValidatorOperationFactoryProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OnboardingMainPresenterProtocol + typealias MocksType = ValidatorOperationFactoryProtocol - typealias Stubbing = __StubbingProxy_OnboardingMainPresenterProtocol - typealias Verification = __VerificationProxy_OnboardingMainPresenterProtocol + typealias Stubbing = __StubbingProxy_ValidatorOperationFactoryProtocol + typealias Verification = __VerificationProxy_ValidatorOperationFactoryProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OnboardingMainPresenterProtocol? + private var __defaultImplStub: ValidatorOperationFactoryProtocol? - func enableDefaultImplementation(_ stub: OnboardingMainPresenterProtocol) { + func enableDefaultImplementation(_ stub: ValidatorOperationFactoryProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -22360,111 +21334,81 @@ import Foundation - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func activateSignup() { - - return cuckoo_manager.call("activateSignup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.activateSignup()) - - } - - - - func activateAccountRestore() { + func allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]> { - return cuckoo_manager.call("activateAccountRestore()", + return cuckoo_manager.call("allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]>", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateAccountRestore()) + defaultCall: __defaultImplStub!.allElectedOperation()) } - func activateWatchOnlyCreate() { + func allSelectedOperation(by nomination: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { - return cuckoo_manager.call("activateWatchOnlyCreate()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("allSelectedOperation(by: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", + parameters: (nomination, nominatorAddress), + escapingParameters: (nomination, nominatorAddress), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateWatchOnlyCreate()) + defaultCall: __defaultImplStub!.allSelectedOperation(by: nomination, nominatorAddress: nominatorAddress)) } - func activateHardwareWalletCreate() { + func activeValidatorsOperation(for nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { - return cuckoo_manager.call("activateHardwareWalletCreate()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("activeValidatorsOperation(for: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", + parameters: (nominatorAddress), + escapingParameters: (nominatorAddress), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateHardwareWalletCreate()) + defaultCall: __defaultImplStub!.activeValidatorsOperation(for: nominatorAddress)) } - func activateTerms() { + func pendingValidatorsOperation(for accountIds: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { - return cuckoo_manager.call("activateTerms()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("pendingValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", + parameters: (accountIds), + escapingParameters: (accountIds), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateTerms()) + defaultCall: __defaultImplStub!.pendingValidatorsOperation(for: accountIds)) } - func activatePrivacy() { + func wannabeValidatorsOperation(for accountIdList: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { - return cuckoo_manager.call("activatePrivacy()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("wannabeValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", + parameters: (accountIdList), + escapingParameters: (accountIdList), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activatePrivacy()) + defaultCall: __defaultImplStub!.wannabeValidatorsOperation(for: accountIdList)) } - struct __StubbingProxy_OnboardingMainPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorOperationFactoryProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -22472,44 +21416,34 @@ import Foundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func activateSignup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateSignup()", parameterMatchers: matchers)) - } - - func activateAccountRestore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func allElectedOperation() -> Cuckoo.ProtocolStubFunction<(), CompoundOperationWrapper<[ElectedValidatorInfo]>> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateAccountRestore()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]>", parameterMatchers: matchers)) } - func activateWatchOnlyCreate() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateWatchOnlyCreate()", parameterMatchers: matchers)) + func allSelectedOperation(by nomination: M1, nominatorAddress: M2) -> Cuckoo.ProtocolStubFunction<(Nomination, AccountAddress), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == Nomination, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(Nomination, AccountAddress)>] = [wrap(matchable: nomination) { $0.0 }, wrap(matchable: nominatorAddress) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "allSelectedOperation(by: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", parameterMatchers: matchers)) } - func activateHardwareWalletCreate() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateHardwareWalletCreate()", parameterMatchers: matchers)) + func activeValidatorsOperation(for nominatorAddress: M1) -> Cuckoo.ProtocolStubFunction<(AccountAddress), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: nominatorAddress) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "activeValidatorsOperation(for: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", parameterMatchers: matchers)) } - func activateTerms() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activateTerms()", parameterMatchers: matchers)) + func pendingValidatorsOperation(for accountIds: M1) -> Cuckoo.ProtocolStubFunction<([AccountId]), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == [AccountId] { + let matchers: [Cuckoo.ParameterMatcher<([AccountId])>] = [wrap(matchable: accountIds) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "pendingValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", parameterMatchers: matchers)) } - func activatePrivacy() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainPresenterProtocol.self, method: "activatePrivacy()", parameterMatchers: matchers)) + func wannabeValidatorsOperation(for accountIdList: M1) -> Cuckoo.ProtocolStubFunction<([AccountId]), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == [AccountId] { + let matchers: [Cuckoo.ParameterMatcher<([AccountId])>] = [wrap(matchable: accountIdList) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "wannabeValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", parameterMatchers: matchers)) } } - struct __VerificationProxy_OnboardingMainPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorOperationFactoryProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -22524,51 +21458,39 @@ import Foundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func activateSignup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateSignup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func activateAccountRestore() -> Cuckoo.__DoNotUse<(), Void> { + func allElectedOperation() -> Cuckoo.__DoNotUse<(), CompoundOperationWrapper<[ElectedValidatorInfo]>> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateAccountRestore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func activateWatchOnlyCreate() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateWatchOnlyCreate()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func allSelectedOperation(by nomination: M1, nominatorAddress: M2) -> Cuckoo.__DoNotUse<(Nomination, AccountAddress), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == Nomination, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(Nomination, AccountAddress)>] = [wrap(matchable: nomination) { $0.0 }, wrap(matchable: nominatorAddress) { $0.1 }] + return cuckoo_manager.verify("allSelectedOperation(by: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func activateHardwareWalletCreate() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateHardwareWalletCreate()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func activeValidatorsOperation(for nominatorAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: nominatorAddress) { $0 }] + return cuckoo_manager.verify("activeValidatorsOperation(for: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func activateTerms() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateTerms()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func pendingValidatorsOperation(for accountIds: M1) -> Cuckoo.__DoNotUse<([AccountId]), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == [AccountId] { + let matchers: [Cuckoo.ParameterMatcher<([AccountId])>] = [wrap(matchable: accountIds) { $0 }] + return cuckoo_manager.verify("pendingValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func activatePrivacy() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activatePrivacy()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func wannabeValidatorsOperation(for accountIdList: M1) -> Cuckoo.__DoNotUse<([AccountId]), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == [AccountId] { + let matchers: [Cuckoo.ParameterMatcher<([AccountId])>] = [wrap(matchable: accountIdList) { $0 }] + return cuckoo_manager.verify("wannabeValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class OnboardingMainPresenterProtocolStub: OnboardingMainPresenterProtocol { + class ValidatorOperationFactoryProtocolStub: ValidatorOperationFactoryProtocol { @@ -22576,210 +21498,165 @@ import Foundation - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func activateSignup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func activateAccountRestore() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]> { + return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[ElectedValidatorInfo]>).self) } - func activateWatchOnlyCreate() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func allSelectedOperation(by nomination: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { + return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[SelectedValidatorInfo]>).self) } - func activateHardwareWalletCreate() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func activeValidatorsOperation(for nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { + return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[SelectedValidatorInfo]>).self) } - func activateTerms() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func pendingValidatorsOperation(for accountIds: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { + return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[SelectedValidatorInfo]>).self) } - func activatePrivacy() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func wannabeValidatorsOperation(for accountIdList: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { + return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[SelectedValidatorInfo]>).self) } } +import Cuckoo +@testable import novawallet + +import SoraFoundation + - class MockOnboardingMainWireframeProtocol: OnboardingMainWireframeProtocol, Cuckoo.ProtocolMock { + class MockCustomValidatorListViewProtocol: CustomValidatorListViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OnboardingMainWireframeProtocol + typealias MocksType = CustomValidatorListViewProtocol - typealias Stubbing = __StubbingProxy_OnboardingMainWireframeProtocol - typealias Verification = __VerificationProxy_OnboardingMainWireframeProtocol + typealias Stubbing = __StubbingProxy_CustomValidatorListViewProtocol + typealias Verification = __VerificationProxy_CustomValidatorListViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OnboardingMainWireframeProtocol? + private var __defaultImplStub: CustomValidatorListViewProtocol? - func enableDefaultImplementation(_ stub: OnboardingMainWireframeProtocol) { + func enableDefaultImplementation(_ stub: CustomValidatorListViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - - - - - func showSignup(from view: OnboardingMainViewProtocol?) { - - return cuckoo_manager.call("showSignup(from: OnboardingMainViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showSignup(from: view)) - - } - - func showAccountRestore(from view: OnboardingMainViewProtocol?) { - - return cuckoo_manager.call("showAccountRestore(from: OnboardingMainViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showAccountRestore(from: view)) + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } - func showKeystoreImport(from view: OnboardingMainViewProtocol?) { - - return cuckoo_manager.call("showKeystoreImport(from: OnboardingMainViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showKeystoreImport(from: view)) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } - func showWatchOnlyCreate(from view: OnboardingMainViewProtocol?) { + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } - return cuckoo_manager.call("showWatchOnlyCreate(from: OnboardingMainViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showWatchOnlyCreate(from: view)) + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } } + - - func showParitySignerWalletCreation(from view: OnboardingMainViewProtocol?) { - - return cuckoo_manager.call("showParitySignerWalletCreation(from: OnboardingMainViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showParitySignerWalletCreation(from: view)) - - } + - func showLedgerWalletCreation(from view: OnboardingMainViewProtocol?) { + func reload(_ viewModel: CustomValidatorListViewModel, at indexes: [Int]?) { - return cuckoo_manager.call("showLedgerWalletCreation(from: OnboardingMainViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("reload(_: CustomValidatorListViewModel, at: [Int]?)", + parameters: (viewModel, indexes), + escapingParameters: (viewModel, indexes), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showLedgerWalletCreation(from: view)) + defaultCall: __defaultImplStub!.reload(viewModel, at: indexes)) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func setFilterAppliedState(to state: Bool) { - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), + return cuckoo_manager.call("setFilterAppliedState(to: Bool)", + parameters: (state), + escapingParameters: (state), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + defaultCall: __defaultImplStub!.setFilterAppliedState(to: state)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + public func applyLocalization() { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) - - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_OnboardingMainWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CustomValidatorListViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -22787,54 +21664,39 @@ import Foundation } - func showSignup(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showSignup(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func showAccountRestore(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showAccountRestore(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) - } - func showKeystoreImport(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showKeystoreImport(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func showWatchOnlyCreate(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showWatchOnlyCreate(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) - } - func showParitySignerWalletCreation(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showParitySignerWalletCreation(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - func showLedgerWalletCreation(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OnboardingMainViewProtocol?)> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showLedgerWalletCreation(from: OnboardingMainViewProtocol?)", parameterMatchers: matchers)) - } - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + func reload(_ viewModel: M1, at indexes: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(CustomValidatorListViewModel, [Int]?)> where M1.MatchedType == CustomValidatorListViewModel, M2.OptionalMatchedType == [Int] { + let matchers: [Cuckoo.ParameterMatcher<(CustomValidatorListViewModel, [Int]?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: indexes) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListViewProtocol.self, method: "reload(_: CustomValidatorListViewModel, at: [Int]?)", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func setFilterAppliedState(to state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: state) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListViewProtocol.self, method: "setFilterAppliedState(to: Bool)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_OnboardingMainWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CustomValidatorListViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -22846,66 +21708,74 @@ import Foundation } - - @discardableResult - func showSignup(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showSignup(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func showAccountRestore(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showAccountRestore(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func showKeystoreImport(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showKeystoreImport(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func showWatchOnlyCreate(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showWatchOnlyCreate(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func showParitySignerWalletCreation(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showParitySignerWalletCreation(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func showLedgerWalletCreation(from view: M1) -> Cuckoo.__DoNotUse<(OnboardingMainViewProtocol?), Void> where M1.OptionalMatchedType == OnboardingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(OnboardingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showLedgerWalletCreation(from: OnboardingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } + @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload(_ viewModel: M1, at indexes: M2) -> Cuckoo.__DoNotUse<(CustomValidatorListViewModel, [Int]?), Void> where M1.MatchedType == CustomValidatorListViewModel, M2.OptionalMatchedType == [Int] { + let matchers: [Cuckoo.ParameterMatcher<(CustomValidatorListViewModel, [Int]?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: indexes) { $0.1 }] + return cuckoo_manager.verify("reload(_: CustomValidatorListViewModel, at: [Int]?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setFilterAppliedState(to state: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: state) { $0 }] + return cuckoo_manager.verify("setFilterAppliedState(to: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class OnboardingMainWireframeProtocolStub: OnboardingMainWireframeProtocol { + class CustomValidatorListViewProtocolStub: CustomValidatorListViewProtocol { + + + + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } @@ -22913,102 +21783,201 @@ import Foundation - func showSignup(from view: OnboardingMainViewProtocol?) { + func reload(_ viewModel: CustomValidatorListViewModel, at indexes: [Int]?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showAccountRestore(from view: OnboardingMainViewProtocol?) { + func setFilterAppliedState(to state: Bool) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showKeystoreImport(from view: OnboardingMainViewProtocol?) { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockCustomValidatorListPresenterProtocol: CustomValidatorListPresenterProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = CustomValidatorListPresenterProtocol + typealias Stubbing = __StubbingProxy_CustomValidatorListPresenterProtocol + typealias Verification = __VerificationProxy_CustomValidatorListPresenterProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func showWatchOnlyCreate(from view: OnboardingMainViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + private var __defaultImplStub: CustomValidatorListPresenterProtocol? + + func enableDefaultImplementation(_ stub: CustomValidatorListPresenterProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func showParitySignerWalletCreation(from view: OnboardingMainViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + + + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) + } - func showLedgerWalletCreation(from view: OnboardingMainViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func fillWithRecommended() { + + return cuckoo_manager.call("fillWithRecommended()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.fillWithRecommended()) + } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func clearFilter() { + + return cuckoo_manager.call("clearFilter()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.clearFilter()) + } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func deselectAll() { + + return cuckoo_manager.call("deselectAll()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.deselectAll()) + } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func changeValidatorSelection(at index: Int) { + + return cuckoo_manager.call("changeValidatorSelection(at: Int)", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.changeValidatorSelection(at: index)) + } -} - - - - class MockOnboardingMainInteractorInputProtocol: OnboardingMainInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OnboardingMainInteractorInputProtocol - typealias Stubbing = __StubbingProxy_OnboardingMainInteractorInputProtocol - typealias Verification = __VerificationProxy_OnboardingMainInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - + func didSelectValidator(at index: Int) { + + return cuckoo_manager.call("didSelectValidator(at: Int)", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didSelectValidator(at: index)) + + } - private var __defaultImplStub: OnboardingMainInteractorInputProtocol? - - func enableDefaultImplementation(_ stub: OnboardingMainInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + + + func presentFilter() { + + return cuckoo_manager.call("presentFilter()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentFilter()) + } - - - + func presentSearch() { + + return cuckoo_manager.call("presentSearch()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentSearch()) + + } - func setup() { + func proceed() { - return cuckoo_manager.call("setup()", + return cuckoo_manager.call("proceed()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.proceed()) + + } + + + + func didRemove(_ validator: SelectedValidatorInfo) { + + return cuckoo_manager.call("didRemove(_: SelectedValidatorInfo)", + parameters: (validator), + escapingParameters: (validator), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didRemove(validator)) } - struct __StubbingProxy_OnboardingMainInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CustomValidatorListPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -23018,12 +21987,57 @@ import Foundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func fillWithRecommended() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "fillWithRecommended()", parameterMatchers: matchers)) + } + + func clearFilter() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "clearFilter()", parameterMatchers: matchers)) + } + + func deselectAll() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "deselectAll()", parameterMatchers: matchers)) + } + + func changeValidatorSelection(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "changeValidatorSelection(at: Int)", parameterMatchers: matchers)) + } + + func didSelectValidator(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "didSelectValidator(at: Int)", parameterMatchers: matchers)) + } + + func presentFilter() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "presentFilter()", parameterMatchers: matchers)) + } + + func presentSearch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "presentSearch()", parameterMatchers: matchers)) + } + + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + } + + func didRemove(_ validator: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorInfo)> where M1.MatchedType == SelectedValidatorInfo { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo)>] = [wrap(matchable: validator) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "didRemove(_: SelectedValidatorInfo)", parameterMatchers: matchers)) } } - struct __VerificationProxy_OnboardingMainInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CustomValidatorListPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -23043,10 +22057,64 @@ import Foundation return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func fillWithRecommended() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("fillWithRecommended()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func clearFilter() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("clearFilter()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func deselectAll() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("deselectAll()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func changeValidatorSelection(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("changeValidatorSelection(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didSelectValidator(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("didSelectValidator(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentFilter() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentFilter()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentSearch() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentSearch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didRemove(_ validator: M1) -> Cuckoo.__DoNotUse<(SelectedValidatorInfo), Void> where M1.MatchedType == SelectedValidatorInfo { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo)>] = [wrap(matchable: validator) { $0 }] + return cuckoo_manager.verify("didRemove(_: SelectedValidatorInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class OnboardingMainInteractorInputProtocolStub: OnboardingMainInteractorInputProtocol { + class CustomValidatorListPresenterProtocolStub: CustomValidatorListPresenterProtocol { @@ -23058,23 +22126,77 @@ import Foundation return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func fillWithRecommended() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func clearFilter() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func deselectAll() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func changeValidatorSelection(at index: Int) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didSelectValidator(at index: Int) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentFilter() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentSearch() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func proceed() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didRemove(_ validator: SelectedValidatorInfo) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } - class MockOnboardingMainInteractorOutputProtocol: OnboardingMainInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockCustomValidatorListViewModelFactoryProtocol: CustomValidatorListViewModelFactoryProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OnboardingMainInteractorOutputProtocol + typealias MocksType = CustomValidatorListViewModelFactoryProtocol - typealias Stubbing = __StubbingProxy_OnboardingMainInteractorOutputProtocol - typealias Verification = __VerificationProxy_OnboardingMainInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_CustomValidatorListViewModelFactoryProtocol + typealias Verification = __VerificationProxy_CustomValidatorListViewModelFactoryProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OnboardingMainInteractorOutputProtocol? + private var __defaultImplStub: CustomValidatorListViewModelFactoryProtocol? - func enableDefaultImplementation(_ stub: OnboardingMainInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: CustomValidatorListViewModelFactoryProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -23087,21 +22209,21 @@ import Foundation - func didSuggestKeystoreImport() { + func createViewModel(from validatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel { - return cuckoo_manager.call("didSuggestKeystoreImport()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel", + parameters: (validatorList, selectedValidatorList, totalValidatorsCount, filter, priceData, locale), + escapingParameters: (validatorList, selectedValidatorList, totalValidatorsCount, filter, priceData, locale), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSuggestKeystoreImport()) + defaultCall: __defaultImplStub!.createViewModel(from: validatorList, selectedValidatorList: selectedValidatorList, totalValidatorsCount: totalValidatorsCount, filter: filter, priceData: priceData, locale: locale)) } - struct __StubbingProxy_OnboardingMainInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CustomValidatorListViewModelFactoryProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -23109,14 +22231,14 @@ import Foundation } - func didSuggestKeystoreImport() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOnboardingMainInteractorOutputProtocol.self, method: "didSuggestKeystoreImport()", parameterMatchers: matchers)) + func createViewModel(from validatorList: M1, selectedValidatorList: M2, totalValidatorsCount: M3, filter: M4, priceData: M5, locale: M6) -> Cuckoo.ProtocolStubFunction<([SelectedValidatorInfo], [SelectedValidatorInfo], Int, CustomValidatorListFilter, PriceData?, Locale), CustomValidatorListViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int, M4.MatchedType == CustomValidatorListFilter, M5.OptionalMatchedType == PriceData, M6.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], [SelectedValidatorInfo], Int, CustomValidatorListFilter, PriceData?, Locale)>] = [wrap(matchable: validatorList) { $0.0 }, wrap(matchable: selectedValidatorList) { $0.1 }, wrap(matchable: totalValidatorsCount) { $0.2 }, wrap(matchable: filter) { $0.3 }, wrap(matchable: priceData) { $0.4 }, wrap(matchable: locale) { $0.5 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListViewModelFactoryProtocol.self, method: "createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel", parameterMatchers: matchers)) } } - struct __VerificationProxy_OnboardingMainInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CustomValidatorListViewModelFactoryProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -23131,15 +22253,15 @@ import Foundation @discardableResult - func didSuggestKeystoreImport() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didSuggestKeystoreImport()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func createViewModel(from validatorList: M1, selectedValidatorList: M2, totalValidatorsCount: M3, filter: M4, priceData: M5, locale: M6) -> Cuckoo.__DoNotUse<([SelectedValidatorInfo], [SelectedValidatorInfo], Int, CustomValidatorListFilter, PriceData?, Locale), CustomValidatorListViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int, M4.MatchedType == CustomValidatorListFilter, M5.OptionalMatchedType == PriceData, M6.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], [SelectedValidatorInfo], Int, CustomValidatorListFilter, PriceData?, Locale)>] = [wrap(matchable: validatorList) { $0.0 }, wrap(matchable: selectedValidatorList) { $0.1 }, wrap(matchable: totalValidatorsCount) { $0.2 }, wrap(matchable: filter) { $0.3 }, wrap(matchable: priceData) { $0.4 }, wrap(matchable: locale) { $0.5 }] + return cuckoo_manager.verify("createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class OnboardingMainInteractorOutputProtocolStub: OnboardingMainInteractorOutputProtocol { + class CustomValidatorListViewModelFactoryProtocolStub: CustomValidatorListViewModelFactoryProtocol { @@ -23147,87 +22269,147 @@ import Foundation - func didSuggestKeystoreImport() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func createViewModel(from validatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel { + return DefaultValueRegistry.defaultValue(for: (CustomValidatorListViewModel).self) } } -import Cuckoo -@testable import novawallet - -import CommonWallet - - class MockOperationDetailsViewProtocol: OperationDetailsViewProtocol, Cuckoo.ProtocolMock { + class MockCustomValidatorListInteractorInputProtocol: CustomValidatorListInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OperationDetailsViewProtocol + typealias MocksType = CustomValidatorListInteractorInputProtocol - typealias Stubbing = __StubbingProxy_OperationDetailsViewProtocol - typealias Verification = __VerificationProxy_OperationDetailsViewProtocol + typealias Stubbing = __StubbingProxy_CustomValidatorListInteractorInputProtocol + typealias Verification = __VerificationProxy_CustomValidatorListInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OperationDetailsViewProtocol? + private var __defaultImplStub: CustomValidatorListInteractorInputProtocol? - func enableDefaultImplementation(_ stub: OperationDetailsViewProtocol) { + func enableDefaultImplementation(_ stub: CustomValidatorListInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) } + + struct __StubbingProxy_CustomValidatorListInteractorInputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_CustomValidatorListInteractorInputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class CustomValidatorListInteractorInputProtocolStub: CustomValidatorListInteractorInputProtocol { + + + + + + + + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + + class MockCustomValidatorListInteractorOutputProtocol: CustomValidatorListInteractorOutputProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = CustomValidatorListInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_CustomValidatorListInteractorOutputProtocol + typealias Verification = __VerificationProxy_CustomValidatorListInteractorOutputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - + private var __defaultImplStub: CustomValidatorListInteractorOutputProtocol? + + func enableDefaultImplementation(_ stub: CustomValidatorListInteractorOutputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + - func didReceive(viewModel: OperationDetailsViewModel) { + + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("didReceive(viewModel: OperationDetailsViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - struct __StubbingProxy_OperationDetailsViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CustomValidatorListInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -23235,24 +22417,14 @@ import CommonWallet } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(OperationDetailsViewModel)> where M1.MatchedType == OperationDetailsViewModel { - let matchers: [Cuckoo.ParameterMatcher<(OperationDetailsViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsViewProtocol.self, method: "didReceive(viewModel: OperationDetailsViewModel)", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_OperationDetailsViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CustomValidatorListInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -23264,46 +22436,18 @@ import CommonWallet } - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(OperationDetailsViewModel), Void> where M1.MatchedType == OperationDetailsViewModel { - let matchers: [Cuckoo.ParameterMatcher<(OperationDetailsViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceive(viewModel: OperationDetailsViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class OperationDetailsViewProtocolStub: OperationDetailsViewProtocol { - - - - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - - - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } + class CustomValidatorListInteractorOutputProtocolStub: CustomValidatorListInteractorOutputProtocol { @@ -23311,7 +22455,7 @@ import CommonWallet - func didReceive(viewModel: OperationDetailsViewModel) { + func didReceivePriceData(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -23319,19 +22463,19 @@ import CommonWallet - class MockOperationDetailsPresenterProtocol: OperationDetailsPresenterProtocol, Cuckoo.ProtocolMock { + class MockCustomValidatorListWireframeProtocol: CustomValidatorListWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OperationDetailsPresenterProtocol + typealias MocksType = CustomValidatorListWireframeProtocol - typealias Stubbing = __StubbingProxy_OperationDetailsPresenterProtocol - typealias Verification = __VerificationProxy_OperationDetailsPresenterProtocol + typealias Stubbing = __StubbingProxy_CustomValidatorListWireframeProtocol + typealias Verification = __VerificationProxy_CustomValidatorListWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OperationDetailsPresenterProtocol? + private var __defaultImplStub: CustomValidatorListWireframeProtocol? - func enableDefaultImplementation(_ stub: OperationDetailsPresenterProtocol) { + func enableDefaultImplementation(_ stub: CustomValidatorListWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -23344,81 +22488,96 @@ import CommonWallet - func setup() { + func present(_ validatorInfo: ValidatorInfoProtocol, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", + parameters: (validatorInfo, view), + escapingParameters: (validatorInfo, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.present(validatorInfo, from: view)) } - func showSenderActions() { + func presentFilters(from view: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?) { - return cuckoo_manager.call("showSenderActions()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("presentFilters(from: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?)", + parameters: (view, filter, hasIdentity, delegate), + escapingParameters: (view, filter, hasIdentity, delegate), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showSenderActions()) + defaultCall: __defaultImplStub!.presentFilters(from: view, filter: filter, hasIdentity: hasIdentity, delegate: delegate)) } - func showRecepientActions() { + func presentSearch(from view: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?) { - return cuckoo_manager.call("showRecepientActions()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("presentSearch(from: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?)", + parameters: (view, fullValidatorList, selectedValidatorList, delegate), + escapingParameters: (view, fullValidatorList, selectedValidatorList, delegate), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showRecepientActions()) + defaultCall: __defaultImplStub!.presentSearch(from: view, fullValidatorList: fullValidatorList, selectedValidatorList: selectedValidatorList, delegate: delegate)) } - func showOperationActions() { + func proceed(from view: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate) { - return cuckoo_manager.call("showOperationActions()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("proceed(from: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate)", + parameters: (view, validatorList, maxTargets, delegate), + escapingParameters: (view, validatorList, maxTargets, delegate), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showOperationActions()) + defaultCall: __defaultImplStub!.proceed(from: view, validatorList: validatorList, maxTargets: maxTargets, delegate: delegate)) } - func send() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("send()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.send()) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_OperationDetailsPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CustomValidatorListWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -23426,34 +22585,39 @@ import CommonWallet } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoProtocol, ControllerBackedProtocol?)> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func showSenderActions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "showSenderActions()", parameterMatchers: matchers)) + func presentFilters(from view: M1, filter: M2, hasIdentity: M3, delegate: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, CustomValidatorListFilter, Bool, ValidatorListFilterDelegate?)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == CustomValidatorListFilter, M3.MatchedType == Bool, M4.OptionalMatchedType == ValidatorListFilterDelegate { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, CustomValidatorListFilter, Bool, ValidatorListFilterDelegate?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: filter) { $0.1 }, wrap(matchable: hasIdentity) { $0.2 }, wrap(matchable: delegate) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "presentFilters(from: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?)", parameterMatchers: matchers)) } - func showRecepientActions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "showRecepientActions()", parameterMatchers: matchers)) + func presentSearch(from view: M1, fullValidatorList: M2, selectedValidatorList: M3, delegate: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, [SelectedValidatorInfo], [SelectedValidatorInfo], ValidatorSearchDelegate?)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == [SelectedValidatorInfo], M4.OptionalMatchedType == ValidatorSearchDelegate { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, [SelectedValidatorInfo], [SelectedValidatorInfo], ValidatorSearchDelegate?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: fullValidatorList) { $0.1 }, wrap(matchable: selectedValidatorList) { $0.2 }, wrap(matchable: delegate) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "presentSearch(from: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?)", parameterMatchers: matchers)) } - func showOperationActions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "showOperationActions()", parameterMatchers: matchers)) + func proceed(from view: M1, validatorList: M2, maxTargets: M3, delegate: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, [SelectedValidatorInfo], Int, SelectedValidatorListDelegate)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int, M4.MatchedType == SelectedValidatorListDelegate { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, [SelectedValidatorInfo], Int, SelectedValidatorListDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: validatorList) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }, wrap(matchable: delegate) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "proceed(from: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate)", parameterMatchers: matchers)) } - func send() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsPresenterProtocol.self, method: "send()", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_OperationDetailsPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CustomValidatorListWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -23468,39 +22632,45 @@ import CommonWallet @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.__DoNotUse<(ValidatorInfoProtocol, ControllerBackedProtocol?), Void> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showSenderActions() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("showSenderActions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentFilters(from view: M1, filter: M2, hasIdentity: M3, delegate: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, CustomValidatorListFilter, Bool, ValidatorListFilterDelegate?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == CustomValidatorListFilter, M3.MatchedType == Bool, M4.OptionalMatchedType == ValidatorListFilterDelegate { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, CustomValidatorListFilter, Bool, ValidatorListFilterDelegate?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: filter) { $0.1 }, wrap(matchable: hasIdentity) { $0.2 }, wrap(matchable: delegate) { $0.3 }] + return cuckoo_manager.verify("presentFilters(from: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showRecepientActions() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("showRecepientActions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentSearch(from view: M1, fullValidatorList: M2, selectedValidatorList: M3, delegate: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, [SelectedValidatorInfo], [SelectedValidatorInfo], ValidatorSearchDelegate?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == [SelectedValidatorInfo], M4.OptionalMatchedType == ValidatorSearchDelegate { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, [SelectedValidatorInfo], [SelectedValidatorInfo], ValidatorSearchDelegate?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: fullValidatorList) { $0.1 }, wrap(matchable: selectedValidatorList) { $0.2 }, wrap(matchable: delegate) { $0.3 }] + return cuckoo_manager.verify("presentSearch(from: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showOperationActions() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("showOperationActions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed(from view: M1, validatorList: M2, maxTargets: M3, delegate: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, [SelectedValidatorInfo], Int, SelectedValidatorListDelegate), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int, M4.MatchedType == SelectedValidatorListDelegate { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, [SelectedValidatorInfo], Int, SelectedValidatorListDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: validatorList) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }, wrap(matchable: delegate) { $0.3 }] + return cuckoo_manager.verify("proceed(from: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func send() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("send()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class OperationDetailsPresenterProtocolStub: OperationDetailsPresenterProtocol { + class CustomValidatorListWireframeProtocolStub: CustomValidatorListWireframeProtocol { @@ -23508,78 +22678,156 @@ import CommonWallet - func setup() { + func present(_ validatorInfo: ValidatorInfoProtocol, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showSenderActions() { + func presentFilters(from view: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showRecepientActions() { + func presentSearch(from view: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showOperationActions() { + func proceed(from view: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func send() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet - class MockOperationDetailsInteractorInputProtocol: OperationDetailsInteractorInputProtocol, Cuckoo.ProtocolMock { +import SoraFoundation + + + class MockRecommendedValidatorListViewProtocol: RecommendedValidatorListViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OperationDetailsInteractorInputProtocol + typealias MocksType = RecommendedValidatorListViewProtocol - typealias Stubbing = __StubbingProxy_OperationDetailsInteractorInputProtocol - typealias Verification = __VerificationProxy_OperationDetailsInteractorInputProtocol + typealias Stubbing = __StubbingProxy_RecommendedValidatorListViewProtocol + typealias Verification = __VerificationProxy_RecommendedValidatorListViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OperationDetailsInteractorInputProtocol? + private var __defaultImplStub: RecommendedValidatorListViewProtocol? - func enableDefaultImplementation(_ stub: OperationDetailsInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: RecommendedValidatorListViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + + } + - func setup() { + func didReceive(viewModel: RecommendedValidatorListViewModelProtocol) { - return cuckoo_manager.call("setup()", + return cuckoo_manager.call("didReceive(viewModel: RecommendedValidatorListViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) + + } + + + + public func applyLocalization() { + + return cuckoo_manager.call("applyLocalization()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_OperationDetailsInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_RecommendedValidatorListViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -23587,14 +22835,34 @@ import CommonWallet } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") + } + + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") + } + + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") + } + + + func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RecommendedValidatorListViewModelProtocol)> where M1.MatchedType == RecommendedValidatorListViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(RecommendedValidatorListViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListViewProtocol.self, method: "didReceive(viewModel: RecommendedValidatorListViewModelProtocol)", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_OperationDetailsInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_RecommendedValidatorListViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -23606,26 +22874,82 @@ import CommonWallet } + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { + func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(RecommendedValidatorListViewModelProtocol), Void> where M1.MatchedType == RecommendedValidatorListViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(RecommendedValidatorListViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceive(viewModel: RecommendedValidatorListViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class OperationDetailsInteractorInputProtocolStub: OperationDetailsInteractorInputProtocol { - - - - - + class RecommendedValidatorListViewProtocolStub: RecommendedValidatorListViewProtocol { + - func setup() { + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } + + + + + + + + func didReceive(viewModel: RecommendedValidatorListViewModelProtocol) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -23633,19 +22957,19 @@ import CommonWallet - class MockOperationDetailsInteractorOutputProtocol: OperationDetailsInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockRecommendedValidatorListPresenterProtocol: RecommendedValidatorListPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OperationDetailsInteractorOutputProtocol + typealias MocksType = RecommendedValidatorListPresenterProtocol - typealias Stubbing = __StubbingProxy_OperationDetailsInteractorOutputProtocol - typealias Verification = __VerificationProxy_OperationDetailsInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_RecommendedValidatorListPresenterProtocol + typealias Verification = __VerificationProxy_RecommendedValidatorListPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OperationDetailsInteractorOutputProtocol? + private var __defaultImplStub: RecommendedValidatorListPresenterProtocol? - func enableDefaultImplementation(_ stub: OperationDetailsInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: RecommendedValidatorListPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -23658,21 +22982,51 @@ import CommonWallet - func didReceiveDetails(result: Result) { + func setup() { - return cuckoo_manager.call("didReceiveDetails(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveDetails(result: result)) + defaultCall: __defaultImplStub!.setup()) + + } + + + + func selectedValidatorAt(index: Int) { + + return cuckoo_manager.call("selectedValidatorAt(index: Int)", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.selectedValidatorAt(index: index)) + + } + + + + func proceed() { + + return cuckoo_manager.call("proceed()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.proceed()) } - struct __StubbingProxy_OperationDetailsInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_RecommendedValidatorListPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -23680,14 +23034,24 @@ import CommonWallet } - func didReceiveDetails(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsInteractorOutputProtocol.self, method: "didReceiveDetails(result: Result)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func selectedValidatorAt(index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListPresenterProtocol.self, method: "selectedValidatorAt(index: Int)", parameterMatchers: matchers)) + } + + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } } - struct __VerificationProxy_OperationDetailsInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_RecommendedValidatorListPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -23702,15 +23066,27 @@ import CommonWallet @discardableResult - func didReceiveDetails(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveDetails(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func selectedValidatorAt(index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("selectedValidatorAt(index: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class OperationDetailsInteractorOutputProtocolStub: OperationDetailsInteractorOutputProtocol { + class RecommendedValidatorListPresenterProtocolStub: RecommendedValidatorListPresenterProtocol { @@ -23718,7 +23094,19 @@ import CommonWallet - func didReceiveDetails(result: Result) { + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func selectedValidatorAt(index: Int) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func proceed() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -23726,19 +23114,19 @@ import CommonWallet - class MockOperationDetailsWireframeProtocol: OperationDetailsWireframeProtocol, Cuckoo.ProtocolMock { + class MockRecommendedValidatorListWireframeProtocol: RecommendedValidatorListWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = OperationDetailsWireframeProtocol + typealias MocksType = RecommendedValidatorListWireframeProtocol - typealias Stubbing = __StubbingProxy_OperationDetailsWireframeProtocol - typealias Verification = __VerificationProxy_OperationDetailsWireframeProtocol + typealias Stubbing = __StubbingProxy_RecommendedValidatorListWireframeProtocol + typealias Verification = __VerificationProxy_RecommendedValidatorListWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: OperationDetailsWireframeProtocol? + private var __defaultImplStub: RecommendedValidatorListWireframeProtocol? - func enableDefaultImplementation(_ stub: OperationDetailsWireframeProtocol) { + func enableDefaultImplementation(_ stub: RecommendedValidatorListWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -23751,51 +23139,36 @@ import CommonWallet - func showSend(from view: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset) { - - return cuckoo_manager.call("showSend(from: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset)", - parameters: (view, displayAddress, chainAsset), - escapingParameters: (view, displayAddress, chainAsset), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showSend(from: view, displayAddress: displayAddress, chainAsset: chainAsset)) - - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func present(_ validatorInfo: SelectedValidatorInfo, from view: RecommendedValidatorListViewProtocol?) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("present(_: SelectedValidatorInfo, from: RecommendedValidatorListViewProtocol?)", + parameters: (validatorInfo, view), + escapingParameters: (validatorInfo, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.present(validatorInfo, from: view)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func proceed(from view: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("proceed(from: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", + parameters: (view, targets, maxTargets), + escapingParameters: (view, targets, maxTargets), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.proceed(from: view, targets: targets, maxTargets: maxTargets)) } - struct __StubbingProxy_OperationDetailsWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_RecommendedValidatorListWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -23803,24 +23176,19 @@ import CommonWallet } - func showSend(from view: M1, displayAddress: M2, chainAsset: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(OperationDetailsViewProtocol?, DisplayAddress, ChainAsset)> where M1.OptionalMatchedType == OperationDetailsViewProtocol, M2.MatchedType == DisplayAddress, M3.MatchedType == ChainAsset { - let matchers: [Cuckoo.ParameterMatcher<(OperationDetailsViewProtocol?, DisplayAddress, ChainAsset)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: displayAddress) { $0.1 }, wrap(matchable: chainAsset) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsWireframeProtocol.self, method: "showSend(from: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset)", parameterMatchers: matchers)) - } - - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorInfo, RecommendedValidatorListViewProtocol?)> where M1.MatchedType == SelectedValidatorInfo, M2.OptionalMatchedType == RecommendedValidatorListViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo, RecommendedValidatorListViewProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListWireframeProtocol.self, method: "present(_: SelectedValidatorInfo, from: RecommendedValidatorListViewProtocol?)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockOperationDetailsWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func proceed(from view: M1, targets: M2, maxTargets: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(RecommendedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)> where M1.OptionalMatchedType == RecommendedValidatorListViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(RecommendedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: targets) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListWireframeProtocol.self, method: "proceed(from: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", parameterMatchers: matchers)) } } - struct __VerificationProxy_OperationDetailsWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_RecommendedValidatorListWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -23835,27 +23203,21 @@ import CommonWallet @discardableResult - func showSend(from view: M1, displayAddress: M2, chainAsset: M3) -> Cuckoo.__DoNotUse<(OperationDetailsViewProtocol?, DisplayAddress, ChainAsset), Void> where M1.OptionalMatchedType == OperationDetailsViewProtocol, M2.MatchedType == DisplayAddress, M3.MatchedType == ChainAsset { - let matchers: [Cuckoo.ParameterMatcher<(OperationDetailsViewProtocol?, DisplayAddress, ChainAsset)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: displayAddress) { $0.1 }, wrap(matchable: chainAsset) { $0.2 }] - return cuckoo_manager.verify("showSend(from: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.__DoNotUse<(SelectedValidatorInfo, RecommendedValidatorListViewProtocol?), Void> where M1.MatchedType == SelectedValidatorInfo, M2.OptionalMatchedType == RecommendedValidatorListViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo, RecommendedValidatorListViewProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("present(_: SelectedValidatorInfo, from: RecommendedValidatorListViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed(from view: M1, targets: M2, maxTargets: M3) -> Cuckoo.__DoNotUse<(RecommendedValidatorListViewProtocol?, [SelectedValidatorInfo], Int), Void> where M1.OptionalMatchedType == RecommendedValidatorListViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(RecommendedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: targets) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] + return cuckoo_manager.verify("proceed(from: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class OperationDetailsWireframeProtocolStub: OperationDetailsWireframeProtocol { + class RecommendedValidatorListWireframeProtocolStub: RecommendedValidatorListWireframeProtocol { @@ -23863,19 +23225,13 @@ import CommonWallet - func showSend(from view: OperationDetailsViewProtocol?, displayAddress: DisplayAddress, chainAsset: ChainAsset) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func present(_ validatorInfo: SelectedValidatorInfo, from view: RecommendedValidatorListViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func proceed(from view: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -23885,22 +23241,24 @@ import CommonWallet import Cuckoo @testable import novawallet -import UIKit +import BigInt +import Foundation +import SoraFoundation - class MockPinSetupViewProtocol: PinSetupViewProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsConfirmViewProtocol: SelectValidatorsConfirmViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = PinSetupViewProtocol + typealias MocksType = SelectValidatorsConfirmViewProtocol - typealias Stubbing = __StubbingProxy_PinSetupViewProtocol - typealias Verification = __VerificationProxy_PinSetupViewProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmViewProtocol + typealias Verification = __VerificationProxy_SelectValidatorsConfirmViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: PinSetupViewProtocol? + private var __defaultImplStub: SelectValidatorsConfirmViewProtocol? - func enableDefaultImplementation(_ stub: PinSetupViewProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsConfirmViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -23935,57 +23293,169 @@ import UIKit } + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + + } + + + + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } + + } + - func didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void) { + func didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel) { - return cuckoo_manager.call("didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", - parameters: (biometryType, completionBlock), - escapingParameters: (biometryType, completionBlock), + return cuckoo_manager.call("didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel)", + parameters: (confirmationViewModel), + escapingParameters: (confirmationViewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didRequestBiometryUsage(biometryType: biometryType, completionBlock: completionBlock)) + defaultCall: __defaultImplStub!.didReceive(confirmationViewModel: confirmationViewModel)) } - func didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType) { + func didReceive(hintsViewModel: LocalizableResource<[String]>) { - return cuckoo_manager.call("didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType)", - parameters: (enabled, availableBiometryType), - escapingParameters: (enabled, availableBiometryType), + return cuckoo_manager.call("didReceive(hintsViewModel: LocalizableResource<[String]>)", + parameters: (hintsViewModel), + escapingParameters: (hintsViewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didChangeAccessoryState(enabled: enabled, availableBiometryType: availableBiometryType)) + defaultCall: __defaultImplStub!.didReceive(hintsViewModel: hintsViewModel)) } - func didReceiveWrongPincode() { + func didReceive(amountViewModel: LocalizableResource?) { - return cuckoo_manager.call("didReceiveWrongPincode()", + return cuckoo_manager.call("didReceive(amountViewModel: LocalizableResource?)", + parameters: (amountViewModel), + escapingParameters: (amountViewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(amountViewModel: amountViewModel)) + + } + + + + func didReceive(feeViewModel: LocalizableResource?) { + + return cuckoo_manager.call("didReceive(feeViewModel: LocalizableResource?)", + parameters: (feeViewModel), + escapingParameters: (feeViewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(feeViewModel: feeViewModel)) + + } + + + + public func applyLocalization() { + + return cuckoo_manager.call("applyLocalization()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveWrongPincode()) + defaultCall: __defaultImplStub!.applyLocalization()) + + } + + + + func didStartLoading() { + + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStartLoading()) + + } + + + + func didStopLoading() { + + return cuckoo_manager.call("didStopLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStopLoading()) } - struct __StubbingProxy_PinSetupViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsConfirmViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -23993,34 +23463,69 @@ import UIKit } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - func didRequestBiometryUsage(biometryType: M1, completionBlock: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(AvailableBiometryType, (Bool) -> Void)> where M1.MatchedType == AvailableBiometryType, M2.MatchedType == (Bool) -> Void { - let matchers: [Cuckoo.ParameterMatcher<(AvailableBiometryType, (Bool) -> Void)>] = [wrap(matchable: biometryType) { $0.0 }, wrap(matchable: completionBlock) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupViewProtocol.self, method: "didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", parameterMatchers: matchers)) + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - func didChangeAccessoryState(enabled: M1, availableBiometryType: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool, AvailableBiometryType)> where M1.MatchedType == Bool, M2.MatchedType == AvailableBiometryType { - let matchers: [Cuckoo.ParameterMatcher<(Bool, AvailableBiometryType)>] = [wrap(matchable: enabled) { $0.0 }, wrap(matchable: availableBiometryType) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupViewProtocol.self, method: "didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType)", parameterMatchers: matchers)) + + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") } - func didReceiveWrongPincode() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + } + + + func didReceive(confirmationViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectValidatorsConfirmViewModel)> where M1.MatchedType == SelectValidatorsConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsConfirmViewModel)>] = [wrap(matchable: confirmationViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel)", parameterMatchers: matchers)) + } + + func didReceive(hintsViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource<[String]>)> where M1.MatchedType == LocalizableResource<[String]> { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource<[String]>)>] = [wrap(matchable: hintsViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didReceive(hintsViewModel: LocalizableResource<[String]>)", parameterMatchers: matchers)) + } + + func didReceive(amountViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: amountViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didReceive(amountViewModel: LocalizableResource?)", parameterMatchers: matchers)) + } + + func didReceive(feeViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: feeViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didReceive(feeViewModel: LocalizableResource?)", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupViewProtocol.self, method: "didReceiveWrongPincode()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + } + + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_PinSetupViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsConfirmViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -24042,30 +23547,69 @@ import UIKit return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func didRequestBiometryUsage(biometryType: M1, completionBlock: M2) -> Cuckoo.__DoNotUse<(AvailableBiometryType, (Bool) -> Void), Void> where M1.MatchedType == AvailableBiometryType, M2.MatchedType == (Bool) -> Void { - let matchers: [Cuckoo.ParameterMatcher<(AvailableBiometryType, (Bool) -> Void)>] = [wrap(matchable: biometryType) { $0.0 }, wrap(matchable: completionBlock) { $0.1 }] - return cuckoo_manager.verify("didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(confirmationViewModel: M1) -> Cuckoo.__DoNotUse<(SelectValidatorsConfirmViewModel), Void> where M1.MatchedType == SelectValidatorsConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsConfirmViewModel)>] = [wrap(matchable: confirmationViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didChangeAccessoryState(enabled: M1, availableBiometryType: M2) -> Cuckoo.__DoNotUse<(Bool, AvailableBiometryType), Void> where M1.MatchedType == Bool, M2.MatchedType == AvailableBiometryType { - let matchers: [Cuckoo.ParameterMatcher<(Bool, AvailableBiometryType)>] = [wrap(matchable: enabled) { $0.0 }, wrap(matchable: availableBiometryType) { $0.1 }] - return cuckoo_manager.verify("didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(hintsViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource<[String]>), Void> where M1.MatchedType == LocalizableResource<[String]> { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource<[String]>)>] = [wrap(matchable: hintsViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(hintsViewModel: LocalizableResource<[String]>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveWrongPincode() -> Cuckoo.__DoNotUse<(), Void> { + func didReceive(amountViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: amountViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(amountViewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(feeViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: feeViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(feeViewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didReceiveWrongPincode()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class PinSetupViewProtocolStub: PinSetupViewProtocol { + class SelectValidatorsConfirmViewProtocolStub: SelectValidatorsConfirmViewProtocol { @@ -24084,6 +23628,35 @@ import UIKit } } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } + + + + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } @@ -24091,19 +23664,43 @@ import UIKit - func didRequestBiometryUsage(biometryType: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void) { + func didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didChangeAccessoryState(enabled: Bool, availableBiometryType: AvailableBiometryType) { + func didReceive(hintsViewModel: LocalizableResource<[String]>) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveWrongPincode() { + func didReceive(amountViewModel: LocalizableResource?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceive(feeViewModel: LocalizableResource?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + public func applyLocalization() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStartLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStopLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -24111,19 +23708,19 @@ import UIKit - class MockPinSetupPresenterProtocol: PinSetupPresenterProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsConfirmPresenterProtocol: SelectValidatorsConfirmPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = PinSetupPresenterProtocol + typealias MocksType = SelectValidatorsConfirmPresenterProtocol - typealias Stubbing = __StubbingProxy_PinSetupPresenterProtocol - typealias Verification = __VerificationProxy_PinSetupPresenterProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmPresenterProtocol + typealias Verification = __VerificationProxy_SelectValidatorsConfirmPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: PinSetupPresenterProtocol? + private var __defaultImplStub: SelectValidatorsConfirmPresenterProtocol? - func enableDefaultImplementation(_ stub: PinSetupPresenterProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsConfirmPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -24136,66 +23733,66 @@ import UIKit - func start() { + func setup() { - return cuckoo_manager.call("start()", + return cuckoo_manager.call("setup()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.start()) + defaultCall: __defaultImplStub!.setup()) } - func cancel() { + func selectWalletAccount() { - return cuckoo_manager.call("cancel()", + return cuckoo_manager.call("selectWalletAccount()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.cancel()) + defaultCall: __defaultImplStub!.selectWalletAccount()) } - func activateBiometricAuth() { + func selectPayoutAccount() { - return cuckoo_manager.call("activateBiometricAuth()", + return cuckoo_manager.call("selectPayoutAccount()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activateBiometricAuth()) + defaultCall: __defaultImplStub!.selectPayoutAccount()) } - func submit(pin: String) { + func proceed() { - return cuckoo_manager.call("submit(pin: String)", - parameters: (pin), - escapingParameters: (pin), + return cuckoo_manager.call("proceed()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.submit(pin: pin)) + defaultCall: __defaultImplStub!.proceed()) } - struct __StubbingProxy_PinSetupPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsConfirmPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -24203,29 +23800,29 @@ import UIKit } - func start() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupPresenterProtocol.self, method: "start()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func cancel() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func selectWalletAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupPresenterProtocol.self, method: "cancel()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmPresenterProtocol.self, method: "selectWalletAccount()", parameterMatchers: matchers)) } - func activateBiometricAuth() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func selectPayoutAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupPresenterProtocol.self, method: "activateBiometricAuth()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmPresenterProtocol.self, method: "selectPayoutAccount()", parameterMatchers: matchers)) } - func submit(pin: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: pin) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupPresenterProtocol.self, method: "submit(pin: String)", parameterMatchers: matchers)) + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } } - struct __VerificationProxy_PinSetupPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsConfirmPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -24240,33 +23837,33 @@ import UIKit @discardableResult - func start() -> Cuckoo.__DoNotUse<(), Void> { + func setup() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("start()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func cancel() -> Cuckoo.__DoNotUse<(), Void> { + func selectWalletAccount() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("cancel()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("selectWalletAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func activateBiometricAuth() -> Cuckoo.__DoNotUse<(), Void> { + func selectPayoutAccount() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("activateBiometricAuth()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("selectPayoutAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func submit(pin: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: pin) { $0 }] - return cuckoo_manager.verify("submit(pin: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class PinSetupPresenterProtocolStub: PinSetupPresenterProtocol { + class SelectValidatorsConfirmPresenterProtocolStub: SelectValidatorsConfirmPresenterProtocol { @@ -24274,118 +23871,25 @@ import UIKit - func start() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func cancel() { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func activateBiometricAuth() { + func selectWalletAccount() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func submit(pin: String) { + func selectPayoutAccount() { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockPinSetupInteractorInputProtocol: PinSetupInteractorInputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = PinSetupInteractorInputProtocol - - typealias Stubbing = __StubbingProxy_PinSetupInteractorInputProtocol - typealias Verification = __VerificationProxy_PinSetupInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: PinSetupInteractorInputProtocol? - - func enableDefaultImplementation(_ stub: PinSetupInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func process(pin: String) { - - return cuckoo_manager.call("process(pin: String)", - parameters: (pin), - escapingParameters: (pin), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.process(pin: pin)) - - } - - - struct __StubbingProxy_PinSetupInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func process(pin: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: pin) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupInteractorInputProtocol.self, method: "process(pin: String)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_PinSetupInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func process(pin: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: pin) { $0 }] - return cuckoo_manager.verify("process(pin: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class PinSetupInteractorInputProtocolStub: PinSetupInteractorInputProtocol { - - - - - - func process(pin: String) { + func proceed() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -24393,19 +23897,19 @@ import UIKit - class MockPinSetupInteractorOutputProtocol: PinSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsConfirmInteractorInputProtocol: SelectValidatorsConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = PinSetupInteractorOutputProtocol + typealias MocksType = SelectValidatorsConfirmInteractorInputProtocol - typealias Stubbing = __StubbingProxy_PinSetupInteractorOutputProtocol - typealias Verification = __VerificationProxy_PinSetupInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmInteractorInputProtocol + typealias Verification = __VerificationProxy_SelectValidatorsConfirmInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: PinSetupInteractorOutputProtocol? + private var __defaultImplStub: SelectValidatorsConfirmInteractorInputProtocol? - func enableDefaultImplementation(_ stub: PinSetupInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsConfirmInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -24418,51 +23922,51 @@ import UIKit - func didSavePin() { + func setup() { - return cuckoo_manager.call("didSavePin()", + return cuckoo_manager.call("setup()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSavePin()) + defaultCall: __defaultImplStub!.setup()) } - func didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void) { + func submitNomination() { - return cuckoo_manager.call("didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", - parameters: (type, completionBlock), - escapingParameters: (type, completionBlock), + return cuckoo_manager.call("submitNomination()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartWaitingBiometryDecision(type: type, completionBlock: completionBlock)) + defaultCall: __defaultImplStub!.submitNomination()) } - func didChangeState(from: PinSetupInteractor.PinSetupState) { + func estimateFee() { - return cuckoo_manager.call("didChangeState(from: PinSetupInteractor.PinSetupState)", - parameters: (from), - escapingParameters: (from), + return cuckoo_manager.call("estimateFee()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didChangeState(from: from)) + defaultCall: __defaultImplStub!.estimateFee()) } - struct __StubbingProxy_PinSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -24470,24 +23974,24 @@ import UIKit } - func didSavePin() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupInteractorOutputProtocol.self, method: "didSavePin()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func didStartWaitingBiometryDecision(type: M1, completionBlock: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(AvailableBiometryType, (Bool) -> Void)> where M1.MatchedType == AvailableBiometryType, M2.MatchedType == (Bool) -> Void { - let matchers: [Cuckoo.ParameterMatcher<(AvailableBiometryType, (Bool) -> Void)>] = [wrap(matchable: type) { $0.0 }, wrap(matchable: completionBlock) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupInteractorOutputProtocol.self, method: "didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", parameterMatchers: matchers)) + func submitNomination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorInputProtocol.self, method: "submitNomination()", parameterMatchers: matchers)) } - func didChangeState(from: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PinSetupInteractor.PinSetupState)> where M1.MatchedType == PinSetupInteractor.PinSetupState { - let matchers: [Cuckoo.ParameterMatcher<(PinSetupInteractor.PinSetupState)>] = [wrap(matchable: from) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupInteractorOutputProtocol.self, method: "didChangeState(from: PinSetupInteractor.PinSetupState)", parameterMatchers: matchers)) + func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) } } - struct __VerificationProxy_PinSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -24502,27 +24006,27 @@ import UIKit @discardableResult - func didSavePin() -> Cuckoo.__DoNotUse<(), Void> { + func setup() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didSavePin()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartWaitingBiometryDecision(type: M1, completionBlock: M2) -> Cuckoo.__DoNotUse<(AvailableBiometryType, (Bool) -> Void), Void> where M1.MatchedType == AvailableBiometryType, M2.MatchedType == (Bool) -> Void { - let matchers: [Cuckoo.ParameterMatcher<(AvailableBiometryType, (Bool) -> Void)>] = [wrap(matchable: type) { $0.0 }, wrap(matchable: completionBlock) { $0.1 }] - return cuckoo_manager.verify("didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func submitNomination() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("submitNomination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didChangeState(from: M1) -> Cuckoo.__DoNotUse<(PinSetupInteractor.PinSetupState), Void> where M1.MatchedType == PinSetupInteractor.PinSetupState { - let matchers: [Cuckoo.ParameterMatcher<(PinSetupInteractor.PinSetupState)>] = [wrap(matchable: from) { $0 }] - return cuckoo_manager.verify("didChangeState(from: PinSetupInteractor.PinSetupState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class PinSetupInteractorOutputProtocolStub: PinSetupInteractorOutputProtocol { + class SelectValidatorsConfirmInteractorInputProtocolStub: SelectValidatorsConfirmInteractorInputProtocol { @@ -24530,19 +24034,19 @@ import UIKit - func didSavePin() { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartWaitingBiometryDecision(type: AvailableBiometryType, completionBlock: @escaping (Bool) -> Void) { + func submitNomination() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didChangeState(from: PinSetupInteractor.PinSetupState) { + func estimateFee() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -24550,19 +24054,19 @@ import UIKit - class MockPinSetupWireframeProtocol: PinSetupWireframeProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsConfirmInteractorOutputProtocol: SelectValidatorsConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = PinSetupWireframeProtocol + typealias MocksType = SelectValidatorsConfirmInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_PinSetupWireframeProtocol - typealias Verification = __VerificationProxy_PinSetupWireframeProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmInteractorOutputProtocol + typealias Verification = __VerificationProxy_SelectValidatorsConfirmInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: PinSetupWireframeProtocol? + private var __defaultImplStub: SelectValidatorsConfirmInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: PinSetupWireframeProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsConfirmInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -24575,289 +24079,186 @@ import UIKit - func showMain(from view: PinSetupViewProtocol?) { + func didReceiveModel(result: Result) { - return cuckoo_manager.call("showMain(from: PinSetupViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceiveModel(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showMain(from: view)) + defaultCall: __defaultImplStub!.didReceiveModel(result: result)) } - func showSignup(from view: PinSetupViewProtocol?) { + func didReceivePrice(result: Result) { - return cuckoo_manager.call("showSignup(from: PinSetupViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceivePrice(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showSignup(from: view)) + defaultCall: __defaultImplStub!.didReceivePrice(result: result)) } - - struct __StubbingProxy_PinSetupWireframeProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func showMain(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PinSetupViewProtocol?)> where M1.OptionalMatchedType == PinSetupViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(PinSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupWireframeProtocol.self, method: "showMain(from: PinSetupViewProtocol?)", parameterMatchers: matchers)) - } - - func showSignup(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PinSetupViewProtocol?)> where M1.OptionalMatchedType == PinSetupViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(PinSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockPinSetupWireframeProtocol.self, method: "showSignup(from: PinSetupViewProtocol?)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_PinSetupWireframeProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func showMain(from view: M1) -> Cuckoo.__DoNotUse<(PinSetupViewProtocol?), Void> where M1.OptionalMatchedType == PinSetupViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(PinSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showMain(from: PinSetupViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func showSignup(from view: M1) -> Cuckoo.__DoNotUse<(PinSetupViewProtocol?), Void> where M1.OptionalMatchedType == PinSetupViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(PinSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showSignup(from: PinSetupViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class PinSetupWireframeProtocolStub: PinSetupWireframeProtocol { - - + func didReceiveAccountInfo(result: Result) { + + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + + } - func showMain(from view: PinSetupViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveMinBond(result: Result) { + + return cuckoo_manager.call("didReceiveMinBond(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMinBond(result: result)) + } - func showSignup(from view: PinSetupViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveCounterForNominators(result: Result) { + + return cuckoo_manager.call("didReceiveCounterForNominators(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveCounterForNominators(result: result)) + } -} - - -import Cuckoo -@testable import novawallet - -import UIKit - - - class MockRootPresenterProtocol: RootPresenterProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = RootPresenterProtocol - typealias Stubbing = __StubbingProxy_RootPresenterProtocol - typealias Verification = __VerificationProxy_RootPresenterProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: RootPresenterProtocol? - - func enableDefaultImplementation(_ stub: RootPresenterProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceiveMaxNominatorsCount(result: Result) { + + return cuckoo_manager.call("didReceiveMaxNominatorsCount(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMaxNominatorsCount(result: result)) + } - - - + func didReceiveStakingDuration(result: Result) { + + return cuckoo_manager.call("didReceiveStakingDuration(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveStakingDuration(result: result)) + + } - func loadOnLaunch() { + func didStartNomination() { - return cuckoo_manager.call("loadOnLaunch()", + return cuckoo_manager.call("didStartNomination()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.loadOnLaunch()) + defaultCall: __defaultImplStub!.didStartNomination()) } - - struct __StubbingProxy_RootPresenterProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func loadOnLaunch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRootPresenterProtocol.self, method: "loadOnLaunch()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_RootPresenterProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func loadOnLaunch() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("loadOnLaunch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class RootPresenterProtocolStub: RootPresenterProtocol { - - - - - - - - func loadOnLaunch() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - - - class MockRootWireframeProtocol: RootWireframeProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = RootWireframeProtocol - - typealias Stubbing = __StubbingProxy_RootWireframeProtocol - typealias Verification = __VerificationProxy_RootWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: RootWireframeProtocol? - - func enableDefaultImplementation(_ stub: RootWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - func showLocalAuthentication(on view: UIWindow) { + func didCompleteNomination(txHash: String) { - return cuckoo_manager.call("showLocalAuthentication(on: UIWindow)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didCompleteNomination(txHash: String)", + parameters: (txHash), + escapingParameters: (txHash), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showLocalAuthentication(on: view)) + defaultCall: __defaultImplStub!.didCompleteNomination(txHash: txHash)) } - func showOnboarding(on view: UIWindow) { + func didFailNomination(error: Error) { - return cuckoo_manager.call("showOnboarding(on: UIWindow)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didFailNomination(error: Error)", + parameters: (error), + escapingParameters: (error), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showOnboarding(on: view)) + defaultCall: __defaultImplStub!.didFailNomination(error: error)) } - func showPincodeSetup(on view: UIWindow) { + func didReceive(paymentInfo: RuntimeDispatchInfo) { - return cuckoo_manager.call("showPincodeSetup(on: UIWindow)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceive(paymentInfo: RuntimeDispatchInfo)", + parameters: (paymentInfo), + escapingParameters: (paymentInfo), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showPincodeSetup(on: view)) + defaultCall: __defaultImplStub!.didReceive(paymentInfo: paymentInfo)) } - func showBroken(on view: UIWindow) { + func didReceive(feeError: Error) { - return cuckoo_manager.call("showBroken(on: UIWindow)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceive(feeError: Error)", + parameters: (feeError), + escapingParameters: (feeError), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showBroken(on: view)) + defaultCall: __defaultImplStub!.didReceive(feeError: feeError)) } - struct __StubbingProxy_RootWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -24865,29 +24266,69 @@ import UIKit } - func showLocalAuthentication(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(UIWindow)> where M1.MatchedType == UIWindow { - let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockRootWireframeProtocol.self, method: "showLocalAuthentication(on: UIWindow)", parameterMatchers: matchers)) + func didReceiveModel(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveModel(result: Result)", parameterMatchers: matchers)) } - func showOnboarding(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(UIWindow)> where M1.MatchedType == UIWindow { - let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockRootWireframeProtocol.self, method: "showOnboarding(on: UIWindow)", parameterMatchers: matchers)) + func didReceivePrice(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceivePrice(result: Result)", parameterMatchers: matchers)) } - func showPincodeSetup(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(UIWindow)> where M1.MatchedType == UIWindow { - let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockRootWireframeProtocol.self, method: "showPincodeSetup(on: UIWindow)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func showBroken(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(UIWindow)> where M1.MatchedType == UIWindow { - let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockRootWireframeProtocol.self, method: "showBroken(on: UIWindow)", parameterMatchers: matchers)) + func didReceiveMinBond(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveMinBond(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveCounterForNominators(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveCounterForNominators(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveMaxNominatorsCount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveMaxNominatorsCount(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveStakingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveStakingDuration(result: Result)", parameterMatchers: matchers)) + } + + func didStartNomination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didStartNomination()", parameterMatchers: matchers)) + } + + func didCompleteNomination(txHash: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: txHash) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didCompleteNomination(txHash: String)", parameterMatchers: matchers)) + } + + func didFailNomination(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didFailNomination(error: Error)", parameterMatchers: matchers)) + } + + func didReceive(paymentInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RuntimeDispatchInfo)> where M1.MatchedType == RuntimeDispatchInfo { + let matchers: [Cuckoo.ParameterMatcher<(RuntimeDispatchInfo)>] = [wrap(matchable: paymentInfo) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceive(paymentInfo: RuntimeDispatchInfo)", parameterMatchers: matchers)) + } + + func didReceive(feeError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: feeError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceive(feeError: Error)", parameterMatchers: matchers)) } } - struct __VerificationProxy_RootWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -24902,33 +24343,81 @@ import UIKit @discardableResult - func showLocalAuthentication(on view: M1) -> Cuckoo.__DoNotUse<(UIWindow), Void> where M1.MatchedType == UIWindow { - let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showLocalAuthentication(on: UIWindow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveModel(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveModel(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showOnboarding(on view: M1) -> Cuckoo.__DoNotUse<(UIWindow), Void> where M1.MatchedType == UIWindow { - let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showOnboarding(on: UIWindow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePrice(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePrice(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showPincodeSetup(on view: M1) -> Cuckoo.__DoNotUse<(UIWindow), Void> where M1.MatchedType == UIWindow { - let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showPincodeSetup(on: UIWindow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showBroken(on view: M1) -> Cuckoo.__DoNotUse<(UIWindow), Void> where M1.MatchedType == UIWindow { - let matchers: [Cuckoo.ParameterMatcher<(UIWindow)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showBroken(on: UIWindow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveMinBond(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinBond(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveCounterForNominators(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveCounterForNominators(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveMaxNominatorsCount(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMaxNominatorsCount(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveStakingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStartNomination() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartNomination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didCompleteNomination(txHash: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: txHash) { $0 }] + return cuckoo_manager.verify("didCompleteNomination(txHash: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didFailNomination(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return cuckoo_manager.verify("didFailNomination(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(paymentInfo: M1) -> Cuckoo.__DoNotUse<(RuntimeDispatchInfo), Void> where M1.MatchedType == RuntimeDispatchInfo { + let matchers: [Cuckoo.ParameterMatcher<(RuntimeDispatchInfo)>] = [wrap(matchable: paymentInfo) { $0 }] + return cuckoo_manager.verify("didReceive(paymentInfo: RuntimeDispatchInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(feeError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: feeError) { $0 }] + return cuckoo_manager.verify("didReceive(feeError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class RootWireframeProtocolStub: RootWireframeProtocol { + class SelectValidatorsConfirmInteractorOutputProtocolStub: SelectValidatorsConfirmInteractorOutputProtocol { @@ -24936,150 +24425,73 @@ import UIKit - func showLocalAuthentication(on view: UIWindow) { + func didReceiveModel(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showOnboarding(on view: UIWindow) { + func didReceivePrice(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showPincodeSetup(on view: UIWindow) { + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showBroken(on view: UIWindow) { + func didReceiveMinBond(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockRootInteractorInputProtocol: RootInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = RootInteractorInputProtocol - typealias Stubbing = __StubbingProxy_RootInteractorInputProtocol - typealias Verification = __VerificationProxy_RootInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - + func didReceiveCounterForNominators(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - private var __defaultImplStub: RootInteractorInputProtocol? - - func enableDefaultImplementation(_ stub: RootInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + + + func didReceiveMaxNominatorsCount(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - + func didReceiveStakingDuration(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - + func didStartNomination() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func decideModuleSynchroniously() { - - return cuckoo_manager.call("decideModuleSynchroniously()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.decideModuleSynchroniously()) - + func didCompleteNomination(txHash: String) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - struct __StubbingProxy_RootInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func decideModuleSynchroniously() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorInputProtocol.self, method: "decideModuleSynchroniously()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_RootInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func decideModuleSynchroniously() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("decideModuleSynchroniously()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class RootInteractorInputProtocolStub: RootInteractorInputProtocol { - - + func didFailNomination(error: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func setup() { + func didReceive(paymentInfo: RuntimeDispatchInfo) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func decideModuleSynchroniously() { + func didReceive(feeError: Error) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -25087,19 +24499,19 @@ import UIKit - class MockRootInteractorOutputProtocol: RootInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsConfirmWireframeProtocol: SelectValidatorsConfirmWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = RootInteractorOutputProtocol + typealias MocksType = SelectValidatorsConfirmWireframeProtocol - typealias Stubbing = __StubbingProxy_RootInteractorOutputProtocol - typealias Verification = __VerificationProxy_RootInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmWireframeProtocol + typealias Verification = __VerificationProxy_SelectValidatorsConfirmWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: RootInteractorOutputProtocol? + private var __defaultImplStub: SelectValidatorsConfirmWireframeProtocol? - func enableDefaultImplementation(_ stub: RootInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsConfirmWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -25112,66 +24524,51 @@ import UIKit - func didDecideOnboarding() { - - return cuckoo_manager.call("didDecideOnboarding()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didDecideOnboarding()) - - } - - - - func didDecideLocalAuthentication() { + func complete(from view: SelectValidatorsConfirmViewProtocol?) { - return cuckoo_manager.call("didDecideLocalAuthentication()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("complete(from: SelectValidatorsConfirmViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didDecideLocalAuthentication()) + defaultCall: __defaultImplStub!.complete(from: view)) } - func didDecidePincodeSetup() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didDecidePincodeSetup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didDecidePincodeSetup()) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func didDecideBroken() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didDecideBroken()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didDecideBroken()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_RootInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsConfirmWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -25179,29 +24576,24 @@ import UIKit } - func didDecideOnboarding() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorOutputProtocol.self, method: "didDecideOnboarding()", parameterMatchers: matchers)) - } - - func didDecideLocalAuthentication() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorOutputProtocol.self, method: "didDecideLocalAuthentication()", parameterMatchers: matchers)) + func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectValidatorsConfirmViewProtocol?)> where M1.OptionalMatchedType == SelectValidatorsConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmWireframeProtocol.self, method: "complete(from: SelectValidatorsConfirmViewProtocol?)", parameterMatchers: matchers)) } - func didDecidePincodeSetup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorOutputProtocol.self, method: "didDecidePincodeSetup()", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func didDecideBroken() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRootInteractorOutputProtocol.self, method: "didDecideBroken()", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_RootInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsConfirmWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -25216,33 +24608,27 @@ import UIKit @discardableResult - func didDecideOnboarding() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didDecideOnboarding()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didDecideLocalAuthentication() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didDecideLocalAuthentication()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func complete(from view: M1) -> Cuckoo.__DoNotUse<(SelectValidatorsConfirmViewProtocol?), Void> where M1.OptionalMatchedType == SelectValidatorsConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(from: SelectValidatorsConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didDecidePincodeSetup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didDecidePincodeSetup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didDecideBroken() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didDecideBroken()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class RootInteractorOutputProtocolStub: RootInteractorOutputProtocol { + class SelectValidatorsConfirmWireframeProtocolStub: SelectValidatorsConfirmWireframeProtocol { @@ -25250,25 +24636,19 @@ import UIKit - func didDecideOnboarding() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didDecideLocalAuthentication() { + func complete(from view: SelectValidatorsConfirmViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didDecidePincodeSetup() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didDecideBroken() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -25279,22 +24659,22 @@ import Cuckoo @testable import novawallet import Foundation -import UIKit.UIImage +import SoraFoundation - class MockSettingsViewProtocol: SettingsViewProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsStartViewProtocol: SelectValidatorsStartViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SettingsViewProtocol + typealias MocksType = SelectValidatorsStartViewProtocol - typealias Stubbing = __StubbingProxy_SettingsViewProtocol - typealias Verification = __VerificationProxy_SettingsViewProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsStartViewProtocol + typealias Verification = __VerificationProxy_SelectValidatorsStartViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SettingsViewProtocol? + private var __defaultImplStub: SelectValidatorsStartViewProtocol? - func enableDefaultImplementation(_ stub: SettingsViewProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsStartViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -25329,42 +24709,66 @@ import UIKit.UIImage } - - + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + + } + - func reload(sections: [(SettingsSection, [SettingsCellViewModel])]) { + + + + + func didReceive(viewModel: SelectValidatorsStartViewModel) { - return cuckoo_manager.call("reload(sections: [(SettingsSection, [SettingsCellViewModel])])", - parameters: (sections), - escapingParameters: (sections), + return cuckoo_manager.call("didReceive(viewModel: SelectValidatorsStartViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload(sections: sections)) + defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) } - func didLoad(userViewModel: SettingsAccountViewModel) { + public func applyLocalization() { - return cuckoo_manager.call("didLoad(userViewModel: SettingsAccountViewModel)", - parameters: (userViewModel), - escapingParameters: (userViewModel), + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didLoad(userViewModel: userViewModel)) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_SettingsViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsStartViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -25372,29 +24776,34 @@ import UIKit.UIImage } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - func reload(sections: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([(SettingsSection, [SettingsCellViewModel])])> where M1.MatchedType == [(SettingsSection, [SettingsCellViewModel])] { - let matchers: [Cuckoo.ParameterMatcher<([(SettingsSection, [SettingsCellViewModel])])>] = [wrap(matchable: sections) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsViewProtocol.self, method: "reload(sections: [(SettingsSection, [SettingsCellViewModel])])", parameterMatchers: matchers)) + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - func didLoad(userViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SettingsAccountViewModel)> where M1.MatchedType == SettingsAccountViewModel { - let matchers: [Cuckoo.ParameterMatcher<(SettingsAccountViewModel)>] = [wrap(matchable: userViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsViewProtocol.self, method: "didLoad(userViewModel: SettingsAccountViewModel)", parameterMatchers: matchers)) + + func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectValidatorsStartViewModel)> where M1.MatchedType == SelectValidatorsStartViewModel { + let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsStartViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartViewProtocol.self, method: "didReceive(viewModel: SelectValidatorsStartViewModel)", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SettingsViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsStartViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -25416,24 +24825,29 @@ import UIKit.UIImage return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func reload(sections: M1) -> Cuckoo.__DoNotUse<([(SettingsSection, [SettingsCellViewModel])]), Void> where M1.MatchedType == [(SettingsSection, [SettingsCellViewModel])] { - let matchers: [Cuckoo.ParameterMatcher<([(SettingsSection, [SettingsCellViewModel])])>] = [wrap(matchable: sections) { $0 }] - return cuckoo_manager.verify("reload(sections: [(SettingsSection, [SettingsCellViewModel])])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(SelectValidatorsStartViewModel), Void> where M1.MatchedType == SelectValidatorsStartViewModel { + let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsStartViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceive(viewModel: SelectValidatorsStartViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didLoad(userViewModel: M1) -> Cuckoo.__DoNotUse<(SettingsAccountViewModel), Void> where M1.MatchedType == SettingsAccountViewModel { - let matchers: [Cuckoo.ParameterMatcher<(SettingsAccountViewModel)>] = [wrap(matchable: userViewModel) { $0 }] - return cuckoo_manager.verify("didLoad(userViewModel: SettingsAccountViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SettingsViewProtocolStub: SettingsViewProtocol { + class SelectValidatorsStartViewProtocolStub: SelectValidatorsStartViewProtocol { @@ -25452,6 +24866,17 @@ import UIKit.UIImage } } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } @@ -25459,13 +24884,13 @@ import UIKit.UIImage - func reload(sections: [(SettingsSection, [SettingsCellViewModel])]) { + func didReceive(viewModel: SelectValidatorsStartViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didLoad(userViewModel: SettingsAccountViewModel) { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -25473,39 +24898,25 @@ import UIKit.UIImage - class MockSettingsPresenterProtocol: SettingsPresenterProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsStartPresenterProtocol: SelectValidatorsStartPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SettingsPresenterProtocol + typealias MocksType = SelectValidatorsStartPresenterProtocol - typealias Stubbing = __StubbingProxy_SettingsPresenterProtocol - typealias Verification = __VerificationProxy_SettingsPresenterProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsStartPresenterProtocol + typealias Verification = __VerificationProxy_SelectValidatorsStartPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SettingsPresenterProtocol? + private var __defaultImplStub: SelectValidatorsStartPresenterProtocol? - func enableDefaultImplementation(_ stub: SettingsPresenterProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsStartPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - var appNameText: String { - get { - return cuckoo_manager.getter("appNameText", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.appNameText) - } - - } - @@ -25527,51 +24938,66 @@ import UIKit.UIImage - func actionRow(_ row: SettingsRow) { + func updateOnAppearance() { - return cuckoo_manager.call("actionRow(_: SettingsRow)", - parameters: (row), - escapingParameters: (row), + return cuckoo_manager.call("updateOnAppearance()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.actionRow(row)) + defaultCall: __defaultImplStub!.updateOnAppearance()) } - func handleWalletAction() { + func selectRecommendedValidators() { - return cuckoo_manager.call("handleWalletAction()", + return cuckoo_manager.call("selectRecommendedValidators()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handleWalletAction()) + defaultCall: __defaultImplStub!.selectRecommendedValidators()) } - func handleSwitchAction() { + func selectCustomValidators() { - return cuckoo_manager.call("handleSwitchAction()", + return cuckoo_manager.call("selectCustomValidators()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handleSwitchAction()) + defaultCall: __defaultImplStub!.selectCustomValidators()) + + } + + + + func selectLearnMore() { + + return cuckoo_manager.call("selectLearnMore()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.selectLearnMore()) } - struct __StubbingProxy_SettingsPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsStartPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -25579,34 +25005,34 @@ import UIKit.UIImage } - var appNameText: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "appNameText") + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func updateOnAppearance() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "updateOnAppearance()", parameterMatchers: matchers)) } - func actionRow(_ row: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SettingsRow)> where M1.MatchedType == SettingsRow { - let matchers: [Cuckoo.ParameterMatcher<(SettingsRow)>] = [wrap(matchable: row) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsPresenterProtocol.self, method: "actionRow(_: SettingsRow)", parameterMatchers: matchers)) + func selectRecommendedValidators() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "selectRecommendedValidators()", parameterMatchers: matchers)) } - func handleWalletAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func selectCustomValidators() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsPresenterProtocol.self, method: "handleWalletAction()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "selectCustomValidators()", parameterMatchers: matchers)) } - func handleSwitchAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func selectLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsPresenterProtocol.self, method: "handleSwitchAction()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "selectLearnMore()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SettingsPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsStartPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -25618,11 +25044,6 @@ import UIKit.UIImage } - - var appNameText: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "appNameText", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult @@ -25632,36 +25053,33 @@ import UIKit.UIImage } @discardableResult - func actionRow(_ row: M1) -> Cuckoo.__DoNotUse<(SettingsRow), Void> where M1.MatchedType == SettingsRow { - let matchers: [Cuckoo.ParameterMatcher<(SettingsRow)>] = [wrap(matchable: row) { $0 }] - return cuckoo_manager.verify("actionRow(_: SettingsRow)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func updateOnAppearance() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("updateOnAppearance()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func handleWalletAction() -> Cuckoo.__DoNotUse<(), Void> { + func selectRecommendedValidators() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleWalletAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("selectRecommendedValidators()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func handleSwitchAction() -> Cuckoo.__DoNotUse<(), Void> { + func selectCustomValidators() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleSwitchAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("selectCustomValidators()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func selectLearnMore() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SettingsPresenterProtocolStub: SettingsPresenterProtocol { - - - - var appNameText: String { - get { - return DefaultValueRegistry.defaultValue(for: (String).self) - } - - } + class SelectValidatorsStartPresenterProtocolStub: SelectValidatorsStartPresenterProtocol { @@ -25675,19 +25093,25 @@ import UIKit.UIImage - func actionRow(_ row: SettingsRow) { + func updateOnAppearance() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func handleWalletAction() { + func selectRecommendedValidators() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func handleSwitchAction() { + func selectCustomValidators() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func selectLearnMore() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -25695,19 +25119,19 @@ import UIKit.UIImage - class MockSettingsViewModelFactoryProtocol: SettingsViewModelFactoryProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsStartInteractorInputProtocol: SelectValidatorsStartInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SettingsViewModelFactoryProtocol + typealias MocksType = SelectValidatorsStartInteractorInputProtocol - typealias Stubbing = __StubbingProxy_SettingsViewModelFactoryProtocol - typealias Verification = __VerificationProxy_SettingsViewModelFactoryProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsStartInteractorInputProtocol + typealias Verification = __VerificationProxy_SelectValidatorsStartInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SettingsViewModelFactoryProtocol? + private var __defaultImplStub: SelectValidatorsStartInteractorInputProtocol? - func enableDefaultImplementation(_ stub: SettingsViewModelFactoryProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsStartInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -25720,36 +25144,21 @@ import UIKit.UIImage - func createAccountViewModel(for wallet: MetaAccountModel) -> SettingsAccountViewModel { - - return cuckoo_manager.call("createAccountViewModel(for: MetaAccountModel) -> SettingsAccountViewModel", - parameters: (wallet), - escapingParameters: (wallet), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.createAccountViewModel(for: wallet)) - - } - - - - func createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])] { + func setup() { - return cuckoo_manager.call("createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])]", - parameters: (language, currency, locale), - escapingParameters: (language, currency, locale), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.createSectionViewModels(language: language, currency: currency, locale: locale)) + defaultCall: __defaultImplStub!.setup()) } - struct __StubbingProxy_SettingsViewModelFactoryProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsStartInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -25757,19 +25166,14 @@ import UIKit.UIImage } - func createAccountViewModel(for wallet: M1) -> Cuckoo.ProtocolStubFunction<(MetaAccountModel), SettingsAccountViewModel> where M1.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsViewModelFactoryProtocol.self, method: "createAccountViewModel(for: MetaAccountModel) -> SettingsAccountViewModel", parameterMatchers: matchers)) - } - - func createSectionViewModels(language: M1, currency: M2, locale: M3) -> Cuckoo.ProtocolStubFunction<(Language?, String?, Locale), [(SettingsSection, [SettingsCellViewModel])]> where M1.OptionalMatchedType == Language, M2.OptionalMatchedType == String, M3.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<(Language?, String?, Locale)>] = [wrap(matchable: language) { $0.0 }, wrap(matchable: currency) { $0.1 }, wrap(matchable: locale) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsViewModelFactoryProtocol.self, method: "createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])]", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SettingsViewModelFactoryProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsStartInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -25784,21 +25188,15 @@ import UIKit.UIImage @discardableResult - func createAccountViewModel(for wallet: M1) -> Cuckoo.__DoNotUse<(MetaAccountModel), SettingsAccountViewModel> where M1.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] - return cuckoo_manager.verify("createAccountViewModel(for: MetaAccountModel) -> SettingsAccountViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func createSectionViewModels(language: M1, currency: M2, locale: M3) -> Cuckoo.__DoNotUse<(Language?, String?, Locale), [(SettingsSection, [SettingsCellViewModel])]> where M1.OptionalMatchedType == Language, M2.OptionalMatchedType == String, M3.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<(Language?, String?, Locale)>] = [wrap(matchable: language) { $0.0 }, wrap(matchable: currency) { $0.1 }, wrap(matchable: locale) { $0.2 }] - return cuckoo_manager.verify("createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])]", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SettingsViewModelFactoryProtocolStub: SettingsViewModelFactoryProtocol { + class SelectValidatorsStartInteractorInputProtocolStub: SelectValidatorsStartInteractorInputProtocol { @@ -25806,33 +25204,27 @@ import UIKit.UIImage - func createAccountViewModel(for wallet: MetaAccountModel) -> SettingsAccountViewModel { - return DefaultValueRegistry.defaultValue(for: (SettingsAccountViewModel).self) - } - - - - func createSectionViewModels(language: Language?, currency: String?, locale: Locale) -> [(SettingsSection, [SettingsCellViewModel])] { - return DefaultValueRegistry.defaultValue(for: ([(SettingsSection, [SettingsCellViewModel])]).self) + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } } - class MockSettingsInteractorInputProtocol: SettingsInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsStartInteractorOutputProtocol: SelectValidatorsStartInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SettingsInteractorInputProtocol + typealias MocksType = SelectValidatorsStartInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_SettingsInteractorInputProtocol - typealias Verification = __VerificationProxy_SettingsInteractorInputProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsStartInteractorOutputProtocol + typealias Verification = __VerificationProxy_SelectValidatorsStartInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SettingsInteractorInputProtocol? + private var __defaultImplStub: SelectValidatorsStartInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: SettingsInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsStartInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -25845,21 +25237,36 @@ import UIKit.UIImage - func setup() { + func didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceiveValidators(result: result)) + + } + + + + func didReceiveMaxNominations(result: Result) { + + return cuckoo_manager.call("didReceiveMaxNominations(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMaxNominations(result: result)) } - struct __StubbingProxy_SettingsInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsStartInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -25867,14 +25274,19 @@ import UIKit.UIImage } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + func didReceiveValidators(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[ElectedValidatorInfo], Error>)> where M1.MatchedType == Result<[ElectedValidatorInfo], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[ElectedValidatorInfo], Error>)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartInteractorOutputProtocol.self, method: "didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>)", parameterMatchers: matchers)) + } + + func didReceiveMaxNominations(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartInteractorOutputProtocol.self, method: "didReceiveMaxNominations(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SettingsInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsStartInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -25889,15 +25301,21 @@ import UIKit.UIImage @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveValidators(result: M1) -> Cuckoo.__DoNotUse<(Result<[ElectedValidatorInfo], Error>), Void> where M1.MatchedType == Result<[ElectedValidatorInfo], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[ElectedValidatorInfo], Error>)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveMaxNominations(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMaxNominations(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SettingsInteractorInputProtocolStub: SettingsInteractorInputProtocol { + class SelectValidatorsStartInteractorOutputProtocolStub: SelectValidatorsStartInteractorOutputProtocol { @@ -25905,7 +25323,13 @@ import UIKit.UIImage - func setup() { + func didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveMaxNominations(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -25913,19 +25337,19 @@ import UIKit.UIImage - class MockSettingsInteractorOutputProtocol: SettingsInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockSelectValidatorsStartWireframeProtocol: SelectValidatorsStartWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SettingsInteractorOutputProtocol + typealias MocksType = SelectValidatorsStartWireframeProtocol - typealias Stubbing = __StubbingProxy_SettingsInteractorOutputProtocol - typealias Verification = __VerificationProxy_SettingsInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_SelectValidatorsStartWireframeProtocol + typealias Verification = __VerificationProxy_SelectValidatorsStartWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SettingsInteractorOutputProtocol? + private var __defaultImplStub: SelectValidatorsStartWireframeProtocol? - func enableDefaultImplementation(_ stub: SettingsInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: SelectValidatorsStartWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -25938,51 +25362,81 @@ import UIKit.UIImage - func didReceive(wallet: MetaAccountModel) { + func proceedToCustomList(from view: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams) { - return cuckoo_manager.call("didReceive(wallet: MetaAccountModel)", - parameters: (wallet), - escapingParameters: (wallet), + return cuckoo_manager.call("proceedToCustomList(from: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams)", + parameters: (view, selectionValidatorGroups, selectedValidatorList, validatorsSelectionParams), + escapingParameters: (view, selectionValidatorGroups, selectedValidatorList, validatorsSelectionParams), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(wallet: wallet)) + defaultCall: __defaultImplStub!.proceedToCustomList(from: view, selectionValidatorGroups: selectionValidatorGroups, selectedValidatorList: selectedValidatorList, validatorsSelectionParams: validatorsSelectionParams)) } - func didReceiveUserDataProvider(error: Error) { + func proceedToRecommendedList(from view: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int) { - return cuckoo_manager.call("didReceiveUserDataProvider(error: Error)", - parameters: (error), - escapingParameters: (error), + return cuckoo_manager.call("proceedToRecommendedList(from: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int)", + parameters: (view, validatorList, maxTargets), + escapingParameters: (view, validatorList, maxTargets), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveUserDataProvider(error: error)) + defaultCall: __defaultImplStub!.proceedToRecommendedList(from: view, validatorList: validatorList, maxTargets: maxTargets)) } - func didReceive(currencyCode: String) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return cuckoo_manager.call("didReceive(currencyCode: String)", - parameters: (currencyCode), - escapingParameters: (currencyCode), + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(currencyCode: currencyCode)) + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_SettingsInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectValidatorsStartWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -25990,24 +25444,34 @@ import UIKit.UIImage } - func didReceive(wallet: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaAccountModel)> where M1.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsInteractorOutputProtocol.self, method: "didReceive(wallet: MetaAccountModel)", parameterMatchers: matchers)) + func proceedToCustomList(from view: M1, selectionValidatorGroups: M2, selectedValidatorList: M3, validatorsSelectionParams: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, SelectionValidatorGroups, SharedList, ValidatorsSelectionParams)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == SelectionValidatorGroups, M3.MatchedType == SharedList, M4.MatchedType == ValidatorsSelectionParams { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, SelectionValidatorGroups, SharedList, ValidatorsSelectionParams)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: selectionValidatorGroups) { $0.1 }, wrap(matchable: selectedValidatorList) { $0.2 }, wrap(matchable: validatorsSelectionParams) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "proceedToCustomList(from: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams)", parameterMatchers: matchers)) } - func didReceiveUserDataProvider(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsInteractorOutputProtocol.self, method: "didReceiveUserDataProvider(error: Error)", parameterMatchers: matchers)) + func proceedToRecommendedList(from view: M1, validatorList: M2, maxTargets: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectValidatorsStartViewProtocol?, [SelectedValidatorInfo], Int)> where M1.OptionalMatchedType == SelectValidatorsStartViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsStartViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: validatorList) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "proceedToRecommendedList(from: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int)", parameterMatchers: matchers)) } - func didReceive(currencyCode: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: currencyCode) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsInteractorOutputProtocol.self, method: "didReceive(currencyCode: String)", parameterMatchers: matchers)) + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + } + + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SettingsInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectValidatorsStartWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -26022,310 +25486,21 @@ import UIKit.UIImage @discardableResult - func didReceive(wallet: M1) -> Cuckoo.__DoNotUse<(MetaAccountModel), Void> where M1.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: wallet) { $0 }] - return cuckoo_manager.verify("didReceive(wallet: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceedToCustomList(from view: M1, selectionValidatorGroups: M2, selectedValidatorList: M3, validatorsSelectionParams: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, SelectionValidatorGroups, SharedList, ValidatorsSelectionParams), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == SelectionValidatorGroups, M3.MatchedType == SharedList, M4.MatchedType == ValidatorsSelectionParams { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, SelectionValidatorGroups, SharedList, ValidatorsSelectionParams)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: selectionValidatorGroups) { $0.1 }, wrap(matchable: selectedValidatorList) { $0.2 }, wrap(matchable: validatorsSelectionParams) { $0.3 }] + return cuckoo_manager.verify("proceedToCustomList(from: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveUserDataProvider(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return cuckoo_manager.verify("didReceiveUserDataProvider(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceedToRecommendedList(from view: M1, validatorList: M2, maxTargets: M3) -> Cuckoo.__DoNotUse<(SelectValidatorsStartViewProtocol?, [SelectedValidatorInfo], Int), Void> where M1.OptionalMatchedType == SelectValidatorsStartViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsStartViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: validatorList) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] + return cuckoo_manager.verify("proceedToRecommendedList(from: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(currencyCode: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: currencyCode) { $0 }] - return cuckoo_manager.verify("didReceive(currencyCode: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class SettingsInteractorOutputProtocolStub: SettingsInteractorOutputProtocol { - - - - - - - - func didReceive(wallet: MetaAccountModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveUserDataProvider(error: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceive(currencyCode: String) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - - - class MockSettingsWireframeProtocol: SettingsWireframeProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = SettingsWireframeProtocol - - typealias Stubbing = __StubbingProxy_SettingsWireframeProtocol - typealias Verification = __VerificationProxy_SettingsWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: SettingsWireframeProtocol? - - func enableDefaultImplementation(_ stub: SettingsWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func showAccountDetails(for walletId: String, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("showAccountDetails(for: String, from: ControllerBackedProtocol?)", - parameters: (walletId, view), - escapingParameters: (walletId, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showAccountDetails(for: walletId, from: view)) - - } - - - - func showAccountSelection(from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("showAccountSelection(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showAccountSelection(from: view)) - - } - - - - func showLanguageSelection(from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("showLanguageSelection(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showLanguageSelection(from: view)) - - } - - - - func showPincodeChange(from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("showPincodeChange(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showPincodeChange(from: view)) - - } - - - - func showCurrencies(from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("showCurrencies(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showCurrencies(from: view)) - - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) - - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) - - } - - - - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) - - } - - - - func presentSuccessNotification(_ title: String, from view: ControllerBackedProtocol?, completion closure: (() -> Void)?) { - - return cuckoo_manager.call("presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", - parameters: (title, view, closure), - escapingParameters: (title, view, closure), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentSuccessNotification(title, from: view, completion: closure)) - - } - - - struct __StubbingProxy_SettingsWireframeProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func showAccountDetails(for walletId: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(String, ControllerBackedProtocol?)> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?)>] = [wrap(matchable: walletId) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showAccountDetails(for: String, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func showAccountSelection(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showAccountSelection(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func showLanguageSelection(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showLanguageSelection(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func showPincodeChange(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showPincodeChange(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func showCurrencies(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showCurrencies(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) - } - - func presentSuccessNotification(_ title: M1, from view: M2, completion closure: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(String, ControllerBackedProtocol?, (() -> Void)?)> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == (() -> Void) { - let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?, (() -> Void)?)>] = [wrap(matchable: title) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: closure) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSettingsWireframeProtocol.self, method: "presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_SettingsWireframeProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func showAccountDetails(for walletId: M1, from view: M2) -> Cuckoo.__DoNotUse<(String, ControllerBackedProtocol?), Void> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?)>] = [wrap(matchable: walletId) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("showAccountDetails(for: String, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func showAccountSelection(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showAccountSelection(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func showLanguageSelection(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showLanguageSelection(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func showPincodeChange(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showPincodeChange(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func showCurrencies(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showCurrencies(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -26340,22 +25515,10 @@ import UIKit.UIImage return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentSuccessNotification(_ title: M1, from view: M2, completion closure: M3) -> Cuckoo.__DoNotUse<(String, ControllerBackedProtocol?, (() -> Void)?), Void> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == (() -> Void) { - let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?, (() -> Void)?)>] = [wrap(matchable: title) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: closure) { $0.2 }] - return cuckoo_manager.verify("presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - } } - class SettingsWireframeProtocolStub: SettingsWireframeProtocol { + class SelectValidatorsStartWireframeProtocolStub: SelectValidatorsStartWireframeProtocol { @@ -26363,31 +25526,19 @@ import UIKit.UIImage - func showAccountDetails(for walletId: String, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showAccountSelection(from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showLanguageSelection(from view: ControllerBackedProtocol?) { + func proceedToCustomList(from view: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showPincodeChange(from view: ControllerBackedProtocol?) { + func proceedToRecommendedList(from view: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showCurrencies(from view: ControllerBackedProtocol?) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -26403,18 +25554,6 @@ import UIKit.UIImage return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentSuccessNotification(_ title: String, from view: ControllerBackedProtocol?, completion closure: (() -> Void)?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - } @@ -26424,19 +25563,19 @@ import Cuckoo import SoraFoundation - class MockAnalyticsRewardDetailsViewProtocol: AnalyticsRewardDetailsViewProtocol, Cuckoo.ProtocolMock { + class MockSelectedValidatorListViewProtocol: SelectedValidatorListViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = AnalyticsRewardDetailsViewProtocol + typealias MocksType = SelectedValidatorListViewProtocol - typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsViewProtocol - typealias Verification = __VerificationProxy_AnalyticsRewardDetailsViewProtocol + typealias Stubbing = __StubbingProxy_SelectedValidatorListViewProtocol + typealias Verification = __VerificationProxy_SelectedValidatorListViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: AnalyticsRewardDetailsViewProtocol? + private var __defaultImplStub: SelectedValidatorListViewProtocol? - func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsViewProtocol) { + func enableDefaultImplementation(_ stub: SelectedValidatorListViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -26501,16 +25640,31 @@ import SoraFoundation - func bind(viewModel: LocalizableResource) { + func didReload(_ viewModel: SelectedValidatorListViewModel) { - return cuckoo_manager.call("bind(viewModel: LocalizableResource)", + return cuckoo_manager.call("didReload(_: SelectedValidatorListViewModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.bind(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReload(viewModel)) + + } + + + + func didChangeViewModel(_ viewModel: SelectedValidatorListViewModel, byRemovingItemAt index: Int) { + + return cuckoo_manager.call("didChangeViewModel(_: SelectedValidatorListViewModel, byRemovingItemAt: Int)", + parameters: (viewModel, index), + escapingParameters: (viewModel, index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didChangeViewModel(viewModel, byRemovingItemAt: index)) } @@ -26530,7 +25684,7 @@ import SoraFoundation } - struct __StubbingProxy_AnalyticsRewardDetailsViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectedValidatorListViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -26538,34 +25692,39 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func bind(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsViewProtocol.self, method: "bind(viewModel: LocalizableResource)", parameterMatchers: matchers)) + func didReload(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorListViewModel)> where M1.MatchedType == SelectedValidatorListViewModel { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListViewProtocol.self, method: "didReload(_: SelectedValidatorListViewModel)", parameterMatchers: matchers)) + } + + func didChangeViewModel(_ viewModel: M1, byRemovingItemAt index: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorListViewModel, Int)> where M1.MatchedType == SelectedValidatorListViewModel, M2.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewModel, Int)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: index) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListViewProtocol.self, method: "didChangeViewModel(_: SelectedValidatorListViewModel, byRemovingItemAt: Int)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_AnalyticsRewardDetailsViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectedValidatorListViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -26595,9 +25754,15 @@ import SoraFoundation @discardableResult - func bind(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("bind(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReload(_ viewModel: M1) -> Cuckoo.__DoNotUse<(SelectedValidatorListViewModel), Void> where M1.MatchedType == SelectedValidatorListViewModel { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReload(_: SelectedValidatorListViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didChangeViewModel(_ viewModel: M1, byRemovingItemAt index: M2) -> Cuckoo.__DoNotUse<(SelectedValidatorListViewModel, Int), Void> where M1.MatchedType == SelectedValidatorListViewModel, M2.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewModel, Int)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: index) { $0.1 }] + return cuckoo_manager.verify("didChangeViewModel(_: SelectedValidatorListViewModel, byRemovingItemAt: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -26609,7 +25774,7 @@ import SoraFoundation } } - class AnalyticsRewardDetailsViewProtocolStub: AnalyticsRewardDetailsViewProtocol { + class SelectedValidatorListViewProtocolStub: SelectedValidatorListViewProtocol { @@ -26646,7 +25811,13 @@ import SoraFoundation - func bind(viewModel: LocalizableResource) { + func didReload(_ viewModel: SelectedValidatorListViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didChangeViewModel(_ viewModel: SelectedValidatorListViewModel, byRemovingItemAt index: Int) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -26660,19 +25831,19 @@ import SoraFoundation - class MockAnalyticsRewardDetailsPresenterProtocol: AnalyticsRewardDetailsPresenterProtocol, Cuckoo.ProtocolMock { + class MockSelectedValidatorListDelegate: SelectedValidatorListDelegate, Cuckoo.ProtocolMock { - typealias MocksType = AnalyticsRewardDetailsPresenterProtocol + typealias MocksType = SelectedValidatorListDelegate - typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsPresenterProtocol - typealias Verification = __VerificationProxy_AnalyticsRewardDetailsPresenterProtocol + typealias Stubbing = __StubbingProxy_SelectedValidatorListDelegate + typealias Verification = __VerificationProxy_SelectedValidatorListDelegate let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: AnalyticsRewardDetailsPresenterProtocol? + private var __defaultImplStub: SelectedValidatorListDelegate? - func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsPresenterProtocol) { + func enableDefaultImplementation(_ stub: SelectedValidatorListDelegate) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -26685,36 +25856,21 @@ import SoraFoundation - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func handleEventIdAction() { + func didRemove(_ validator: SelectedValidatorInfo) { - return cuckoo_manager.call("handleEventIdAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didRemove(_: SelectedValidatorInfo)", + parameters: (validator), + escapingParameters: (validator), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handleEventIdAction()) + defaultCall: __defaultImplStub!.didRemove(validator)) } - struct __StubbingProxy_AnalyticsRewardDetailsPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectedValidatorListDelegate: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -26722,19 +25878,14 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func handleEventIdAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsPresenterProtocol.self, method: "handleEventIdAction()", parameterMatchers: matchers)) + func didRemove(_ validator: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorInfo)> where M1.MatchedType == SelectedValidatorInfo { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo)>] = [wrap(matchable: validator) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListDelegate.self, method: "didRemove(_: SelectedValidatorInfo)", parameterMatchers: matchers)) } } - struct __VerificationProxy_AnalyticsRewardDetailsPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectedValidatorListDelegate: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -26749,21 +25900,15 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func handleEventIdAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleEventIdAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didRemove(_ validator: M1) -> Cuckoo.__DoNotUse<(SelectedValidatorInfo), Void> where M1.MatchedType == SelectedValidatorInfo { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo)>] = [wrap(matchable: validator) { $0 }] + return cuckoo_manager.verify("didRemove(_: SelectedValidatorInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class AnalyticsRewardDetailsPresenterProtocolStub: AnalyticsRewardDetailsPresenterProtocol { + class SelectedValidatorListDelegateStub: SelectedValidatorListDelegate { @@ -26771,13 +25916,7 @@ import SoraFoundation - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func handleEventIdAction() { + func didRemove(_ validator: SelectedValidatorInfo) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -26785,19 +25924,19 @@ import SoraFoundation - class MockAnalyticsRewardDetailsInteractorInputProtocol: AnalyticsRewardDetailsInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockSelectedValidatorListPresenterProtocol: SelectedValidatorListPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = AnalyticsRewardDetailsInteractorInputProtocol + typealias MocksType = SelectedValidatorListPresenterProtocol - typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsInteractorInputProtocol - typealias Verification = __VerificationProxy_AnalyticsRewardDetailsInteractorInputProtocol + typealias Stubbing = __StubbingProxy_SelectedValidatorListPresenterProtocol + typealias Verification = __VerificationProxy_SelectedValidatorListPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: AnalyticsRewardDetailsInteractorInputProtocol? + private var __defaultImplStub: SelectedValidatorListPresenterProtocol? - func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: SelectedValidatorListPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -26808,190 +25947,83 @@ import SoraFoundation - - struct __StubbingProxy_AnalyticsRewardDetailsInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - } - - struct __VerificationProxy_AnalyticsRewardDetailsInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - } -} - - class AnalyticsRewardDetailsInteractorInputProtocolStub: AnalyticsRewardDetailsInteractorInputProtocol { - - - - - -} - - - - class MockAnalyticsRewardDetailsInteractorOutputProtocol: AnalyticsRewardDetailsInteractorOutputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = AnalyticsRewardDetailsInteractorOutputProtocol - - typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsInteractorOutputProtocol - typealias Verification = __VerificationProxy_AnalyticsRewardDetailsInteractorOutputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: AnalyticsRewardDetailsInteractorOutputProtocol? - - func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsInteractorOutputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - struct __StubbingProxy_AnalyticsRewardDetailsInteractorOutputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - } - - struct __VerificationProxy_AnalyticsRewardDetailsInteractorOutputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - } -} - - class AnalyticsRewardDetailsInteractorOutputProtocolStub: AnalyticsRewardDetailsInteractorOutputProtocol { - - - - - -} - - - - class MockAnalyticsRewardDetailsWireframeProtocol: AnalyticsRewardDetailsWireframeProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = AnalyticsRewardDetailsWireframeProtocol - typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsWireframeProtocol - typealias Verification = __VerificationProxy_AnalyticsRewardDetailsWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: AnalyticsRewardDetailsWireframeProtocol? - - func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) + } - - - - - - - func presentSuccessNotification(_ title: String, from view: ControllerBackedProtocol?, completion closure: (() -> Void)?) { + func didSelectValidator(at index: Int) { - return cuckoo_manager.call("presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", - parameters: (title, view, closure), - escapingParameters: (title, view, closure), + return cuckoo_manager.call("didSelectValidator(at: Int)", + parameters: (index), + escapingParameters: (index), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentSuccessNotification(title, from: view, completion: closure)) + defaultCall: __defaultImplStub!.didSelectValidator(at: index)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func removeItem(at index: Int) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("removeItem(at: Int)", + parameters: (index), + escapingParameters: (index), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.removeItem(at: index)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func proceed() { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("proceed()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.proceed()) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func dismiss() { - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), + return cuckoo_manager.call("dismiss()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + defaultCall: __defaultImplStub!.dismiss()) } - struct __StubbingProxy_AnalyticsRewardDetailsWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectedValidatorListPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -26999,29 +26031,34 @@ import SoraFoundation } - func presentSuccessNotification(_ title: M1, from view: M2, completion closure: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(String, ControllerBackedProtocol?, (() -> Void)?)> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == (() -> Void) { - let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?, (() -> Void)?)>] = [wrap(matchable: title) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: closure) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsWireframeProtocol.self, method: "presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didSelectValidator(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "didSelectValidator(at: Int)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func removeItem(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "removeItem(at: Int)", parameterMatchers: matchers)) } - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + } + + func dismiss() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "dismiss()", parameterMatchers: matchers)) } } - struct __VerificationProxy_AnalyticsRewardDetailsWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectedValidatorListPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -27036,33 +26073,39 @@ import SoraFoundation @discardableResult - func presentSuccessNotification(_ title: M1, from view: M2, completion closure: M3) -> Cuckoo.__DoNotUse<(String, ControllerBackedProtocol?, (() -> Void)?), Void> where M1.MatchedType == String, M2.OptionalMatchedType == ControllerBackedProtocol, M3.OptionalMatchedType == (() -> Void) { - let matchers: [Cuckoo.ParameterMatcher<(String, ControllerBackedProtocol?, (() -> Void)?)>] = [wrap(matchable: title) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: closure) { $0.2 }] - return cuckoo_manager.verify("presentSuccessNotification(_: String, from: ControllerBackedProtocol?, completion: (() -> Void)?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didSelectValidator(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("didSelectValidator(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func removeItem(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("removeItem(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func dismiss() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("dismiss()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class AnalyticsRewardDetailsWireframeProtocolStub: AnalyticsRewardDetailsWireframeProtocol { + class SelectedValidatorListPresenterProtocolStub: SelectedValidatorListPresenterProtocol { @@ -27070,25 +26113,31 @@ import SoraFoundation - func presentSuccessNotification(_ title: String, from view: ControllerBackedProtocol?, completion closure: (() -> Void)?) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func didSelectValidator(at index: Int) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func removeItem(at index: Int) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func proceed() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func dismiss() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -27096,19 +26145,19 @@ import SoraFoundation - class MockAnalyticsRewardDetailsViewModelFactoryProtocol: AnalyticsRewardDetailsViewModelFactoryProtocol, Cuckoo.ProtocolMock { + class MockSelectedValidatorListViewModelFactoryProtocol: SelectedValidatorListViewModelFactoryProtocol, Cuckoo.ProtocolMock { - typealias MocksType = AnalyticsRewardDetailsViewModelFactoryProtocol + typealias MocksType = SelectedValidatorListViewModelFactoryProtocol - typealias Stubbing = __StubbingProxy_AnalyticsRewardDetailsViewModelFactoryProtocol - typealias Verification = __VerificationProxy_AnalyticsRewardDetailsViewModelFactoryProtocol + typealias Stubbing = __StubbingProxy_SelectedValidatorListViewModelFactoryProtocol + typealias Verification = __VerificationProxy_SelectedValidatorListViewModelFactoryProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: AnalyticsRewardDetailsViewModelFactoryProtocol? + private var __defaultImplStub: SelectedValidatorListViewModelFactoryProtocol? - func enableDefaultImplementation(_ stub: AnalyticsRewardDetailsViewModelFactoryProtocol) { + func enableDefaultImplementation(_ stub: SelectedValidatorListViewModelFactoryProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -27121,21 +26170,21 @@ import SoraFoundation - func createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource { + func createViewModel(from validatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel { - return cuckoo_manager.call("createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource", - parameters: (rewardModel), - escapingParameters: (rewardModel), + return cuckoo_manager.call("createViewModel(from: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel", + parameters: (validatorList, totalValidatorsCount, locale), + escapingParameters: (validatorList, totalValidatorsCount, locale), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.createViweModel(rewardModel: rewardModel)) + defaultCall: __defaultImplStub!.createViewModel(from: validatorList, totalValidatorsCount: totalValidatorsCount, locale: locale)) } - struct __StubbingProxy_AnalyticsRewardDetailsViewModelFactoryProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectedValidatorListViewModelFactoryProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -27143,14 +26192,14 @@ import SoraFoundation } - func createViweModel(rewardModel: M1) -> Cuckoo.ProtocolStubFunction<(AnalyticsRewardDetailsModel), LocalizableResource> where M1.MatchedType == AnalyticsRewardDetailsModel { - let matchers: [Cuckoo.ParameterMatcher<(AnalyticsRewardDetailsModel)>] = [wrap(matchable: rewardModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockAnalyticsRewardDetailsViewModelFactoryProtocol.self, method: "createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource", parameterMatchers: matchers)) + func createViewModel(from validatorList: M1, totalValidatorsCount: M2, locale: M3) -> Cuckoo.ProtocolStubFunction<([SelectedValidatorInfo], Int, Locale), SelectedValidatorListViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == Int, M3.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], Int, Locale)>] = [wrap(matchable: validatorList) { $0.0 }, wrap(matchable: totalValidatorsCount) { $0.1 }, wrap(matchable: locale) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListViewModelFactoryProtocol.self, method: "createViewModel(from: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel", parameterMatchers: matchers)) } } - struct __VerificationProxy_AnalyticsRewardDetailsViewModelFactoryProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectedValidatorListViewModelFactoryProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -27165,15 +26214,15 @@ import SoraFoundation @discardableResult - func createViweModel(rewardModel: M1) -> Cuckoo.__DoNotUse<(AnalyticsRewardDetailsModel), LocalizableResource> where M1.MatchedType == AnalyticsRewardDetailsModel { - let matchers: [Cuckoo.ParameterMatcher<(AnalyticsRewardDetailsModel)>] = [wrap(matchable: rewardModel) { $0 }] - return cuckoo_manager.verify("createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func createViewModel(from validatorList: M1, totalValidatorsCount: M2, locale: M3) -> Cuckoo.__DoNotUse<([SelectedValidatorInfo], Int, Locale), SelectedValidatorListViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == Int, M3.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], Int, Locale)>] = [wrap(matchable: validatorList) { $0.0 }, wrap(matchable: totalValidatorsCount) { $0.1 }, wrap(matchable: locale) { $0.2 }] + return cuckoo_manager.verify("createViewModel(from: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class AnalyticsRewardDetailsViewModelFactoryProtocolStub: AnalyticsRewardDetailsViewModelFactoryProtocol { + class SelectedValidatorListViewModelFactoryProtocolStub: SelectedValidatorListViewModelFactoryProtocol { @@ -27181,141 +26230,114 @@ import SoraFoundation - func createViweModel(rewardModel: AnalyticsRewardDetailsModel) -> LocalizableResource { - return DefaultValueRegistry.defaultValue(for: (LocalizableResource).self) + func createViewModel(from validatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel { + return DefaultValueRegistry.defaultValue(for: (SelectedValidatorListViewModel).self) } } -import Cuckoo -@testable import novawallet - -import SoraFoundation - - class MockControllerAccountViewProtocol: ControllerAccountViewProtocol, Cuckoo.ProtocolMock { + class MockSelectedValidatorListWireframeProtocol: SelectedValidatorListWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ControllerAccountViewProtocol + typealias MocksType = SelectedValidatorListWireframeProtocol - typealias Stubbing = __StubbingProxy_ControllerAccountViewProtocol - typealias Verification = __VerificationProxy_ControllerAccountViewProtocol + typealias Stubbing = __StubbingProxy_SelectedValidatorListWireframeProtocol + typealias Verification = __VerificationProxy_SelectedValidatorListWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ControllerAccountViewProtocol? + private var __defaultImplStub: SelectedValidatorListWireframeProtocol? - func enableDefaultImplementation(_ stub: ControllerAccountViewProtocol) { + func enableDefaultImplementation(_ stub: SelectedValidatorListWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } + - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func present(_ validatorInfo: ValidatorInfoProtocol, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", + parameters: (validatorInfo, view), + escapingParameters: (validatorInfo, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(validatorInfo, from: view)) } - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } + func proceed(from view: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int) { - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } + return cuckoo_manager.call("proceed(from: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", + parameters: (view, targets, maxTargets), + escapingParameters: (view, targets, maxTargets), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.proceed(from: view, targets: targets, maxTargets: maxTargets)) } - - - - - func reload(with viewModel: ControllerAccountViewModel) { + func dismiss(_ view: ControllerBackedProtocol?) { - return cuckoo_manager.call("reload(with: ControllerAccountViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("dismiss(_: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload(with: viewModel)) + defaultCall: __defaultImplStub!.dismiss(view)) } - func didCompleteControllerSelection() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didCompleteControllerSelection()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didCompleteControllerSelection()) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - public func applyLocalization() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_ControllerAccountViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_SelectedValidatorListWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -27323,39 +26345,34 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoProtocol, ControllerBackedProtocol?)> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") + func proceed(from view: M1, targets: M2, maxTargets: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)> where M1.OptionalMatchedType == SelectedValidatorListViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: targets) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "proceed(from: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", parameterMatchers: matchers)) } - - func reload(with viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerAccountViewModel)> where M1.MatchedType == ControllerAccountViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ControllerAccountViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountViewProtocol.self, method: "reload(with: ControllerAccountViewModel)", parameterMatchers: matchers)) + func dismiss(_ view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "dismiss(_: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func didCompleteControllerSelection() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountViewProtocol.self, method: "didCompleteControllerSelection()", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ControllerAccountViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_SelectedValidatorListWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -27367,294 +26384,196 @@ import SoraFoundation } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.__DoNotUse<(ValidatorInfoProtocol, ControllerBackedProtocol?), Void> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func proceed(from view: M1, targets: M2, maxTargets: M3) -> Cuckoo.__DoNotUse<(SelectedValidatorListViewProtocol?, [SelectedValidatorInfo], Int), Void> where M1.OptionalMatchedType == SelectedValidatorListViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: targets) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] + return cuckoo_manager.verify("proceed(from: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - @discardableResult - func reload(with viewModel: M1) -> Cuckoo.__DoNotUse<(ControllerAccountViewModel), Void> where M1.MatchedType == ControllerAccountViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ControllerAccountViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("reload(with: ControllerAccountViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func dismiss(_ view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("dismiss(_: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didCompleteControllerSelection() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didCompleteControllerSelection()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ControllerAccountViewProtocolStub: ControllerAccountViewProtocol { - - + class SelectedValidatorListWireframeProtocolStub: SelectedValidatorListWireframeProtocol { - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - + + - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - + func present(_ validatorInfo: ValidatorInfoProtocol, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - + + func proceed(from view: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func reload(with viewModel: ControllerAccountViewModel) { + func dismiss(_ view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didCompleteControllerSelection() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet - class MockControllerAccountViewModelFactoryProtocol: ControllerAccountViewModelFactoryProtocol, Cuckoo.ProtocolMock { +import Foundation +import SoraFoundation + + + class MockValidatorStakeInfoProtocol: ValidatorStakeInfoProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ControllerAccountViewModelFactoryProtocol + typealias MocksType = ValidatorStakeInfoProtocol - typealias Stubbing = __StubbingProxy_ControllerAccountViewModelFactoryProtocol - typealias Verification = __VerificationProxy_ControllerAccountViewModelFactoryProtocol + typealias Stubbing = __StubbingProxy_ValidatorStakeInfoProtocol + typealias Verification = __VerificationProxy_ValidatorStakeInfoProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ControllerAccountViewModelFactoryProtocol? + private var __defaultImplStub: ValidatorStakeInfoProtocol? - func enableDefaultImplementation(_ stub: ControllerAccountViewModelFactoryProtocol) { + func enableDefaultImplementation(_ stub: ValidatorStakeInfoProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - - - func createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel { - - return cuckoo_manager.call("createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel", - parameters: (stashItem, stashAccountItem, chosenAccountItem), - escapingParameters: (stashItem, stashAccountItem, chosenAccountItem), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.createViewModel(stashItem: stashItem, stashAccountItem: stashAccountItem, chosenAccountItem: chosenAccountItem)) + var nominators: [NominatorInfo] { + get { + return cuckoo_manager.getter("nominators", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.nominators) + } } - - struct __StubbingProxy_ControllerAccountViewModelFactoryProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func createViewModel(stashItem: M1, stashAccountItem: M2, chosenAccountItem: M3) -> Cuckoo.ProtocolStubFunction<(StashItem, MetaChainAccountResponse?, MetaChainAccountResponse?), ControllerAccountViewModel> where M1.MatchedType == StashItem, M2.OptionalMatchedType == MetaChainAccountResponse, M3.OptionalMatchedType == MetaChainAccountResponse { - let matchers: [Cuckoo.ParameterMatcher<(StashItem, MetaChainAccountResponse?, MetaChainAccountResponse?)>] = [wrap(matchable: stashItem) { $0.0 }, wrap(matchable: stashAccountItem) { $0.1 }, wrap(matchable: chosenAccountItem) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountViewModelFactoryProtocol.self, method: "createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ControllerAccountViewModelFactoryProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func createViewModel(stashItem: M1, stashAccountItem: M2, chosenAccountItem: M3) -> Cuckoo.__DoNotUse<(StashItem, MetaChainAccountResponse?, MetaChainAccountResponse?), ControllerAccountViewModel> where M1.MatchedType == StashItem, M2.OptionalMatchedType == MetaChainAccountResponse, M3.OptionalMatchedType == MetaChainAccountResponse { - let matchers: [Cuckoo.ParameterMatcher<(StashItem, MetaChainAccountResponse?, MetaChainAccountResponse?)>] = [wrap(matchable: stashItem) { $0.0 }, wrap(matchable: stashAccountItem) { $0.1 }, wrap(matchable: chosenAccountItem) { $0.2 }] - return cuckoo_manager.verify("createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ControllerAccountViewModelFactoryProtocolStub: ControllerAccountViewModelFactoryProtocol { - - - - - - - - func createViewModel(stashItem: StashItem, stashAccountItem: MetaChainAccountResponse?, chosenAccountItem: MetaChainAccountResponse?) -> ControllerAccountViewModel { - return DefaultValueRegistry.defaultValue(for: (ControllerAccountViewModel).self) - } - -} - - - - class MockControllerAccountPresenterProtocol: ControllerAccountPresenterProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = ControllerAccountPresenterProtocol - typealias Stubbing = __StubbingProxy_ControllerAccountPresenterProtocol - typealias Verification = __VerificationProxy_ControllerAccountPresenterProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ControllerAccountPresenterProtocol? - - func enableDefaultImplementation(_ stub: ControllerAccountPresenterProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + var totalStake: Decimal { + get { + return cuckoo_manager.getter("totalStake", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.totalStake) + } + } - - - - - - - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) + var ownStake: Decimal { + get { + return cuckoo_manager.getter("ownStake", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.ownStake) + } } - func handleStashAction() { - - return cuckoo_manager.call("handleStashAction()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.handleStashAction()) + var stakeReturn: Decimal { + get { + return cuckoo_manager.getter("stakeReturn", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.stakeReturn) + } } - func handleControllerAction() { - - return cuckoo_manager.call("handleControllerAction()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.handleControllerAction()) + var maxNominatorsRewarded: UInt32 { + get { + return cuckoo_manager.getter("maxNominatorsRewarded", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.maxNominatorsRewarded) + } } - func selectLearnMore() { - - return cuckoo_manager.call("selectLearnMore()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.selectLearnMore()) + var oversubscribed: Bool { + get { + return cuckoo_manager.getter("oversubscribed", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.oversubscribed) + } } + - - func proceed() { - - return cuckoo_manager.call("proceed()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.proceed()) - - } + - struct __StubbingProxy_ControllerAccountPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorStakeInfoProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -27662,34 +26581,39 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + var nominators: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "nominators") } - func handleStashAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "handleStashAction()", parameterMatchers: matchers)) + + var totalStake: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "totalStake") } - func handleControllerAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "handleControllerAction()", parameterMatchers: matchers)) + + var ownStake: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "ownStake") } - func selectLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "selectLearnMore()", parameterMatchers: matchers)) + + var stakeReturn: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "stakeReturn") } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + + var maxNominatorsRewarded: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "maxNominatorsRewarded") + } + + + var oversubscribed: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "oversubscribed") } + } - struct __VerificationProxy_ControllerAccountPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorStakeInfoProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -27701,166 +26625,242 @@ import SoraFoundation } - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var nominators: Cuckoo.VerifyReadOnlyProperty<[NominatorInfo]> { + return .init(manager: cuckoo_manager, name: "nominators", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func handleStashAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleStashAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var totalStake: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "totalStake", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func handleControllerAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleControllerAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var ownStake: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "ownStake", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func selectLearnMore() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var stakeReturn: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "stakeReturn", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var maxNominatorsRewarded: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "maxNominatorsRewarded", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var oversubscribed: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "oversubscribed", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + } } - class ControllerAccountPresenterProtocolStub: ControllerAccountPresenterProtocol { - - + class ValidatorStakeInfoProtocolStub: ValidatorStakeInfoProtocol { + - + var nominators: [NominatorInfo] { + get { + return DefaultValueRegistry.defaultValue(for: ([NominatorInfo]).self) + } + + } + - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var totalStake: Decimal { + get { + return DefaultValueRegistry.defaultValue(for: (Decimal).self) + } + } + - - func handleStashAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var ownStake: Decimal { + get { + return DefaultValueRegistry.defaultValue(for: (Decimal).self) + } + } + - - func handleControllerAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var stakeReturn: Decimal { + get { + return DefaultValueRegistry.defaultValue(for: (Decimal).self) + } + } + - - func selectLearnMore() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var maxNominatorsRewarded: UInt32 { + get { + return DefaultValueRegistry.defaultValue(for: (UInt32).self) + } + } + - - func proceed() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var oversubscribed: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + + + + } - class MockControllerAccountInteractorInputProtocol: ControllerAccountInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockValidatorInfoProtocol: ValidatorInfoProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ControllerAccountInteractorInputProtocol + typealias MocksType = ValidatorInfoProtocol - typealias Stubbing = __StubbingProxy_ControllerAccountInteractorInputProtocol - typealias Verification = __VerificationProxy_ControllerAccountInteractorInputProtocol + typealias Stubbing = __StubbingProxy_ValidatorInfoProtocol + typealias Verification = __VerificationProxy_ValidatorInfoProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ControllerAccountInteractorInputProtocol? + private var __defaultImplStub: ValidatorInfoProtocol? - func enableDefaultImplementation(_ stub: ControllerAccountInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: ValidatorInfoProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - + var address: String { + get { + return cuckoo_manager.getter("address", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.address) + } + + } - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) + + var identity: AccountIdentity? { + get { + return cuckoo_manager.getter("identity", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.identity) + } } - func estimateFee(for account: ChainAccountResponse) { + var stakeInfo: ValidatorStakeInfoProtocol? { + get { + return cuckoo_manager.getter("stakeInfo", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.stakeInfo) + } - return cuckoo_manager.call("estimateFee(for: ChainAccountResponse)", - parameters: (account), - escapingParameters: (account), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.estimateFee(for: account)) + } + + + + var myNomination: ValidatorMyNominationStatus? { + get { + return cuckoo_manager.getter("myNomination", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.myNomination) + } } - func fetchLedger(controllerAddress: AccountAddress) { + var totalStake: Decimal { + get { + return cuckoo_manager.getter("totalStake", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.totalStake) + } - return cuckoo_manager.call("fetchLedger(controllerAddress: AccountAddress)", - parameters: (controllerAddress), - escapingParameters: (controllerAddress), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.fetchLedger(controllerAddress: controllerAddress)) + } + + + + var ownStake: Decimal { + get { + return cuckoo_manager.getter("ownStake", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.ownStake) + } } - func fetchControllerAccountInfo(controllerAddress: AccountAddress) { + var hasSlashes: Bool { + get { + return cuckoo_manager.getter("hasSlashes", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.hasSlashes) + } - return cuckoo_manager.call("fetchControllerAccountInfo(controllerAddress: AccountAddress)", - parameters: (controllerAddress), - escapingParameters: (controllerAddress), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.fetchControllerAccountInfo(controllerAddress: controllerAddress)) + } + + + + var blocked: Bool { + get { + return cuckoo_manager.getter("blocked", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.blocked) + } } - struct __StubbingProxy_ControllerAccountInteractorInputProtocol: Cuckoo.StubbingProxy { + + + + + struct __StubbingProxy_ValidatorInfoProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -27868,29 +26868,49 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + var address: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "address") } - func estimateFee(for account: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainAccountResponse)> where M1.MatchedType == ChainAccountResponse { - let matchers: [Cuckoo.ParameterMatcher<(ChainAccountResponse)>] = [wrap(matchable: account) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorInputProtocol.self, method: "estimateFee(for: ChainAccountResponse)", parameterMatchers: matchers)) - } - func fetchLedger(controllerAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: controllerAddress) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorInputProtocol.self, method: "fetchLedger(controllerAddress: AccountAddress)", parameterMatchers: matchers)) + var identity: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "identity") } - func fetchControllerAccountInfo(controllerAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: controllerAddress) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorInputProtocol.self, method: "fetchControllerAccountInfo(controllerAddress: AccountAddress)", parameterMatchers: matchers)) + + var stakeInfo: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "stakeInfo") + } + + + var myNomination: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "myNomination") + } + + + var totalStake: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "totalStake") } + + var ownStake: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "ownStake") + } + + + var hasSlashes: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "hasSlashes") + } + + + var blocked: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "blocked") + } + + } - struct __VerificationProxy_ControllerAccountInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorInfoProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -27902,214 +26922,240 @@ import SoraFoundation } - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var address: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "address", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func estimateFee(for account: M1) -> Cuckoo.__DoNotUse<(ChainAccountResponse), Void> where M1.MatchedType == ChainAccountResponse { - let matchers: [Cuckoo.ParameterMatcher<(ChainAccountResponse)>] = [wrap(matchable: account) { $0 }] - return cuckoo_manager.verify("estimateFee(for: ChainAccountResponse)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var identity: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "identity", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func fetchLedger(controllerAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: controllerAddress) { $0 }] - return cuckoo_manager.verify("fetchLedger(controllerAddress: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var stakeInfo: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "stakeInfo", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func fetchControllerAccountInfo(controllerAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: controllerAddress) { $0 }] - return cuckoo_manager.verify("fetchControllerAccountInfo(controllerAddress: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var myNomination: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "myNomination", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var totalStake: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "totalStake", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var ownStake: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "ownStake", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var hasSlashes: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "hasSlashes", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var blocked: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "blocked", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + } } - class ControllerAccountInteractorInputProtocolStub: ControllerAccountInteractorInputProtocol { - - + class ValidatorInfoProtocolStub: ValidatorInfoProtocol { + - + var address: String { + get { + return DefaultValueRegistry.defaultValue(for: (String).self) + } + + } + - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var identity: AccountIdentity? { + get { + return DefaultValueRegistry.defaultValue(for: (AccountIdentity?).self) + } + } + + + var stakeInfo: ValidatorStakeInfoProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (ValidatorStakeInfoProtocol?).self) + } + + } + - func estimateFee(for account: ChainAccountResponse) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var myNomination: ValidatorMyNominationStatus? { + get { + return DefaultValueRegistry.defaultValue(for: (ValidatorMyNominationStatus?).self) + } + } + + + var totalStake: Decimal { + get { + return DefaultValueRegistry.defaultValue(for: (Decimal).self) + } + + } + - func fetchLedger(controllerAddress: AccountAddress) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var ownStake: Decimal { + get { + return DefaultValueRegistry.defaultValue(for: (Decimal).self) + } + } + + + var hasSlashes: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + - func fetchControllerAccountInfo(controllerAddress: AccountAddress) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var blocked: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + + + + } - class MockControllerAccountInteractorOutputProtocol: ControllerAccountInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockValidatorInfoViewProtocol: ValidatorInfoViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ControllerAccountInteractorOutputProtocol + typealias MocksType = ValidatorInfoViewProtocol - typealias Stubbing = __StubbingProxy_ControllerAccountInteractorOutputProtocol - typealias Verification = __VerificationProxy_ControllerAccountInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_ValidatorInfoViewProtocol + typealias Verification = __VerificationProxy_ValidatorInfoViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ControllerAccountInteractorOutputProtocol? + private var __defaultImplStub: ValidatorInfoViewProtocol? - func enableDefaultImplementation(_ stub: ControllerAccountInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: ValidatorInfoViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - - - - - func didReceiveStashItem(result: Result) { - - return cuckoo_manager.call("didReceiveStashItem(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) - - } - - - - func didReceiveStashAccount(result: Result) { - - return cuckoo_manager.call("didReceiveStashAccount(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveStashAccount(result: result)) - - } - - func didReceiveControllerAccount(result: Result) { - - return cuckoo_manager.call("didReceiveControllerAccount(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveControllerAccount(result: result)) + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } - func didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>) { - - return cuckoo_manager.call("didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAccounts(result: result)) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } - func didReceiveFee(result: Result) { + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } } + - - func didReceiveControllerAccountInfo(result: Result, address: AccountAddress) { - - return cuckoo_manager.call("didReceiveControllerAccountInfo(result: Result, address: AccountAddress)", - parameters: (result, address), - escapingParameters: (result, address), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveControllerAccountInfo(result: result, address: address)) - - } + - func didReceiveAccountInfo(result: Result, address: AccountAddress) { + func didRecieve(state: ValidatorInfoState) { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result, address: AccountAddress)", - parameters: (result, address), - escapingParameters: (result, address), + return cuckoo_manager.call("didRecieve(state: ValidatorInfoState)", + parameters: (state), + escapingParameters: (state), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result, address: address)) + defaultCall: __defaultImplStub!.didRecieve(state: state)) } - func didReceiveStakingLedger(result: Result) { + public func applyLocalization() { - return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_ControllerAccountInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorInfoViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -28117,49 +27163,34 @@ import SoraFoundation } - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func didReceiveStashAccount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveStashAccount(result: Result)", parameterMatchers: matchers)) - } - func didReceiveControllerAccount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveControllerAccount(result: Result)", parameterMatchers: matchers)) + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func didReceiveAccounts(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[MetaChainAccountResponse], Error>)> where M1.MatchedType == Result<[MetaChainAccountResponse], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[MetaChainAccountResponse], Error>)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", parameterMatchers: matchers)) - } - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - func didReceiveControllerAccountInfo(result: M1, address: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Result, AccountAddress)> where M1.MatchedType == Result, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(Result, AccountAddress)>] = [wrap(matchable: result) { $0.0 }, wrap(matchable: address) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveControllerAccountInfo(result: Result, address: AccountAddress)", parameterMatchers: matchers)) - } - func didReceiveAccountInfo(result: M1, address: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Result, AccountAddress)> where M1.MatchedType == Result, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(Result, AccountAddress)>] = [wrap(matchable: result) { $0.0 }, wrap(matchable: address) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result, address: AccountAddress)", parameterMatchers: matchers)) + func didRecieve(state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoState)> where M1.MatchedType == ValidatorInfoState { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoState)>] = [wrap(matchable: state) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoViewProtocol.self, method: "didRecieve(state: ValidatorInfoState)", parameterMatchers: matchers)) } - func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_ControllerAccountInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorInfoViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -28171,110 +27202,82 @@ import SoraFoundation } - - @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceiveStashAccount(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashAccount(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveControllerAccount(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveControllerAccount(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceiveAccounts(result: M1) -> Cuckoo.__DoNotUse<(Result<[MetaChainAccountResponse], Error>), Void> where M1.MatchedType == Result<[MetaChainAccountResponse], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[MetaChainAccountResponse], Error>)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceiveControllerAccountInfo(result: M1, address: M2) -> Cuckoo.__DoNotUse<(Result, AccountAddress), Void> where M1.MatchedType == Result, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(Result, AccountAddress)>] = [wrap(matchable: result) { $0.0 }, wrap(matchable: address) { $0.1 }] - return cuckoo_manager.verify("didReceiveControllerAccountInfo(result: Result, address: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } + @discardableResult - func didReceiveAccountInfo(result: M1, address: M2) -> Cuckoo.__DoNotUse<(Result, AccountAddress), Void> where M1.MatchedType == Result, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(Result, AccountAddress)>] = [wrap(matchable: result) { $0.0 }, wrap(matchable: address) { $0.1 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result, address: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didRecieve(state: M1) -> Cuckoo.__DoNotUse<(ValidatorInfoState), Void> where M1.MatchedType == ValidatorInfoState { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoState)>] = [wrap(matchable: state) { $0 }] + return cuckoo_manager.verify("didRecieve(state: ValidatorInfoState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ControllerAccountInteractorOutputProtocolStub: ControllerAccountInteractorOutputProtocol { - - - - - - - - func didReceiveStashItem(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveStashAccount(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - + class ValidatorInfoViewProtocolStub: ValidatorInfoViewProtocol { + - func didReceiveControllerAccount(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + - - func didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + - - func didReceiveFee(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + } + - - func didReceiveControllerAccountInfo(result: Result, address: AccountAddress) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceiveAccountInfo(result: Result, address: AccountAddress) { + func didRecieve(state: ValidatorInfoState) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStakingLedger(result: Result) { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -28282,19 +27285,19 @@ import SoraFoundation - class MockControllerAccountWireframeProtocol: ControllerAccountWireframeProtocol, Cuckoo.ProtocolMock { + class MockValidatorInfoInteractorInputProtocol: ValidatorInfoInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ControllerAccountWireframeProtocol + typealias MocksType = ValidatorInfoInteractorInputProtocol - typealias Stubbing = __StubbingProxy_ControllerAccountWireframeProtocol - typealias Verification = __VerificationProxy_ControllerAccountWireframeProtocol + typealias Stubbing = __StubbingProxy_ValidatorInfoInteractorInputProtocol + typealias Verification = __VerificationProxy_ValidatorInfoInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ControllerAccountWireframeProtocol? + private var __defaultImplStub: ValidatorInfoInteractorInputProtocol? - func enableDefaultImplementation(_ stub: ControllerAccountWireframeProtocol) { + func enableDefaultImplementation(_ stub: ValidatorInfoInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -28307,96 +27310,36 @@ import SoraFoundation - func showConfirmation(from view: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse) { - - return cuckoo_manager.call("showConfirmation(from: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse)", - parameters: (view, controllerAccountItem), - escapingParameters: (view, controllerAccountItem), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showConfirmation(from: view, controllerAccountItem: controllerAccountItem)) - - } - - - - func close(view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("close(view: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.close(view: view)) - - } - - - - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func setup() { - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + defaultCall: __defaultImplStub!.setup()) } - func presentAccountSelection(_ accounts: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from view: ControllerBackedProtocol?, context: AnyObject?) { + func reload() { - return cuckoo_manager.call("presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", - parameters: (accounts, selectedAccountItem, title, delegate, view, context), - escapingParameters: (accounts, selectedAccountItem, title, delegate, view, context), + return cuckoo_manager.call("reload()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentAccountSelection(accounts, selectedAccountItem: selectedAccountItem, title: title, delegate: delegate, from: view, context: context)) - - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) - - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.reload()) } - struct __StubbingProxy_ControllerAccountWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorInfoInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -28404,39 +27347,19 @@ import SoraFoundation } - func showConfirmation(from view: M1, controllerAccountItem: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, MetaChainAccountResponse)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaChainAccountResponse { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaChainAccountResponse)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: controllerAccountItem) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "showConfirmation(from: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse)", parameterMatchers: matchers)) - } - - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "close(view: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) - } - - func presentAccountSelection(_ accounts: M1, selectedAccountItem: M2, title: M3, delegate: M4, from view: M5, context: M6) -> Cuckoo.ProtocolStubNoReturnFunction<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)> where M1.MatchedType == [MetaChainAccountResponse], M2.OptionalMatchedType == MetaChainAccountResponse, M3.MatchedType == LocalizableResource, M4.MatchedType == ModalPickerViewControllerDelegate, M5.OptionalMatchedType == ControllerBackedProtocol, M6.OptionalMatchedType == AnyObject { - let matchers: [Cuckoo.ParameterMatcher<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)>] = [wrap(matchable: accounts) { $0.0 }, wrap(matchable: selectedAccountItem) { $0.1 }, wrap(matchable: title) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: view) { $0.4 }, wrap(matchable: context) { $0.5 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", parameterMatchers: matchers)) - } - - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockControllerAccountWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorInputProtocol.self, method: "reload()", parameterMatchers: matchers)) } } - struct __VerificationProxy_ControllerAccountWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorInfoInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -28451,45 +27374,21 @@ import SoraFoundation @discardableResult - func showConfirmation(from view: M1, controllerAccountItem: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, MetaChainAccountResponse), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaChainAccountResponse { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaChainAccountResponse)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: controllerAccountItem) { $0.1 }] - return cuckoo_manager.verify("showConfirmation(from: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentAccountSelection(_ accounts: M1, selectedAccountItem: M2, title: M3, delegate: M4, from view: M5, context: M6) -> Cuckoo.__DoNotUse<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?), Void> where M1.MatchedType == [MetaChainAccountResponse], M2.OptionalMatchedType == MetaChainAccountResponse, M3.MatchedType == LocalizableResource, M4.MatchedType == ModalPickerViewControllerDelegate, M5.OptionalMatchedType == ControllerBackedProtocol, M6.OptionalMatchedType == AnyObject { - let matchers: [Cuckoo.ParameterMatcher<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)>] = [wrap(matchable: accounts) { $0.0 }, wrap(matchable: selectedAccountItem) { $0.1 }, wrap(matchable: title) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: view) { $0.4 }, wrap(matchable: context) { $0.5 }] - return cuckoo_manager.verify("presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ControllerAccountWireframeProtocolStub: ControllerAccountWireframeProtocol { + class ValidatorInfoInteractorInputProtocolStub: ValidatorInfoInteractorInputProtocol { @@ -28497,64 +27396,33 @@ import SoraFoundation - func showConfirmation(from view: ControllerBackedProtocol?, controllerAccountItem: MetaChainAccountResponse) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func close(view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentAccountSelection(_ accounts: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from view: ControllerBackedProtocol?, context: AnyObject?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func reload() { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import BigInt -import Foundation -import RobinHood - - class MockNetworkStakingInfoOperationFactoryProtocol: NetworkStakingInfoOperationFactoryProtocol, Cuckoo.ProtocolMock { + class MockValidatorInfoInteractorOutputProtocol: ValidatorInfoInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = NetworkStakingInfoOperationFactoryProtocol + typealias MocksType = ValidatorInfoInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_NetworkStakingInfoOperationFactoryProtocol - typealias Verification = __VerificationProxy_NetworkStakingInfoOperationFactoryProtocol + typealias Stubbing = __StubbingProxy_ValidatorInfoInteractorOutputProtocol + typealias Verification = __VerificationProxy_ValidatorInfoInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: NetworkStakingInfoOperationFactoryProtocol? + private var __defaultImplStub: ValidatorInfoInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: NetworkStakingInfoOperationFactoryProtocol) { + func enableDefaultImplementation(_ stub: ValidatorInfoInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -28567,21 +27435,51 @@ import RobinHood - func networkStakingOperation(for eraValidatorService: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("networkStakingOperation(for: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper", - parameters: (eraValidatorService, runtimeService), - escapingParameters: (eraValidatorService, runtimeService), + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.networkStakingOperation(for: eraValidatorService, runtimeService: runtimeService)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + + } + + + + func didStartLoadingValidatorInfo() { + + return cuckoo_manager.call("didStartLoadingValidatorInfo()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStartLoadingValidatorInfo()) + + } + + + + func didReceiveValidatorInfo(result: Result) { + + return cuckoo_manager.call("didReceiveValidatorInfo(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveValidatorInfo(result: result)) } - struct __StubbingProxy_NetworkStakingInfoOperationFactoryProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorInfoInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -28589,14 +27487,24 @@ import RobinHood } - func networkStakingOperation(for eraValidatorService: M1, runtimeService: M2) -> Cuckoo.ProtocolStubFunction<(EraValidatorServiceProtocol, RuntimeCodingServiceProtocol), CompoundOperationWrapper> where M1.MatchedType == EraValidatorServiceProtocol, M2.MatchedType == RuntimeCodingServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(EraValidatorServiceProtocol, RuntimeCodingServiceProtocol)>] = [wrap(matchable: eraValidatorService) { $0.0 }, wrap(matchable: runtimeService) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockNetworkStakingInfoOperationFactoryProtocol.self, method: "networkStakingOperation(for: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + } + + func didStartLoadingValidatorInfo() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorOutputProtocol.self, method: "didStartLoadingValidatorInfo()", parameterMatchers: matchers)) + } + + func didReceiveValidatorInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorOutputProtocol.self, method: "didReceiveValidatorInfo(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_NetworkStakingInfoOperationFactoryProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorInfoInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -28611,15 +27519,27 @@ import RobinHood @discardableResult - func networkStakingOperation(for eraValidatorService: M1, runtimeService: M2) -> Cuckoo.__DoNotUse<(EraValidatorServiceProtocol, RuntimeCodingServiceProtocol), CompoundOperationWrapper> where M1.MatchedType == EraValidatorServiceProtocol, M2.MatchedType == RuntimeCodingServiceProtocol { - let matchers: [Cuckoo.ParameterMatcher<(EraValidatorServiceProtocol, RuntimeCodingServiceProtocol)>] = [wrap(matchable: eraValidatorService) { $0.0 }, wrap(matchable: runtimeService) { $0.1 }] - return cuckoo_manager.verify("networkStakingOperation(for: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStartLoadingValidatorInfo() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoadingValidatorInfo()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveValidatorInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveValidatorInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class NetworkStakingInfoOperationFactoryProtocolStub: NetworkStakingInfoOperationFactoryProtocol { + class ValidatorInfoInteractorOutputProtocolStub: ValidatorInfoInteractorOutputProtocol { @@ -28627,33 +27547,39 @@ import RobinHood - func networkStakingOperation(for eraValidatorService: EraValidatorServiceProtocol, runtimeService: RuntimeCodingServiceProtocol) -> CompoundOperationWrapper { - return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper).self) + func didReceivePriceData(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStartLoadingValidatorInfo() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveValidatorInfo(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import Foundation -import RobinHood - - class MockValidatorOperationFactoryProtocol: ValidatorOperationFactoryProtocol, Cuckoo.ProtocolMock { + class MockValidatorInfoPresenterProtocol: ValidatorInfoPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorOperationFactoryProtocol + typealias MocksType = ValidatorInfoPresenterProtocol - typealias Stubbing = __StubbingProxy_ValidatorOperationFactoryProtocol - typealias Verification = __VerificationProxy_ValidatorOperationFactoryProtocol + typealias Stubbing = __StubbingProxy_ValidatorInfoPresenterProtocol + typealias Verification = __VerificationProxy_ValidatorInfoPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorOperationFactoryProtocol? + private var __defaultImplStub: ValidatorInfoPresenterProtocol? - func enableDefaultImplementation(_ stub: ValidatorOperationFactoryProtocol) { + func enableDefaultImplementation(_ stub: ValidatorInfoPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -28666,81 +27592,81 @@ import RobinHood - func allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]> { + func setup() { - return cuckoo_manager.call("allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]>", + return cuckoo_manager.call("setup()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.allElectedOperation()) + defaultCall: __defaultImplStub!.setup()) } - func allSelectedOperation(by nomination: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { + func reload() { - return cuckoo_manager.call("allSelectedOperation(by: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", - parameters: (nomination, nominatorAddress), - escapingParameters: (nomination, nominatorAddress), + return cuckoo_manager.call("reload()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.allSelectedOperation(by: nomination, nominatorAddress: nominatorAddress)) + defaultCall: __defaultImplStub!.reload()) } - func activeValidatorsOperation(for nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { + func presentAccountOptions() { - return cuckoo_manager.call("activeValidatorsOperation(for: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", - parameters: (nominatorAddress), - escapingParameters: (nominatorAddress), + return cuckoo_manager.call("presentAccountOptions()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.activeValidatorsOperation(for: nominatorAddress)) + defaultCall: __defaultImplStub!.presentAccountOptions()) } - func pendingValidatorsOperation(for accountIds: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { + func presentTotalStake() { - return cuckoo_manager.call("pendingValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", - parameters: (accountIds), - escapingParameters: (accountIds), + return cuckoo_manager.call("presentTotalStake()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.pendingValidatorsOperation(for: accountIds)) + defaultCall: __defaultImplStub!.presentTotalStake()) } - func wannabeValidatorsOperation(for accountIdList: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { + func presentIdentityItem(_ value: ValidatorInfoViewModel.IdentityItemValue) { - return cuckoo_manager.call("wannabeValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", - parameters: (accountIdList), - escapingParameters: (accountIdList), + return cuckoo_manager.call("presentIdentityItem(_: ValidatorInfoViewModel.IdentityItemValue)", + parameters: (value), + escapingParameters: (value), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.wannabeValidatorsOperation(for: accountIdList)) + defaultCall: __defaultImplStub!.presentIdentityItem(value)) } - struct __StubbingProxy_ValidatorOperationFactoryProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorInfoPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -28748,34 +27674,34 @@ import RobinHood } - func allElectedOperation() -> Cuckoo.ProtocolStubFunction<(), CompoundOperationWrapper<[ElectedValidatorInfo]>> { + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]>", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func allSelectedOperation(by nomination: M1, nominatorAddress: M2) -> Cuckoo.ProtocolStubFunction<(Nomination, AccountAddress), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == Nomination, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(Nomination, AccountAddress)>] = [wrap(matchable: nomination) { $0.0 }, wrap(matchable: nominatorAddress) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "allSelectedOperation(by: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", parameterMatchers: matchers)) + func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "reload()", parameterMatchers: matchers)) } - func activeValidatorsOperation(for nominatorAddress: M1) -> Cuckoo.ProtocolStubFunction<(AccountAddress), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: nominatorAddress) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "activeValidatorsOperation(for: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", parameterMatchers: matchers)) + func presentAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "presentAccountOptions()", parameterMatchers: matchers)) } - func pendingValidatorsOperation(for accountIds: M1) -> Cuckoo.ProtocolStubFunction<([AccountId]), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == [AccountId] { - let matchers: [Cuckoo.ParameterMatcher<([AccountId])>] = [wrap(matchable: accountIds) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "pendingValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", parameterMatchers: matchers)) + func presentTotalStake() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "presentTotalStake()", parameterMatchers: matchers)) } - func wannabeValidatorsOperation(for accountIdList: M1) -> Cuckoo.ProtocolStubFunction<([AccountId]), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == [AccountId] { - let matchers: [Cuckoo.ParameterMatcher<([AccountId])>] = [wrap(matchable: accountIdList) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorOperationFactoryProtocol.self, method: "wannabeValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", parameterMatchers: matchers)) + func presentIdentityItem(_ value: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoViewModel.IdentityItemValue)> where M1.MatchedType == ValidatorInfoViewModel.IdentityItemValue { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoViewModel.IdentityItemValue)>] = [wrap(matchable: value) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "presentIdentityItem(_: ValidatorInfoViewModel.IdentityItemValue)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ValidatorOperationFactoryProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorInfoPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -28790,39 +27716,39 @@ import RobinHood @discardableResult - func allElectedOperation() -> Cuckoo.__DoNotUse<(), CompoundOperationWrapper<[ElectedValidatorInfo]>> { + func setup() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func allSelectedOperation(by nomination: M1, nominatorAddress: M2) -> Cuckoo.__DoNotUse<(Nomination, AccountAddress), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == Nomination, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(Nomination, AccountAddress)>] = [wrap(matchable: nomination) { $0.0 }, wrap(matchable: nominatorAddress) { $0.1 }] - return cuckoo_manager.verify("allSelectedOperation(by: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func activeValidatorsOperation(for nominatorAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: nominatorAddress) { $0 }] - return cuckoo_manager.verify("activeValidatorsOperation(for: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func pendingValidatorsOperation(for accountIds: M1) -> Cuckoo.__DoNotUse<([AccountId]), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == [AccountId] { - let matchers: [Cuckoo.ParameterMatcher<([AccountId])>] = [wrap(matchable: accountIds) { $0 }] - return cuckoo_manager.verify("pendingValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentTotalStake() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentTotalStake()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func wannabeValidatorsOperation(for accountIdList: M1) -> Cuckoo.__DoNotUse<([AccountId]), CompoundOperationWrapper<[SelectedValidatorInfo]>> where M1.MatchedType == [AccountId] { - let matchers: [Cuckoo.ParameterMatcher<([AccountId])>] = [wrap(matchable: accountIdList) { $0 }] - return cuckoo_manager.verify("wannabeValidatorsOperation(for: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]>", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentIdentityItem(_ value: M1) -> Cuckoo.__DoNotUse<(ValidatorInfoViewModel.IdentityItemValue), Void> where M1.MatchedType == ValidatorInfoViewModel.IdentityItemValue { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoViewModel.IdentityItemValue)>] = [wrap(matchable: value) { $0 }] + return cuckoo_manager.verify("presentIdentityItem(_: ValidatorInfoViewModel.IdentityItemValue)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ValidatorOperationFactoryProtocolStub: ValidatorOperationFactoryProtocol { + class ValidatorInfoPresenterProtocolStub: ValidatorInfoPresenterProtocol { @@ -28830,145 +27756,284 @@ import RobinHood - func allElectedOperation() -> CompoundOperationWrapper<[ElectedValidatorInfo]> { - return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[ElectedValidatorInfo]>).self) + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func allSelectedOperation(by nomination: Nomination, nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { - return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[SelectedValidatorInfo]>).self) + func reload() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func activeValidatorsOperation(for nominatorAddress: AccountAddress) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { - return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[SelectedValidatorInfo]>).self) + func presentAccountOptions() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func pendingValidatorsOperation(for accountIds: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { - return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[SelectedValidatorInfo]>).self) + func presentTotalStake() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func wannabeValidatorsOperation(for accountIdList: [AccountId]) -> CompoundOperationWrapper<[SelectedValidatorInfo]> { - return DefaultValueRegistry.defaultValue(for: (CompoundOperationWrapper<[SelectedValidatorInfo]>).self) + func presentIdentityItem(_ value: ValidatorInfoViewModel.IdentityItemValue) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import SoraFoundation - - class MockCustomValidatorListViewProtocol: CustomValidatorListViewProtocol, Cuckoo.ProtocolMock { + class MockValidatorInfoWireframeProtocol: ValidatorInfoWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CustomValidatorListViewProtocol + typealias MocksType = ValidatorInfoWireframeProtocol - typealias Stubbing = __StubbingProxy_CustomValidatorListViewProtocol - typealias Verification = __VerificationProxy_CustomValidatorListViewProtocol + typealias Stubbing = __StubbingProxy_ValidatorInfoWireframeProtocol + typealias Verification = __VerificationProxy_ValidatorInfoWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CustomValidatorListViewProtocol? + private var __defaultImplStub: ValidatorInfoWireframeProtocol? - func enableDefaultImplementation(_ stub: CustomValidatorListViewProtocol) { + func enableDefaultImplementation(_ stub: ValidatorInfoWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } + + struct __StubbingProxy_ValidatorInfoWireframeProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + } + + struct __VerificationProxy_ValidatorInfoWireframeProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + } +} + + class ValidatorInfoWireframeProtocolStub: ValidatorInfoWireframeProtocol { + + - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - - } +} + + +import Cuckoo +@testable import novawallet + +import SoraFoundation + + + class MockValidatorListFilterWireframeProtocol: ValidatorListFilterWireframeProtocol, Cuckoo.ProtocolMock { + typealias MocksType = ValidatorListFilterWireframeProtocol + typealias Stubbing = __StubbingProxy_ValidatorListFilterWireframeProtocol + typealias Verification = __VerificationProxy_ValidatorListFilterWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } - - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - + private var __defaultImplStub: ValidatorListFilterWireframeProtocol? + + func enableDefaultImplementation(_ stub: ValidatorListFilterWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func reload(_ viewModel: CustomValidatorListViewModel, at indexes: [Int]?) { + func close(_ view: ControllerBackedProtocol?) { - return cuckoo_manager.call("reload(_: CustomValidatorListViewModel, at: [Int]?)", - parameters: (viewModel, indexes), - escapingParameters: (viewModel, indexes), + return cuckoo_manager.call("close(_: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload(viewModel, at: indexes)) + defaultCall: __defaultImplStub!.close(view)) } + + struct __StubbingProxy_ValidatorListFilterWireframeProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func close(_ view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterWireframeProtocol.self, method: "close(_: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_ValidatorListFilterWireframeProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func close(_ view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(_: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class ValidatorListFilterWireframeProtocolStub: ValidatorListFilterWireframeProtocol { + + + + + + + + func close(_ view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + + class MockValidatorListFilterViewProtocol: ValidatorListFilterViewProtocol, Cuckoo.ProtocolMock { + typealias MocksType = ValidatorListFilterViewProtocol - func setFilterAppliedState(to state: Bool) { + typealias Stubbing = __StubbingProxy_ValidatorListFilterViewProtocol + typealias Verification = __VerificationProxy_ValidatorListFilterViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: ValidatorListFilterViewProtocol? + + func enableDefaultImplementation(_ stub: ValidatorListFilterViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } - return cuckoo_manager.call("setFilterAppliedState(to: Bool)", - parameters: (state), - escapingParameters: (state), + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + + } + + + + + + + + func didUpdateViewModel(_ viewModel: ValidatorListFilterViewModel) { + + return cuckoo_manager.call("didUpdateViewModel(_: ValidatorListFilterViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setFilterAppliedState(to: state)) + defaultCall: __defaultImplStub!.didUpdateViewModel(viewModel)) } @@ -28988,7 +28053,7 @@ import SoraFoundation } - struct __StubbingProxy_CustomValidatorListViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorListFilterViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -28996,39 +28061,34 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func reload(_ viewModel: M1, at indexes: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(CustomValidatorListViewModel, [Int]?)> where M1.MatchedType == CustomValidatorListViewModel, M2.OptionalMatchedType == [Int] { - let matchers: [Cuckoo.ParameterMatcher<(CustomValidatorListViewModel, [Int]?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: indexes) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListViewProtocol.self, method: "reload(_: CustomValidatorListViewModel, at: [Int]?)", parameterMatchers: matchers)) - } - - func setFilterAppliedState(to state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: state) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListViewProtocol.self, method: "setFilterAppliedState(to: Bool)", parameterMatchers: matchers)) + func didUpdateViewModel(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorListFilterViewModel)> where M1.MatchedType == ValidatorListFilterViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterViewProtocol.self, method: "didUpdateViewModel(_: ValidatorListFilterViewModel)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CustomValidatorListViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorListFilterViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -29058,15 +28118,9 @@ import SoraFoundation @discardableResult - func reload(_ viewModel: M1, at indexes: M2) -> Cuckoo.__DoNotUse<(CustomValidatorListViewModel, [Int]?), Void> where M1.MatchedType == CustomValidatorListViewModel, M2.OptionalMatchedType == [Int] { - let matchers: [Cuckoo.ParameterMatcher<(CustomValidatorListViewModel, [Int]?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: indexes) { $0.1 }] - return cuckoo_manager.verify("reload(_: CustomValidatorListViewModel, at: [Int]?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func setFilterAppliedState(to state: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: state) { $0 }] - return cuckoo_manager.verify("setFilterAppliedState(to: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didUpdateViewModel(_ viewModel: M1) -> Cuckoo.__DoNotUse<(ValidatorListFilterViewModel), Void> where M1.MatchedType == ValidatorListFilterViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didUpdateViewModel(_: ValidatorListFilterViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -29078,7 +28132,7 @@ import SoraFoundation } } - class CustomValidatorListViewProtocolStub: CustomValidatorListViewProtocol { + class ValidatorListFilterViewProtocolStub: ValidatorListFilterViewProtocol { @@ -29115,13 +28169,7 @@ import SoraFoundation - func reload(_ viewModel: CustomValidatorListViewModel, at indexes: [Int]?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func setFilterAppliedState(to state: Bool) { + func didUpdateViewModel(_ viewModel: ValidatorListFilterViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -29135,181 +28183,169 @@ import SoraFoundation - class MockCustomValidatorListPresenterProtocol: CustomValidatorListPresenterProtocol, Cuckoo.ProtocolMock { + class MockValidatorListFilterPresenterProtocol: ValidatorListFilterPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CustomValidatorListPresenterProtocol + typealias MocksType = ValidatorListFilterPresenterProtocol - typealias Stubbing = __StubbingProxy_CustomValidatorListPresenterProtocol - typealias Verification = __VerificationProxy_CustomValidatorListPresenterProtocol + typealias Stubbing = __StubbingProxy_ValidatorListFilterPresenterProtocol + typealias Verification = __VerificationProxy_ValidatorListFilterPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CustomValidatorListPresenterProtocol? + private var __defaultImplStub: ValidatorListFilterPresenterProtocol? - func enableDefaultImplementation(_ stub: CustomValidatorListPresenterProtocol) { + func enableDefaultImplementation(_ stub: ValidatorListFilterPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - - - func setup() { + var view: ValidatorListFilterViewProtocol? { + get { + return cuckoo_manager.getter("view", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.view) + } - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) + set { + cuckoo_manager.setter("view", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.view = newValue) + } } - func fillWithRecommended() { + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } - return cuckoo_manager.call("fillWithRecommended()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.fillWithRecommended()) + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } } + - - func clearFilter() { - - return cuckoo_manager.call("clearFilter()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.clearFilter()) - - } + - func deselectAll() { + func setup() { - return cuckoo_manager.call("deselectAll()", + return cuckoo_manager.call("setup()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.deselectAll()) + defaultCall: __defaultImplStub!.setup()) } - func changeValidatorSelection(at index: Int) { + func toggleFilter(for viewModel: ValidatorListFilterCellViewModel) { - return cuckoo_manager.call("changeValidatorSelection(at: Int)", - parameters: (index), - escapingParameters: (index), + return cuckoo_manager.call("toggleFilter(for: ValidatorListFilterCellViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.changeValidatorSelection(at: index)) + defaultCall: __defaultImplStub!.toggleFilter(for: viewModel)) } - func didSelectValidator(at index: Int) { + func selectSorting(for viewModel: ValidatorListFilterCellViewModel) { - return cuckoo_manager.call("didSelectValidator(at: Int)", - parameters: (index), - escapingParameters: (index), + return cuckoo_manager.call("selectSorting(for: ValidatorListFilterCellViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSelectValidator(at: index)) + defaultCall: __defaultImplStub!.selectSorting(for: viewModel)) } - func presentFilter() { + func applyFilter() { - return cuckoo_manager.call("presentFilter()", + return cuckoo_manager.call("applyFilter()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentFilter()) + defaultCall: __defaultImplStub!.applyFilter()) } - func presentSearch() { + func resetFilter() { - return cuckoo_manager.call("presentSearch()", + return cuckoo_manager.call("resetFilter()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentSearch()) + defaultCall: __defaultImplStub!.resetFilter()) } - func proceed() { + public func applyLocalization() { - return cuckoo_manager.call("proceed()", + return cuckoo_manager.call("applyLocalization()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) - - } - - - - func didRemove(_ validator: SelectedValidatorInfo) { - - return cuckoo_manager.call("didRemove(_: SelectedValidatorInfo)", - parameters: (validator), - escapingParameters: (validator), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didRemove(validator)) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_CustomValidatorListPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorListFilterPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -29317,59 +28353,49 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + var view: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "view") } - func fillWithRecommended() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "fillWithRecommended()", parameterMatchers: matchers)) - } - func clearFilter() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "clearFilter()", parameterMatchers: matchers)) + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - func deselectAll() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "deselectAll()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func changeValidatorSelection(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "changeValidatorSelection(at: Int)", parameterMatchers: matchers)) + func toggleFilter(for viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorListFilterCellViewModel)> where M1.MatchedType == ValidatorListFilterCellViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterCellViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "toggleFilter(for: ValidatorListFilterCellViewModel)", parameterMatchers: matchers)) } - func didSelectValidator(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "didSelectValidator(at: Int)", parameterMatchers: matchers)) + func selectSorting(for viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorListFilterCellViewModel)> where M1.MatchedType == ValidatorListFilterCellViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterCellViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "selectSorting(for: ValidatorListFilterCellViewModel)", parameterMatchers: matchers)) } - func presentFilter() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func applyFilter() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "presentFilter()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "applyFilter()", parameterMatchers: matchers)) } - func presentSearch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func resetFilter() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "presentSearch()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "resetFilter()", parameterMatchers: matchers)) } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) - } - - func didRemove(_ validator: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorInfo)> where M1.MatchedType == SelectedValidatorInfo { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo)>] = [wrap(matchable: validator) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListPresenterProtocol.self, method: "didRemove(_: SelectedValidatorInfo)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_CustomValidatorListPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorListFilterPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -29381,134 +28407,118 @@ import SoraFoundation } - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var view: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "view", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func fillWithRecommended() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("fillWithRecommended()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func clearFilter() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("clearFilter()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + @discardableResult - func deselectAll() -> Cuckoo.__DoNotUse<(), Void> { + func setup() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("deselectAll()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func changeValidatorSelection(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("changeValidatorSelection(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func toggleFilter(for viewModel: M1) -> Cuckoo.__DoNotUse<(ValidatorListFilterCellViewModel), Void> where M1.MatchedType == ValidatorListFilterCellViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterCellViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("toggleFilter(for: ValidatorListFilterCellViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didSelectValidator(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("didSelectValidator(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectSorting(for viewModel: M1) -> Cuckoo.__DoNotUse<(ValidatorListFilterCellViewModel), Void> where M1.MatchedType == ValidatorListFilterCellViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterCellViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("selectSorting(for: ValidatorListFilterCellViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentFilter() -> Cuckoo.__DoNotUse<(), Void> { + func applyFilter() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentFilter()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyFilter()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentSearch() -> Cuckoo.__DoNotUse<(), Void> { + func resetFilter() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentSearch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("resetFilter()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didRemove(_ validator: M1) -> Cuckoo.__DoNotUse<(SelectedValidatorInfo), Void> where M1.MatchedType == SelectedValidatorInfo { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo)>] = [wrap(matchable: validator) { $0 }] - return cuckoo_manager.verify("didRemove(_: SelectedValidatorInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CustomValidatorListPresenterProtocolStub: CustomValidatorListPresenterProtocol { - - - - - - - - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - + class ValidatorListFilterPresenterProtocolStub: ValidatorListFilterPresenterProtocol { + - func fillWithRecommended() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var view: ValidatorListFilterViewProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (ValidatorListFilterViewProtocol?).self) + } + + set { } + } + - - func clearFilter() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + } + - - func deselectAll() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func changeValidatorSelection(at index: Int) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didSelectValidator(at index: Int) { + func toggleFilter(for viewModel: ValidatorListFilterCellViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentFilter() { + func selectSorting(for viewModel: ValidatorListFilterCellViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentSearch() { + func applyFilter() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func proceed() { + func resetFilter() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didRemove(_ validator: SelectedValidatorInfo) { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -29516,19 +28526,19 @@ import SoraFoundation - class MockCustomValidatorListViewModelFactoryProtocol: CustomValidatorListViewModelFactoryProtocol, Cuckoo.ProtocolMock { + class MockValidatorListFilterDelegate: ValidatorListFilterDelegate, Cuckoo.ProtocolMock { - typealias MocksType = CustomValidatorListViewModelFactoryProtocol + typealias MocksType = ValidatorListFilterDelegate - typealias Stubbing = __StubbingProxy_CustomValidatorListViewModelFactoryProtocol - typealias Verification = __VerificationProxy_CustomValidatorListViewModelFactoryProtocol + typealias Stubbing = __StubbingProxy_ValidatorListFilterDelegate + typealias Verification = __VerificationProxy_ValidatorListFilterDelegate let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CustomValidatorListViewModelFactoryProtocol? + private var __defaultImplStub: ValidatorListFilterDelegate? - func enableDefaultImplementation(_ stub: CustomValidatorListViewModelFactoryProtocol) { + func enableDefaultImplementation(_ stub: ValidatorListFilterDelegate) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -29541,114 +28551,21 @@ import SoraFoundation - func createViewModel(from validatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel { + func didUpdate(_ filter: CustomValidatorListFilter) { - return cuckoo_manager.call("createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel", - parameters: (validatorList, selectedValidatorList, totalValidatorsCount, filter, priceData, locale), - escapingParameters: (validatorList, selectedValidatorList, totalValidatorsCount, filter, priceData, locale), + return cuckoo_manager.call("didUpdate(_: CustomValidatorListFilter)", + parameters: (filter), + escapingParameters: (filter), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.createViewModel(from: validatorList, selectedValidatorList: selectedValidatorList, totalValidatorsCount: totalValidatorsCount, filter: filter, priceData: priceData, locale: locale)) - - } - - - struct __StubbingProxy_CustomValidatorListViewModelFactoryProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func createViewModel(from validatorList: M1, selectedValidatorList: M2, totalValidatorsCount: M3, filter: M4, priceData: M5, locale: M6) -> Cuckoo.ProtocolStubFunction<([SelectedValidatorInfo], [SelectedValidatorInfo], Int, CustomValidatorListFilter, PriceData?, Locale), CustomValidatorListViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int, M4.MatchedType == CustomValidatorListFilter, M5.OptionalMatchedType == PriceData, M6.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], [SelectedValidatorInfo], Int, CustomValidatorListFilter, PriceData?, Locale)>] = [wrap(matchable: validatorList) { $0.0 }, wrap(matchable: selectedValidatorList) { $0.1 }, wrap(matchable: totalValidatorsCount) { $0.2 }, wrap(matchable: filter) { $0.3 }, wrap(matchable: priceData) { $0.4 }, wrap(matchable: locale) { $0.5 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListViewModelFactoryProtocol.self, method: "createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_CustomValidatorListViewModelFactoryProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func createViewModel(from validatorList: M1, selectedValidatorList: M2, totalValidatorsCount: M3, filter: M4, priceData: M5, locale: M6) -> Cuckoo.__DoNotUse<([SelectedValidatorInfo], [SelectedValidatorInfo], Int, CustomValidatorListFilter, PriceData?, Locale), CustomValidatorListViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int, M4.MatchedType == CustomValidatorListFilter, M5.OptionalMatchedType == PriceData, M6.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], [SelectedValidatorInfo], Int, CustomValidatorListFilter, PriceData?, Locale)>] = [wrap(matchable: validatorList) { $0.0 }, wrap(matchable: selectedValidatorList) { $0.1 }, wrap(matchable: totalValidatorsCount) { $0.2 }, wrap(matchable: filter) { $0.3 }, wrap(matchable: priceData) { $0.4 }, wrap(matchable: locale) { $0.5 }] - return cuckoo_manager.verify("createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class CustomValidatorListViewModelFactoryProtocolStub: CustomValidatorListViewModelFactoryProtocol { - - - - - - - - func createViewModel(from validatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, filter: CustomValidatorListFilter, priceData: PriceData?, locale: Locale) -> CustomValidatorListViewModel { - return DefaultValueRegistry.defaultValue(for: (CustomValidatorListViewModel).self) - } - -} - - - - class MockCustomValidatorListInteractorInputProtocol: CustomValidatorListInteractorInputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = CustomValidatorListInteractorInputProtocol - - typealias Stubbing = __StubbingProxy_CustomValidatorListInteractorInputProtocol - typealias Verification = __VerificationProxy_CustomValidatorListInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: CustomValidatorListInteractorInputProtocol? - - func enableDefaultImplementation(_ stub: CustomValidatorListInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didUpdate(filter)) } - struct __StubbingProxy_CustomValidatorListInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorListFilterDelegate: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -29656,14 +28573,14 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + func didUpdate(_ filter: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CustomValidatorListFilter)> where M1.MatchedType == CustomValidatorListFilter { + let matchers: [Cuckoo.ParameterMatcher<(CustomValidatorListFilter)>] = [wrap(matchable: filter) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterDelegate.self, method: "didUpdate(_: CustomValidatorListFilter)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CustomValidatorListInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorListFilterDelegate: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -29678,15 +28595,15 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didUpdate(_ filter: M1) -> Cuckoo.__DoNotUse<(CustomValidatorListFilter), Void> where M1.MatchedType == CustomValidatorListFilter { + let matchers: [Cuckoo.ParameterMatcher<(CustomValidatorListFilter)>] = [wrap(matchable: filter) { $0 }] + return cuckoo_manager.verify("didUpdate(_: CustomValidatorListFilter)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class CustomValidatorListInteractorInputProtocolStub: CustomValidatorListInteractorInputProtocol { + class ValidatorListFilterDelegateStub: ValidatorListFilterDelegate { @@ -29694,120 +28611,32 @@ import SoraFoundation - func setup() { + func didUpdate(_ filter: CustomValidatorListFilter) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet - class MockCustomValidatorListInteractorOutputProtocol: CustomValidatorListInteractorOutputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = CustomValidatorListInteractorOutputProtocol - - typealias Stubbing = __StubbingProxy_CustomValidatorListInteractorOutputProtocol - typealias Verification = __VerificationProxy_CustomValidatorListInteractorOutputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: CustomValidatorListInteractorOutputProtocol? - - func enableDefaultImplementation(_ stub: CustomValidatorListInteractorOutputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func didReceivePriceData(result: Result) { - - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) - - } - - - struct __StubbingProxy_CustomValidatorListInteractorOutputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_CustomValidatorListInteractorOutputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class CustomValidatorListInteractorOutputProtocolStub: CustomValidatorListInteractorOutputProtocol { - - - - - - - - func didReceivePriceData(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - +import SoraFoundation - class MockCustomValidatorListWireframeProtocol: CustomValidatorListWireframeProtocol, Cuckoo.ProtocolMock { + class MockValidatorSearchWireframeProtocol: ValidatorSearchWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = CustomValidatorListWireframeProtocol + typealias MocksType = ValidatorSearchWireframeProtocol - typealias Stubbing = __StubbingProxy_CustomValidatorListWireframeProtocol - typealias Verification = __VerificationProxy_CustomValidatorListWireframeProtocol + typealias Stubbing = __StubbingProxy_ValidatorSearchWireframeProtocol + typealias Verification = __VerificationProxy_ValidatorSearchWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: CustomValidatorListWireframeProtocol? + private var __defaultImplStub: ValidatorSearchWireframeProtocol? - func enableDefaultImplementation(_ stub: CustomValidatorListWireframeProtocol) { + func enableDefaultImplementation(_ stub: ValidatorSearchWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -29835,46 +28664,16 @@ import SoraFoundation - func presentFilters(from view: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?) { - - return cuckoo_manager.call("presentFilters(from: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?)", - parameters: (view, filter, hasIdentity, delegate), - escapingParameters: (view, filter, hasIdentity, delegate), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentFilters(from: view, filter: filter, hasIdentity: hasIdentity, delegate: delegate)) - - } - - - - func presentSearch(from view: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?) { - - return cuckoo_manager.call("presentSearch(from: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?)", - parameters: (view, fullValidatorList, selectedValidatorList, delegate), - escapingParameters: (view, fullValidatorList, selectedValidatorList, delegate), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.presentSearch(from: view, fullValidatorList: fullValidatorList, selectedValidatorList: selectedValidatorList, delegate: delegate)) - - } - - - - func proceed(from view: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate) { + func close(_ view: ControllerBackedProtocol?) { - return cuckoo_manager.call("proceed(from: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate)", - parameters: (view, validatorList, maxTargets, delegate), - escapingParameters: (view, validatorList, maxTargets, delegate), + return cuckoo_manager.call("close(_: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed(from: view, validatorList: validatorList, maxTargets: maxTargets, delegate: delegate)) + defaultCall: __defaultImplStub!.close(view)) } @@ -29909,7 +28708,7 @@ import SoraFoundation } - struct __StubbingProxy_CustomValidatorListWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorSearchWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -29919,37 +28718,27 @@ import SoraFoundation func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoProtocol, ControllerBackedProtocol?)> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func presentFilters(from view: M1, filter: M2, hasIdentity: M3, delegate: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, CustomValidatorListFilter, Bool, ValidatorListFilterDelegate?)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == CustomValidatorListFilter, M3.MatchedType == Bool, M4.OptionalMatchedType == ValidatorListFilterDelegate { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, CustomValidatorListFilter, Bool, ValidatorListFilterDelegate?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: filter) { $0.1 }, wrap(matchable: hasIdentity) { $0.2 }, wrap(matchable: delegate) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "presentFilters(from: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?)", parameterMatchers: matchers)) - } - - func presentSearch(from view: M1, fullValidatorList: M2, selectedValidatorList: M3, delegate: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, [SelectedValidatorInfo], [SelectedValidatorInfo], ValidatorSearchDelegate?)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == [SelectedValidatorInfo], M4.OptionalMatchedType == ValidatorSearchDelegate { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, [SelectedValidatorInfo], [SelectedValidatorInfo], ValidatorSearchDelegate?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: fullValidatorList) { $0.1 }, wrap(matchable: selectedValidatorList) { $0.2 }, wrap(matchable: delegate) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "presentSearch(from: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchWireframeProtocol.self, method: "present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func proceed(from view: M1, validatorList: M2, maxTargets: M3, delegate: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, [SelectedValidatorInfo], Int, SelectedValidatorListDelegate)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int, M4.MatchedType == SelectedValidatorListDelegate { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, [SelectedValidatorInfo], Int, SelectedValidatorListDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: validatorList) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }, wrap(matchable: delegate) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "proceed(from: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate)", parameterMatchers: matchers)) + func close(_ view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchWireframeProtocol.self, method: "close(_: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockCustomValidatorListWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_CustomValidatorListWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorSearchWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -29970,21 +28759,9 @@ import SoraFoundation } @discardableResult - func presentFilters(from view: M1, filter: M2, hasIdentity: M3, delegate: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, CustomValidatorListFilter, Bool, ValidatorListFilterDelegate?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == CustomValidatorListFilter, M3.MatchedType == Bool, M4.OptionalMatchedType == ValidatorListFilterDelegate { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, CustomValidatorListFilter, Bool, ValidatorListFilterDelegate?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: filter) { $0.1 }, wrap(matchable: hasIdentity) { $0.2 }, wrap(matchable: delegate) { $0.3 }] - return cuckoo_manager.verify("presentFilters(from: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentSearch(from view: M1, fullValidatorList: M2, selectedValidatorList: M3, delegate: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, [SelectedValidatorInfo], [SelectedValidatorInfo], ValidatorSearchDelegate?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == [SelectedValidatorInfo], M4.OptionalMatchedType == ValidatorSearchDelegate { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, [SelectedValidatorInfo], [SelectedValidatorInfo], ValidatorSearchDelegate?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: fullValidatorList) { $0.1 }, wrap(matchable: selectedValidatorList) { $0.2 }, wrap(matchable: delegate) { $0.3 }] - return cuckoo_manager.verify("presentSearch(from: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func proceed(from view: M1, validatorList: M2, maxTargets: M3, delegate: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, [SelectedValidatorInfo], Int, SelectedValidatorListDelegate), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int, M4.MatchedType == SelectedValidatorListDelegate { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, [SelectedValidatorInfo], Int, SelectedValidatorListDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: validatorList) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }, wrap(matchable: delegate) { $0.3 }] - return cuckoo_manager.verify("proceed(from: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close(_ view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(_: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -30002,7 +28779,7 @@ import SoraFoundation } } - class CustomValidatorListWireframeProtocolStub: CustomValidatorListWireframeProtocol { + class ValidatorSearchWireframeProtocolStub: ValidatorSearchWireframeProtocol { @@ -30016,56 +28793,132 @@ import SoraFoundation - func presentFilters(from view: ControllerBackedProtocol?, filter: CustomValidatorListFilter, hasIdentity: Bool, delegate: ValidatorListFilterDelegate?) { + func close(_ view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentSearch(from view: ControllerBackedProtocol?, fullValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], delegate: ValidatorSearchDelegate?) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func proceed(from view: ControllerBackedProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int, delegate: SelectedValidatorListDelegate) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockValidatorSearchDelegate: ValidatorSearchDelegate, Cuckoo.ProtocolMock { + typealias MocksType = ValidatorSearchDelegate - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + typealias Stubbing = __StubbingProxy_ValidatorSearchDelegate + typealias Verification = __VerificationProxy_ValidatorSearchDelegate + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: ValidatorSearchDelegate? + + func enableDefaultImplementation(_ stub: ValidatorSearchDelegate) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + + + + + func validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo]) { + + return cuckoo_manager.call("validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo])", + parameters: (selectedValidatorList), + escapingParameters: (selectedValidatorList), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.validatorSearchDidUpdate(selectedValidatorList: selectedValidatorList)) + } + + struct __StubbingProxy_ValidatorSearchDelegate: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func validatorSearchDidUpdate(selectedValidatorList: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([SelectedValidatorInfo])> where M1.MatchedType == [SelectedValidatorInfo] { + let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo])>] = [wrap(matchable: selectedValidatorList) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchDelegate.self, method: "validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo])", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_ValidatorSearchDelegate: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func validatorSearchDidUpdate(selectedValidatorList: M1) -> Cuckoo.__DoNotUse<([SelectedValidatorInfo]), Void> where M1.MatchedType == [SelectedValidatorInfo] { + let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo])>] = [wrap(matchable: selectedValidatorList) { $0 }] + return cuckoo_manager.verify("validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } } + class ValidatorSearchDelegateStub: ValidatorSearchDelegate { + -import Cuckoo -@testable import novawallet + -import SoraFoundation + + + + func validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo]) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} - class MockRecommendedValidatorListViewProtocol: RecommendedValidatorListViewProtocol, Cuckoo.ProtocolMock { + + class MockValidatorSearchViewProtocol: ValidatorSearchViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = RecommendedValidatorListViewProtocol + typealias MocksType = ValidatorSearchViewProtocol - typealias Stubbing = __StubbingProxy_RecommendedValidatorListViewProtocol - typealias Verification = __VerificationProxy_RecommendedValidatorListViewProtocol + typealias Stubbing = __StubbingProxy_ValidatorSearchViewProtocol + typealias Verification = __VerificationProxy_ValidatorSearchViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: RecommendedValidatorListViewProtocol? + private var __defaultImplStub: ValidatorSearchViewProtocol? - func enableDefaultImplementation(_ stub: RecommendedValidatorListViewProtocol) { + func enableDefaultImplementation(_ stub: ValidatorSearchViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -30130,16 +28983,61 @@ import SoraFoundation - func didReceive(viewModel: RecommendedValidatorListViewModelProtocol) { + func didReload(_ viewModel: ValidatorSearchViewModel) { - return cuckoo_manager.call("didReceive(viewModel: RecommendedValidatorListViewModelProtocol)", + return cuckoo_manager.call("didReload(_: ValidatorSearchViewModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReload(viewModel)) + + } + + + + func didStartSearch() { + + return cuckoo_manager.call("didStartSearch()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStartSearch()) + + } + + + + func didStopSearch() { + + return cuckoo_manager.call("didStopSearch()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStopSearch()) + + } + + + + func didReset() { + + return cuckoo_manager.call("didReset()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReset()) } @@ -30159,7 +29057,7 @@ import SoraFoundation } - struct __StubbingProxy_RecommendedValidatorListViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorSearchViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -30167,34 +29065,49 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RecommendedValidatorListViewModelProtocol)> where M1.MatchedType == RecommendedValidatorListViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(RecommendedValidatorListViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListViewProtocol.self, method: "didReceive(viewModel: RecommendedValidatorListViewModelProtocol)", parameterMatchers: matchers)) + func didReload(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorSearchViewModel)> where M1.MatchedType == ValidatorSearchViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorSearchViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "didReload(_: ValidatorSearchViewModel)", parameterMatchers: matchers)) + } + + func didStartSearch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "didStartSearch()", parameterMatchers: matchers)) + } + + func didStopSearch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "didStopSearch()", parameterMatchers: matchers)) + } + + func didReset() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "didReset()", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_RecommendedValidatorListViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorSearchViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -30224,21 +29137,39 @@ import SoraFoundation @discardableResult - func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(RecommendedValidatorListViewModelProtocol), Void> where M1.MatchedType == RecommendedValidatorListViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(RecommendedValidatorListViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceive(viewModel: RecommendedValidatorListViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReload(_ viewModel: M1) -> Cuckoo.__DoNotUse<(ValidatorSearchViewModel), Void> where M1.MatchedType == ValidatorSearchViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorSearchViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReload(_: ValidatorSearchViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + func didStartSearch() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("didStartSearch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - } -} - - class RecommendedValidatorListViewProtocolStub: RecommendedValidatorListViewProtocol { + @discardableResult + func didStopSearch() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopSearch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReset() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didReset()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class ValidatorSearchViewProtocolStub: ValidatorSearchViewProtocol { @@ -30275,7 +29206,25 @@ import SoraFoundation - func didReceive(viewModel: RecommendedValidatorListViewModelProtocol) { + func didReload(_ viewModel: ValidatorSearchViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStartSearch() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStopSearch() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReset() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -30289,19 +29238,19 @@ import SoraFoundation - class MockRecommendedValidatorListPresenterProtocol: RecommendedValidatorListPresenterProtocol, Cuckoo.ProtocolMock { + class MockValidatorSearchInteractorInputProtocol: ValidatorSearchInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = RecommendedValidatorListPresenterProtocol + typealias MocksType = ValidatorSearchInteractorInputProtocol - typealias Stubbing = __StubbingProxy_RecommendedValidatorListPresenterProtocol - typealias Verification = __VerificationProxy_RecommendedValidatorListPresenterProtocol + typealias Stubbing = __StubbingProxy_ValidatorSearchInteractorInputProtocol + typealias Verification = __VerificationProxy_ValidatorSearchInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: RecommendedValidatorListPresenterProtocol? + private var __defaultImplStub: ValidatorSearchInteractorInputProtocol? - func enableDefaultImplementation(_ stub: RecommendedValidatorListPresenterProtocol) { + func enableDefaultImplementation(_ stub: ValidatorSearchInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -30314,51 +29263,21 @@ import SoraFoundation - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - - func selectedValidatorAt(index: Int) { - - return cuckoo_manager.call("selectedValidatorAt(index: Int)", - parameters: (index), - escapingParameters: (index), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.selectedValidatorAt(index: index)) - - } - - - - func proceed() { + func performValidatorSearch(accountId: AccountId) { - return cuckoo_manager.call("proceed()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("performValidatorSearch(accountId: AccountId)", + parameters: (accountId), + escapingParameters: (accountId), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.performValidatorSearch(accountId: accountId)) } - struct __StubbingProxy_RecommendedValidatorListPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorSearchInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -30366,24 +29285,14 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func selectedValidatorAt(index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListPresenterProtocol.self, method: "selectedValidatorAt(index: Int)", parameterMatchers: matchers)) - } - - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + func performValidatorSearch(accountId: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountId)> where M1.MatchedType == AccountId { + let matchers: [Cuckoo.ParameterMatcher<(AccountId)>] = [wrap(matchable: accountId) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchInteractorInputProtocol.self, method: "performValidatorSearch(accountId: AccountId)", parameterMatchers: matchers)) } } - struct __VerificationProxy_RecommendedValidatorListPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorSearchInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -30398,27 +29307,15 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func selectedValidatorAt(index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("selectedValidatorAt(index: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func performValidatorSearch(accountId: M1) -> Cuckoo.__DoNotUse<(AccountId), Void> where M1.MatchedType == AccountId { + let matchers: [Cuckoo.ParameterMatcher<(AccountId)>] = [wrap(matchable: accountId) { $0 }] + return cuckoo_manager.verify("performValidatorSearch(accountId: AccountId)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class RecommendedValidatorListPresenterProtocolStub: RecommendedValidatorListPresenterProtocol { + class ValidatorSearchInteractorInputProtocolStub: ValidatorSearchInteractorInputProtocol { @@ -30426,19 +29323,7 @@ import SoraFoundation - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func selectedValidatorAt(index: Int) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func proceed() { + func performValidatorSearch(accountId: AccountId) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -30446,19 +29331,19 @@ import SoraFoundation - class MockRecommendedValidatorListWireframeProtocol: RecommendedValidatorListWireframeProtocol, Cuckoo.ProtocolMock { + class MockValidatorSearchInteractorOutputProtocol: ValidatorSearchInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = RecommendedValidatorListWireframeProtocol + typealias MocksType = ValidatorSearchInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_RecommendedValidatorListWireframeProtocol - typealias Verification = __VerificationProxy_RecommendedValidatorListWireframeProtocol + typealias Stubbing = __StubbingProxy_ValidatorSearchInteractorOutputProtocol + typealias Verification = __VerificationProxy_ValidatorSearchInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: RecommendedValidatorListWireframeProtocol? + private var __defaultImplStub: ValidatorSearchInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: RecommendedValidatorListWireframeProtocol) { + func enableDefaultImplementation(_ stub: ValidatorSearchInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -30471,36 +29356,21 @@ import SoraFoundation - func present(_ validatorInfo: SelectedValidatorInfo, from view: RecommendedValidatorListViewProtocol?) { - - return cuckoo_manager.call("present(_: SelectedValidatorInfo, from: RecommendedValidatorListViewProtocol?)", - parameters: (validatorInfo, view), - escapingParameters: (validatorInfo, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(validatorInfo, from: view)) - - } - - - - func proceed(from view: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int) { + func didReceiveValidatorInfo(result: Result) { - return cuckoo_manager.call("proceed(from: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", - parameters: (view, targets, maxTargets), - escapingParameters: (view, targets, maxTargets), + return cuckoo_manager.call("didReceiveValidatorInfo(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed(from: view, targets: targets, maxTargets: maxTargets)) + defaultCall: __defaultImplStub!.didReceiveValidatorInfo(result: result)) } - struct __StubbingProxy_RecommendedValidatorListWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorSearchInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -30508,19 +29378,14 @@ import SoraFoundation } - func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorInfo, RecommendedValidatorListViewProtocol?)> where M1.MatchedType == SelectedValidatorInfo, M2.OptionalMatchedType == RecommendedValidatorListViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo, RecommendedValidatorListViewProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListWireframeProtocol.self, method: "present(_: SelectedValidatorInfo, from: RecommendedValidatorListViewProtocol?)", parameterMatchers: matchers)) - } - - func proceed(from view: M1, targets: M2, maxTargets: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(RecommendedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)> where M1.OptionalMatchedType == RecommendedValidatorListViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(RecommendedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: targets) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockRecommendedValidatorListWireframeProtocol.self, method: "proceed(from: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", parameterMatchers: matchers)) + func didReceiveValidatorInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchInteractorOutputProtocol.self, method: "didReceiveValidatorInfo(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_RecommendedValidatorListWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorSearchInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -30535,21 +29400,15 @@ import SoraFoundation @discardableResult - func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.__DoNotUse<(SelectedValidatorInfo, RecommendedValidatorListViewProtocol?), Void> where M1.MatchedType == SelectedValidatorInfo, M2.OptionalMatchedType == RecommendedValidatorListViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo, RecommendedValidatorListViewProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("present(_: SelectedValidatorInfo, from: RecommendedValidatorListViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func proceed(from view: M1, targets: M2, maxTargets: M3) -> Cuckoo.__DoNotUse<(RecommendedValidatorListViewProtocol?, [SelectedValidatorInfo], Int), Void> where M1.OptionalMatchedType == RecommendedValidatorListViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(RecommendedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: targets) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] - return cuckoo_manager.verify("proceed(from: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveValidatorInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveValidatorInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class RecommendedValidatorListWireframeProtocolStub: RecommendedValidatorListWireframeProtocol { + class ValidatorSearchInteractorOutputProtocolStub: ValidatorSearchInteractorOutputProtocol { @@ -30557,40 +29416,27 @@ import SoraFoundation - func present(_ validatorInfo: SelectedValidatorInfo, from view: RecommendedValidatorListViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func proceed(from view: RecommendedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int) { + func didReceiveValidatorInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import BigInt -import Foundation -import SoraFoundation - - class MockSelectValidatorsConfirmViewProtocol: SelectValidatorsConfirmViewProtocol, Cuckoo.ProtocolMock { + class MockValidatorSearchPresenterProtocol: ValidatorSearchPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsConfirmViewProtocol + typealias MocksType = ValidatorSearchPresenterProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmViewProtocol - typealias Verification = __VerificationProxy_SelectValidatorsConfirmViewProtocol + typealias Stubbing = __StubbingProxy_ValidatorSearchPresenterProtocol + typealias Verification = __VerificationProxy_ValidatorSearchPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsConfirmViewProtocol? + private var __defaultImplStub: ValidatorSearchPresenterProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsConfirmViewProtocol) { + func enableDefaultImplementation(_ stub: ValidatorSearchPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -30599,34 +29445,6 @@ import SoraFoundation - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } - - - - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - - } - - - public var localizationManager: LocalizationManagerProtocol? { get { return cuckoo_manager.getter("localizationManager", @@ -30649,145 +29467,102 @@ import SoraFoundation } - - - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } - - } - - func didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel) { - - return cuckoo_manager.call("didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel)", - parameters: (confirmationViewModel), - escapingParameters: (confirmationViewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(confirmationViewModel: confirmationViewModel)) - - } - - - - func didReceive(hintsViewModel: LocalizableResource<[String]>) { + func setup() { - return cuckoo_manager.call("didReceive(hintsViewModel: LocalizableResource<[String]>)", - parameters: (hintsViewModel), - escapingParameters: (hintsViewModel), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(hintsViewModel: hintsViewModel)) + defaultCall: __defaultImplStub!.setup()) } - func didReceive(amountViewModel: LocalizableResource?) { + func changeValidatorSelection(at index: Int) { - return cuckoo_manager.call("didReceive(amountViewModel: LocalizableResource?)", - parameters: (amountViewModel), - escapingParameters: (amountViewModel), + return cuckoo_manager.call("changeValidatorSelection(at: Int)", + parameters: (index), + escapingParameters: (index), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(amountViewModel: amountViewModel)) + defaultCall: __defaultImplStub!.changeValidatorSelection(at: index)) } - func didReceive(feeViewModel: LocalizableResource?) { + func search(for textEntry: String) { - return cuckoo_manager.call("didReceive(feeViewModel: LocalizableResource?)", - parameters: (feeViewModel), - escapingParameters: (feeViewModel), + return cuckoo_manager.call("search(for: String)", + parameters: (textEntry), + escapingParameters: (textEntry), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(feeViewModel: feeViewModel)) + defaultCall: __defaultImplStub!.search(for: textEntry)) } - public func applyLocalization() { + func didSelectValidator(at index: Int) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didSelectValidator(at: Int)", + parameters: (index), + escapingParameters: (index), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.didSelectValidator(at: index)) } - func didStartLoading() { + func applyChanges() { - return cuckoo_manager.call("didStartLoading()", + return cuckoo_manager.call("applyChanges()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.applyChanges()) } - func didStopLoading() { + public func applyLocalization() { - return cuckoo_manager.call("didStopLoading()", + return cuckoo_manager.call("applyLocalization()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_SelectValidatorsConfirmViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ValidatorSearchPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -30795,69 +29570,44 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") - } - - - func didReceive(confirmationViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectValidatorsConfirmViewModel)> where M1.MatchedType == SelectValidatorsConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsConfirmViewModel)>] = [wrap(matchable: confirmationViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel)", parameterMatchers: matchers)) - } - - func didReceive(hintsViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource<[String]>)> where M1.MatchedType == LocalizableResource<[String]> { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource<[String]>)>] = [wrap(matchable: hintsViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didReceive(hintsViewModel: LocalizableResource<[String]>)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func didReceive(amountViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: amountViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didReceive(amountViewModel: LocalizableResource?)", parameterMatchers: matchers)) + func changeValidatorSelection(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "changeValidatorSelection(at: Int)", parameterMatchers: matchers)) } - func didReceive(feeViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: feeViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didReceive(feeViewModel: LocalizableResource?)", parameterMatchers: matchers)) + func search(for textEntry: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: textEntry) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "search(for: String)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func didSelectValidator(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "didSelectValidator(at: Int)", parameterMatchers: matchers)) } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func applyChanges() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "applyChanges()", parameterMatchers: matchers)) } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsConfirmViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ValidatorSearchPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -30870,96 +29620,52 @@ import SoraFoundation - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - var localizationManager: Cuckoo.VerifyOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceive(confirmationViewModel: M1) -> Cuckoo.__DoNotUse<(SelectValidatorsConfirmViewModel), Void> where M1.MatchedType == SelectValidatorsConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsConfirmViewModel)>] = [wrap(matchable: confirmationViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(hintsViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource<[String]>), Void> where M1.MatchedType == LocalizableResource<[String]> { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource<[String]>)>] = [wrap(matchable: hintsViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(hintsViewModel: LocalizableResource<[String]>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(amountViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: amountViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(amountViewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func changeValidatorSelection(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("changeValidatorSelection(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(feeViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: feeViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(feeViewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func search(for textEntry: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: textEntry) { $0 }] + return cuckoo_manager.verify("search(for: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didSelectValidator(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("didSelectValidator(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + func applyChanges() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyChanges()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectValidatorsConfirmViewProtocolStub: SelectValidatorsConfirmViewProtocol { - - - - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - - - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } + class ValidatorSearchPresenterProtocolStub: ValidatorSearchPresenterProtocol { @@ -30971,21 +29677,216 @@ import SoraFoundation set { } } - + - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } + + + + + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func changeValidatorSelection(at index: Int) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func search(for textEntry: String) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didSelectValidator(at index: Int) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func applyChanges() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + public func applyLocalization() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + + class MockValidatorSearchViewModelFactoryProtocol: ValidatorSearchViewModelFactoryProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = ValidatorSearchViewModelFactoryProtocol + + typealias Stubbing = __StubbingProxy_ValidatorSearchViewModelFactoryProtocol + typealias Verification = __VerificationProxy_ValidatorSearchViewModelFactoryProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: ValidatorSearchViewModelFactoryProtocol? + + func enableDefaultImplementation(_ stub: ValidatorSearchViewModelFactoryProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + + + + + func createViewModel(from displayValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel { + + return cuckoo_manager.call("createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel", + parameters: (displayValidatorList, selectedValidatorList, locale), + escapingParameters: (displayValidatorList, selectedValidatorList, locale), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.createViewModel(from: displayValidatorList, selectedValidatorList: selectedValidatorList, locale: locale)) + + } + + + struct __StubbingProxy_ValidatorSearchViewModelFactoryProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func createViewModel(from displayValidatorList: M1, selectedValidatorList: M2, locale: M3) -> Cuckoo.ProtocolStubFunction<([SelectedValidatorInfo], [SelectedValidatorInfo], Locale), ValidatorSearchViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], [SelectedValidatorInfo], Locale)>] = [wrap(matchable: displayValidatorList) { $0.0 }, wrap(matchable: selectedValidatorList) { $0.1 }, wrap(matchable: locale) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewModelFactoryProtocol.self, method: "createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_ValidatorSearchViewModelFactoryProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func createViewModel(from displayValidatorList: M1, selectedValidatorList: M2, locale: M3) -> Cuckoo.__DoNotUse<([SelectedValidatorInfo], [SelectedValidatorInfo], Locale), ValidatorSearchViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], [SelectedValidatorInfo], Locale)>] = [wrap(matchable: displayValidatorList) { $0.0 }, wrap(matchable: selectedValidatorList) { $0.1 }, wrap(matchable: locale) { $0.2 }] + return cuckoo_manager.verify("createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class ValidatorSearchViewModelFactoryProtocolStub: ValidatorSearchViewModelFactoryProtocol { + + + + + + + + func createViewModel(from displayValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel { + return DefaultValueRegistry.defaultValue(for: (ValidatorSearchViewModel).self) + } + +} + + +import Cuckoo +@testable import novawallet + +import SoraFoundation + + + class MockYourValidatorListViewProtocol: YourValidatorListViewProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = YourValidatorListViewProtocol + + typealias Stubbing = __StubbingProxy_YourValidatorListViewProtocol + typealias Verification = __VerificationProxy_YourValidatorListViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: YourValidatorListViewProtocol? + + func enableDefaultImplementation(_ stub: YourValidatorListViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + } - var shouldDisableInteractionWhenLoading: Bool { + + public var localizationManager: LocalizationManagerProtocol? { get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) } } @@ -30996,43 +29897,158 @@ import SoraFoundation - func didReceive(confirmationViewModel: SelectValidatorsConfirmViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func reload(state: YourValidatorListViewState) { + + return cuckoo_manager.call("reload(state: YourValidatorListViewState)", + parameters: (state), + escapingParameters: (state), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.reload(state: state)) + } - func didReceive(hintsViewModel: LocalizableResource<[String]>) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + public func applyLocalization() { + + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.applyLocalization()) + } + + struct __StubbingProxy_YourValidatorListViewProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") + } + + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") + } + + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") + } + + + func reload(state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(YourValidatorListViewState)> where M1.MatchedType == YourValidatorListViewState { + let matchers: [Cuckoo.ParameterMatcher<(YourValidatorListViewState)>] = [wrap(matchable: state) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListViewProtocol.self, method: "reload(state: YourValidatorListViewState)", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_YourValidatorListViewProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + + @discardableResult + func reload(state: M1) -> Cuckoo.__DoNotUse<(YourValidatorListViewState), Void> where M1.MatchedType == YourValidatorListViewState { + let matchers: [Cuckoo.ParameterMatcher<(YourValidatorListViewState)>] = [wrap(matchable: state) { $0 }] + return cuckoo_manager.verify("reload(state: YourValidatorListViewState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class YourValidatorListViewProtocolStub: YourValidatorListViewProtocol { + - func didReceive(amountViewModel: LocalizableResource?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + - - func didReceive(feeViewModel: LocalizableResource?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + - - public func applyLocalization() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + } + + + - func didStartLoading() { + + func reload(state: YourValidatorListViewState) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStopLoading() { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -31040,19 +30056,19 @@ import SoraFoundation - class MockSelectValidatorsConfirmPresenterProtocol: SelectValidatorsConfirmPresenterProtocol, Cuckoo.ProtocolMock { + class MockYourValidatorListPresenterProtocol: YourValidatorListPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsConfirmPresenterProtocol + typealias MocksType = YourValidatorListPresenterProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmPresenterProtocol - typealias Verification = __VerificationProxy_SelectValidatorsConfirmPresenterProtocol + typealias Stubbing = __StubbingProxy_YourValidatorListPresenterProtocol + typealias Verification = __VerificationProxy_YourValidatorListPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsConfirmPresenterProtocol? + private var __defaultImplStub: YourValidatorListPresenterProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsConfirmPresenterProtocol) { + func enableDefaultImplementation(_ stub: YourValidatorListPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -31080,51 +30096,51 @@ import SoraFoundation - func selectWalletAccount() { + func retry() { - return cuckoo_manager.call("selectWalletAccount()", + return cuckoo_manager.call("retry()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectWalletAccount()) + defaultCall: __defaultImplStub!.retry()) } - func selectPayoutAccount() { + func didSelectValidator(viewModel: YourValidatorViewModel) { - return cuckoo_manager.call("selectPayoutAccount()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didSelectValidator(viewModel: YourValidatorViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectPayoutAccount()) + defaultCall: __defaultImplStub!.didSelectValidator(viewModel: viewModel)) } - func proceed() { + func changeValidators() { - return cuckoo_manager.call("proceed()", + return cuckoo_manager.call("changeValidators()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.changeValidators()) } - struct __StubbingProxy_SelectValidatorsConfirmPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_YourValidatorListPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -31134,27 +30150,27 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func selectWalletAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func retry() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmPresenterProtocol.self, method: "selectWalletAccount()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListPresenterProtocol.self, method: "retry()", parameterMatchers: matchers)) } - func selectPayoutAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmPresenterProtocol.self, method: "selectPayoutAccount()", parameterMatchers: matchers)) + func didSelectValidator(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(YourValidatorViewModel)> where M1.MatchedType == YourValidatorViewModel { + let matchers: [Cuckoo.ParameterMatcher<(YourValidatorViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListPresenterProtocol.self, method: "didSelectValidator(viewModel: YourValidatorViewModel)", parameterMatchers: matchers)) } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func changeValidators() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListPresenterProtocol.self, method: "changeValidators()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsConfirmPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_YourValidatorListPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -31175,27 +30191,27 @@ import SoraFoundation } @discardableResult - func selectWalletAccount() -> Cuckoo.__DoNotUse<(), Void> { + func retry() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectWalletAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("retry()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectPayoutAccount() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectPayoutAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didSelectValidator(viewModel: M1) -> Cuckoo.__DoNotUse<(YourValidatorViewModel), Void> where M1.MatchedType == YourValidatorViewModel { + let matchers: [Cuckoo.ParameterMatcher<(YourValidatorViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didSelectValidator(viewModel: YourValidatorViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { + func changeValidators() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("changeValidators()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectValidatorsConfirmPresenterProtocolStub: SelectValidatorsConfirmPresenterProtocol { + class YourValidatorListPresenterProtocolStub: YourValidatorListPresenterProtocol { @@ -31209,19 +30225,19 @@ import SoraFoundation - func selectWalletAccount() { + func retry() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectPayoutAccount() { + func didSelectValidator(viewModel: YourValidatorViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func proceed() { + func changeValidators() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -31229,19 +30245,19 @@ import SoraFoundation - class MockSelectValidatorsConfirmInteractorInputProtocol: SelectValidatorsConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockYourValidatorListInteractorInputProtocol: YourValidatorListInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsConfirmInteractorInputProtocol + typealias MocksType = YourValidatorListInteractorInputProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmInteractorInputProtocol - typealias Verification = __VerificationProxy_SelectValidatorsConfirmInteractorInputProtocol + typealias Stubbing = __StubbingProxy_YourValidatorListInteractorInputProtocol + typealias Verification = __VerificationProxy_YourValidatorListInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsConfirmInteractorInputProtocol? + private var __defaultImplStub: YourValidatorListInteractorInputProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsConfirmInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: YourValidatorListInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -31269,36 +30285,21 @@ import SoraFoundation - func submitNomination() { - - return cuckoo_manager.call("submitNomination()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.submitNomination()) - - } - - - - func estimateFee() { + func refresh() { - return cuckoo_manager.call("estimateFee()", + return cuckoo_manager.call("refresh()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee()) + defaultCall: __defaultImplStub!.refresh()) } - struct __StubbingProxy_SelectValidatorsConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_YourValidatorListInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -31308,22 +30309,17 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func submitNomination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorInputProtocol.self, method: "submitNomination()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func refresh() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorInputProtocol.self, method: "refresh()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_YourValidatorListInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -31344,21 +30340,15 @@ import SoraFoundation } @discardableResult - func submitNomination() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("submitNomination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { + func refresh() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("refresh()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectValidatorsConfirmInteractorInputProtocolStub: SelectValidatorsConfirmInteractorInputProtocol { + class YourValidatorListInteractorInputProtocolStub: YourValidatorListInteractorInputProtocol { @@ -31372,13 +30362,7 @@ import SoraFoundation - func submitNomination() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func estimateFee() { + func refresh() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -31386,19 +30370,19 @@ import SoraFoundation - class MockSelectValidatorsConfirmInteractorOutputProtocol: SelectValidatorsConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockYourValidatorListInteractorOutputProtocol: YourValidatorListInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsConfirmInteractorOutputProtocol + typealias MocksType = YourValidatorListInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmInteractorOutputProtocol - typealias Verification = __VerificationProxy_SelectValidatorsConfirmInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_YourValidatorListInteractorOutputProtocol + typealias Verification = __VerificationProxy_YourValidatorListInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsConfirmInteractorOutputProtocol? + private var __defaultImplStub: YourValidatorListInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsConfirmInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: YourValidatorListInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -31411,186 +30395,81 @@ import SoraFoundation - func didReceiveModel(result: Result) { + func didReceiveValidators(result: Result) { - return cuckoo_manager.call("didReceiveModel(result: Result)", + return cuckoo_manager.call("didReceiveValidators(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveModel(result: result)) + defaultCall: __defaultImplStub!.didReceiveValidators(result: result)) } - func didReceivePrice(result: Result) { + func didReceiveController(result: Result) { - return cuckoo_manager.call("didReceivePrice(result: Result)", + return cuckoo_manager.call("didReceiveController(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePrice(result: result)) - - } - - - - func didReceiveAccountInfo(result: Result) { - - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) - - } - - - - func didReceiveMinBond(result: Result) { - - return cuckoo_manager.call("didReceiveMinBond(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveMinBond(result: result)) + defaultCall: __defaultImplStub!.didReceiveController(result: result)) } - func didReceiveCounterForNominators(result: Result) { + func didReceiveStashItem(result: Result) { - return cuckoo_manager.call("didReceiveCounterForNominators(result: Result)", + return cuckoo_manager.call("didReceiveStashItem(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveCounterForNominators(result: result)) + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) } - func didReceiveMaxNominatorsCount(result: Result) { + func didReceiveLedger(result: Result) { - return cuckoo_manager.call("didReceiveMaxNominatorsCount(result: Result)", + return cuckoo_manager.call("didReceiveLedger(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMaxNominatorsCount(result: result)) + defaultCall: __defaultImplStub!.didReceiveLedger(result: result)) } - func didReceiveStakingDuration(result: Result) { + func didReceiveRewardDestination(result: Result) { - return cuckoo_manager.call("didReceiveStakingDuration(result: Result)", + return cuckoo_manager.call("didReceiveRewardDestination(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStakingDuration(result: result)) - - } - - - - func didStartNomination() { - - return cuckoo_manager.call("didStartNomination()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didStartNomination()) - - } - - - - func didCompleteNomination(txHash: String) { - - return cuckoo_manager.call("didCompleteNomination(txHash: String)", - parameters: (txHash), - escapingParameters: (txHash), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didCompleteNomination(txHash: txHash)) - - } - - - - func didFailNomination(error: Error) { - - return cuckoo_manager.call("didFailNomination(error: Error)", - parameters: (error), - escapingParameters: (error), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didFailNomination(error: error)) - - } - - - - func didReceive(paymentInfo: RuntimeDispatchInfo) { - - return cuckoo_manager.call("didReceive(paymentInfo: RuntimeDispatchInfo)", - parameters: (paymentInfo), - escapingParameters: (paymentInfo), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(paymentInfo: paymentInfo)) - - } - - - - func didReceive(feeError: Error) { - - return cuckoo_manager.call("didReceive(feeError: Error)", - parameters: (feeError), - escapingParameters: (feeError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(feeError: feeError)) + defaultCall: __defaultImplStub!.didReceiveRewardDestination(result: result)) } - struct __StubbingProxy_SelectValidatorsConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_YourValidatorListInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -31598,69 +30477,34 @@ import SoraFoundation } - func didReceiveModel(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveModel(result: Result)", parameterMatchers: matchers)) - } - - func didReceivePrice(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceivePrice(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveMinBond(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveMinBond(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveCounterForNominators(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveCounterForNominators(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveMaxNominatorsCount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveMaxNominatorsCount(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveStakingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceiveStakingDuration(result: Result)", parameterMatchers: matchers)) - } - - func didStartNomination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didStartNomination()", parameterMatchers: matchers)) + func didReceiveValidators(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveValidators(result: Result)", parameterMatchers: matchers)) } - func didCompleteNomination(txHash: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: txHash) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didCompleteNomination(txHash: String)", parameterMatchers: matchers)) + func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) } - func didFailNomination(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didFailNomination(error: Error)", parameterMatchers: matchers)) + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) } - func didReceive(paymentInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RuntimeDispatchInfo)> where M1.MatchedType == RuntimeDispatchInfo { - let matchers: [Cuckoo.ParameterMatcher<(RuntimeDispatchInfo)>] = [wrap(matchable: paymentInfo) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceive(paymentInfo: RuntimeDispatchInfo)", parameterMatchers: matchers)) + func didReceiveLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveLedger(result: Result)", parameterMatchers: matchers)) } - func didReceive(feeError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: feeError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmInteractorOutputProtocol.self, method: "didReceive(feeError: Error)", parameterMatchers: matchers)) + func didReceiveRewardDestination(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveRewardDestination(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_YourValidatorListInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -31675,81 +30519,39 @@ import SoraFoundation @discardableResult - func didReceiveModel(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveModel(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceivePrice(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePrice(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveMinBond(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinBond(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveCounterForNominators(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveCounterForNominators(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveMaxNominatorsCount(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMaxNominatorsCount(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveStakingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didStartNomination() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartNomination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveValidators(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveValidators(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didCompleteNomination(txHash: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: txHash) { $0 }] - return cuckoo_manager.verify("didCompleteNomination(txHash: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didFailNomination(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return cuckoo_manager.verify("didFailNomination(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(paymentInfo: M1) -> Cuckoo.__DoNotUse<(RuntimeDispatchInfo), Void> where M1.MatchedType == RuntimeDispatchInfo { - let matchers: [Cuckoo.ParameterMatcher<(RuntimeDispatchInfo)>] = [wrap(matchable: paymentInfo) { $0 }] - return cuckoo_manager.verify("didReceive(paymentInfo: RuntimeDispatchInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(feeError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: feeError) { $0 }] - return cuckoo_manager.verify("didReceive(feeError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveRewardDestination(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveRewardDestination(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectValidatorsConfirmInteractorOutputProtocolStub: SelectValidatorsConfirmInteractorOutputProtocol { + class YourValidatorListInteractorOutputProtocolStub: YourValidatorListInteractorOutputProtocol { @@ -31757,73 +30559,31 @@ import SoraFoundation - func didReceiveModel(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceivePrice(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveMinBond(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveCounterForNominators(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveMaxNominatorsCount(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveStakingDuration(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didStartNomination() { + func didReceiveValidators(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didCompleteNomination(txHash: String) { + func didReceiveController(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didFailNomination(error: Error) { + func didReceiveStashItem(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(paymentInfo: RuntimeDispatchInfo) { + func didReceiveLedger(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(feeError: Error) { + func didReceiveRewardDestination(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -31831,19 +30591,19 @@ import SoraFoundation - class MockSelectValidatorsConfirmWireframeProtocol: SelectValidatorsConfirmWireframeProtocol, Cuckoo.ProtocolMock { + class MockYourValidatorListWireframeProtocol: YourValidatorListWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsConfirmWireframeProtocol + typealias MocksType = YourValidatorListWireframeProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsConfirmWireframeProtocol - typealias Verification = __VerificationProxy_SelectValidatorsConfirmWireframeProtocol + typealias Stubbing = __StubbingProxy_YourValidatorListWireframeProtocol + typealias Verification = __VerificationProxy_YourValidatorListWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsConfirmWireframeProtocol? + private var __defaultImplStub: YourValidatorListWireframeProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsConfirmWireframeProtocol) { + func enableDefaultImplementation(_ stub: YourValidatorListWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -31856,16 +30616,31 @@ import SoraFoundation - func complete(from view: SelectValidatorsConfirmViewProtocol?) { + func present(_ validatorInfo: ValidatorInfoProtocol, from view: YourValidatorListViewProtocol?) { - return cuckoo_manager.call("complete(from: SelectValidatorsConfirmViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("present(_: ValidatorInfoProtocol, from: YourValidatorListViewProtocol?)", + parameters: (validatorInfo, view), + escapingParameters: (validatorInfo, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.complete(from: view)) + defaultCall: __defaultImplStub!.present(validatorInfo, from: view)) + + } + + + + func proceedToSelectValidatorsStart(from view: YourValidatorListViewProtocol?, existingBonding: ExistingBonding) { + + return cuckoo_manager.call("proceedToSelectValidatorsStart(from: YourValidatorListViewProtocol?, existingBonding: ExistingBonding)", + parameters: (view, existingBonding), + escapingParameters: (view, existingBonding), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.proceedToSelectValidatorsStart(from: view, existingBonding: existingBonding)) } @@ -31900,7 +30675,7 @@ import SoraFoundation } - struct __StubbingProxy_SelectValidatorsConfirmWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_YourValidatorListWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -31908,24 +30683,29 @@ import SoraFoundation } - func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectValidatorsConfirmViewProtocol?)> where M1.OptionalMatchedType == SelectValidatorsConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmWireframeProtocol.self, method: "complete(from: SelectValidatorsConfirmViewProtocol?)", parameterMatchers: matchers)) + func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoProtocol, YourValidatorListViewProtocol?)> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == YourValidatorListViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, YourValidatorListViewProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListWireframeProtocol.self, method: "present(_: ValidatorInfoProtocol, from: YourValidatorListViewProtocol?)", parameterMatchers: matchers)) + } + + func proceedToSelectValidatorsStart(from view: M1, existingBonding: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(YourValidatorListViewProtocol?, ExistingBonding)> where M1.OptionalMatchedType == YourValidatorListViewProtocol, M2.MatchedType == ExistingBonding { + let matchers: [Cuckoo.ParameterMatcher<(YourValidatorListViewProtocol?, ExistingBonding)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: existingBonding) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListWireframeProtocol.self, method: "proceedToSelectValidatorsStart(from: YourValidatorListViewProtocol?, existingBonding: ExistingBonding)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsConfirmWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_YourValidatorListWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -31940,9 +30720,15 @@ import SoraFoundation @discardableResult - func complete(from view: M1) -> Cuckoo.__DoNotUse<(SelectValidatorsConfirmViewProtocol?), Void> where M1.OptionalMatchedType == SelectValidatorsConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(from: SelectValidatorsConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.__DoNotUse<(ValidatorInfoProtocol, YourValidatorListViewProtocol?), Void> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == YourValidatorListViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, YourValidatorListViewProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("present(_: ValidatorInfoProtocol, from: YourValidatorListViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func proceedToSelectValidatorsStart(from view: M1, existingBonding: M2) -> Cuckoo.__DoNotUse<(YourValidatorListViewProtocol?, ExistingBonding), Void> where M1.OptionalMatchedType == YourValidatorListViewProtocol, M2.MatchedType == ExistingBonding { + let matchers: [Cuckoo.ParameterMatcher<(YourValidatorListViewProtocol?, ExistingBonding)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: existingBonding) { $0.1 }] + return cuckoo_manager.verify("proceedToSelectValidatorsStart(from: YourValidatorListViewProtocol?, existingBonding: ExistingBonding)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -31960,7 +30746,7 @@ import SoraFoundation } } - class SelectValidatorsConfirmWireframeProtocolStub: SelectValidatorsConfirmWireframeProtocol { + class YourValidatorListWireframeProtocolStub: YourValidatorListWireframeProtocol { @@ -31968,7 +30754,13 @@ import SoraFoundation - func complete(from view: SelectValidatorsConfirmViewProtocol?) { + func present(_ validatorInfo: ValidatorInfoProtocol, from view: YourValidatorListViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func proceedToSelectValidatorsStart(from view: YourValidatorListViewProtocol?, existingBonding: ExistingBonding) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -31990,23 +30782,24 @@ import SoraFoundation import Cuckoo @testable import novawallet -import Foundation +import BigInt +import CommonWallet import SoraFoundation - class MockSelectValidatorsStartViewProtocol: SelectValidatorsStartViewProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreViewProtocol: StakingBondMoreViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsStartViewProtocol + typealias MocksType = StakingBondMoreViewProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsStartViewProtocol - typealias Verification = __VerificationProxy_SelectValidatorsStartViewProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreViewProtocol + typealias Verification = __VerificationProxy_StakingBondMoreViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsStartViewProtocol? + private var __defaultImplStub: StakingBondMoreViewProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsStartViewProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -32071,16 +30864,46 @@ import SoraFoundation - func didReceive(viewModel: SelectValidatorsStartViewModel) { + func didReceiveInput(viewModel: LocalizableResource) { - return cuckoo_manager.call("didReceive(viewModel: SelectValidatorsStartViewModel)", + return cuckoo_manager.call("didReceiveInput(viewModel: LocalizableResource)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) + + } + + + + func didReceiveAsset(viewModel: LocalizableResource) { + + return cuckoo_manager.call("didReceiveAsset(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) + + } + + + + func didReceiveFee(viewModel: LocalizableResource?) { + + return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) } @@ -32100,7 +30923,7 @@ import SoraFoundation } - struct __StubbingProxy_SelectValidatorsStartViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMoreViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -32108,34 +30931,44 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectValidatorsStartViewModel)> where M1.MatchedType == SelectValidatorsStartViewModel { - let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsStartViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartViewProtocol.self, method: "didReceive(viewModel: SelectValidatorsStartViewModel)", parameterMatchers: matchers)) + func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreViewProtocol.self, method: "didReceiveInput(viewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreViewProtocol.self, method: "didReceiveAsset(viewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsStartViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -32165,9 +30998,21 @@ import SoraFoundation @discardableResult - func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(SelectValidatorsStartViewModel), Void> where M1.MatchedType == SelectValidatorsStartViewModel { - let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsStartViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceive(viewModel: SelectValidatorsStartViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveInput(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAsset(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -32179,7 +31024,7 @@ import SoraFoundation } } - class SelectValidatorsStartViewProtocolStub: SelectValidatorsStartViewProtocol { + class StakingBondMoreViewProtocolStub: StakingBondMoreViewProtocol { @@ -32216,7 +31061,19 @@ import SoraFoundation - func didReceive(viewModel: SelectValidatorsStartViewModel) { + func didReceiveInput(viewModel: LocalizableResource) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveAsset(viewModel: LocalizableResource) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveFee(viewModel: LocalizableResource?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -32230,19 +31087,19 @@ import SoraFoundation - class MockSelectValidatorsStartPresenterProtocol: SelectValidatorsStartPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMorePresenterProtocol: StakingBondMorePresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsStartPresenterProtocol + typealias MocksType = StakingBondMorePresenterProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsStartPresenterProtocol - typealias Verification = __VerificationProxy_SelectValidatorsStartPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingBondMorePresenterProtocol + typealias Verification = __VerificationProxy_StakingBondMorePresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsStartPresenterProtocol? + private var __defaultImplStub: StakingBondMorePresenterProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsStartPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMorePresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -32270,66 +31127,51 @@ import SoraFoundation - func updateOnAppearance() { - - return cuckoo_manager.call("updateOnAppearance()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.updateOnAppearance()) - - } - - - - func selectRecommendedValidators() { + func handleContinueAction() { - return cuckoo_manager.call("selectRecommendedValidators()", + return cuckoo_manager.call("handleContinueAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectRecommendedValidators()) + defaultCall: __defaultImplStub!.handleContinueAction()) } - func selectCustomValidators() { + func updateAmount(_ newValue: Decimal) { - return cuckoo_manager.call("selectCustomValidators()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("updateAmount(_: Decimal)", + parameters: (newValue), + escapingParameters: (newValue), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectCustomValidators()) + defaultCall: __defaultImplStub!.updateAmount(newValue)) } - func selectLearnMore() { + func selectAmountPercentage(_ percentage: Float) { - return cuckoo_manager.call("selectLearnMore()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("selectAmountPercentage(_: Float)", + parameters: (percentage), + escapingParameters: (percentage), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectLearnMore()) + defaultCall: __defaultImplStub!.selectAmountPercentage(percentage)) } - struct __StubbingProxy_SelectValidatorsStartPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMorePresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -32339,32 +31181,27 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func updateOnAppearance() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "updateOnAppearance()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMorePresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func selectRecommendedValidators() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func handleContinueAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "selectRecommendedValidators()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMorePresenterProtocol.self, method: "handleContinueAction()", parameterMatchers: matchers)) } - func selectCustomValidators() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "selectCustomValidators()", parameterMatchers: matchers)) + func updateAmount(_ newValue: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMorePresenterProtocol.self, method: "updateAmount(_: Decimal)", parameterMatchers: matchers)) } - func selectLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartPresenterProtocol.self, method: "selectLearnMore()", parameterMatchers: matchers)) + func selectAmountPercentage(_ percentage: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Float)> where M1.MatchedType == Float { + let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMorePresenterProtocol.self, method: "selectAmountPercentage(_: Float)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsStartPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMorePresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -32385,33 +31222,27 @@ import SoraFoundation } @discardableResult - func updateOnAppearance() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("updateOnAppearance()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func selectRecommendedValidators() -> Cuckoo.__DoNotUse<(), Void> { + func handleContinueAction() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectRecommendedValidators()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("handleContinueAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectCustomValidators() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectCustomValidators()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func updateAmount(_ newValue: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] + return cuckoo_manager.verify("updateAmount(_: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectLearnMore() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectAmountPercentage(_ percentage: M1) -> Cuckoo.__DoNotUse<(Float), Void> where M1.MatchedType == Float { + let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] + return cuckoo_manager.verify("selectAmountPercentage(_: Float)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectValidatorsStartPresenterProtocolStub: SelectValidatorsStartPresenterProtocol { + class StakingBondMorePresenterProtocolStub: StakingBondMorePresenterProtocol { @@ -32425,25 +31256,19 @@ import SoraFoundation - func updateOnAppearance() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func selectRecommendedValidators() { + func handleContinueAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectCustomValidators() { + func updateAmount(_ newValue: Decimal) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectLearnMore() { + func selectAmountPercentage(_ percentage: Float) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -32451,19 +31276,19 @@ import SoraFoundation - class MockSelectValidatorsStartInteractorInputProtocol: SelectValidatorsStartInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreInteractorInputProtocol: StakingBondMoreInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsStartInteractorInputProtocol + typealias MocksType = StakingBondMoreInteractorInputProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsStartInteractorInputProtocol - typealias Verification = __VerificationProxy_SelectValidatorsStartInteractorInputProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingBondMoreInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsStartInteractorInputProtocol? + private var __defaultImplStub: StakingBondMoreInteractorInputProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsStartInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -32489,8 +31314,23 @@ import SoraFoundation } + + + func estimateFee() { + + return cuckoo_manager.call("estimateFee()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.estimateFee()) + + } + - struct __StubbingProxy_SelectValidatorsStartInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMoreInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -32500,12 +31340,17 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsStartInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -32525,10 +31370,16 @@ import SoraFoundation return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class SelectValidatorsStartInteractorInputProtocolStub: SelectValidatorsStartInteractorInputProtocol { + class StakingBondMoreInteractorInputProtocolStub: StakingBondMoreInteractorInputProtocol { @@ -32540,23 +31391,29 @@ import SoraFoundation return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func estimateFee() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } - class MockSelectValidatorsStartInteractorOutputProtocol: SelectValidatorsStartInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreInteractorOutputProtocol: StakingBondMoreInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsStartInteractorOutputProtocol + typealias MocksType = StakingBondMoreInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsStartInteractorOutputProtocol - typealias Verification = __VerificationProxy_SelectValidatorsStartInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingBondMoreInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsStartInteractorOutputProtocol? + private var __defaultImplStub: StakingBondMoreInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsStartInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -32569,36 +31426,81 @@ import SoraFoundation - func didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>)", + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveValidators(result: result)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - func didReceiveMaxNominations(result: Result) { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("didReceiveMaxNominations(result: Result)", + return cuckoo_manager.call("didReceivePriceData(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMaxNominations(result: result)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + + } + + + + func didReceiveFee(result: Result) { + + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + + } + + + + func didReceiveStash(result: Result) { + + return cuckoo_manager.call("didReceiveStash(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveStash(result: result)) + + } + + + + func didReceiveStashItem(result: Result) { + + return cuckoo_manager.call("didReceiveStashItem(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) } - struct __StubbingProxy_SelectValidatorsStartInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMoreInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -32606,19 +31508,34 @@ import SoraFoundation } - func didReceiveValidators(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[ElectedValidatorInfo], Error>)> where M1.MatchedType == Result<[ElectedValidatorInfo], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[ElectedValidatorInfo], Error>)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartInteractorOutputProtocol.self, method: "didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func didReceiveMaxNominations(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartInteractorOutputProtocol.self, method: "didReceiveMaxNominations(result: Result)", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveStash(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceiveStash(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsStartInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -32633,21 +31550,39 @@ import SoraFoundation @discardableResult - func didReceiveValidators(result: M1) -> Cuckoo.__DoNotUse<(Result<[ElectedValidatorInfo], Error>), Void> where M1.MatchedType == Result<[ElectedValidatorInfo], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[ElectedValidatorInfo], Error>)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveMaxNominations(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMaxNominations(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveStash(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStash(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectValidatorsStartInteractorOutputProtocolStub: SelectValidatorsStartInteractorOutputProtocol { + class StakingBondMoreInteractorOutputProtocolStub: StakingBondMoreInteractorOutputProtocol { @@ -32655,13 +31590,31 @@ import SoraFoundation - func didReceiveValidators(result: Result<[ElectedValidatorInfo], Error>) { + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveMaxNominations(result: Result) { + func didReceivePriceData(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveFee(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveStash(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveStashItem(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -32669,19 +31622,19 @@ import SoraFoundation - class MockSelectValidatorsStartWireframeProtocol: SelectValidatorsStartWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreWireframeProtocol: StakingBondMoreWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectValidatorsStartWireframeProtocol + typealias MocksType = StakingBondMoreWireframeProtocol - typealias Stubbing = __StubbingProxy_SelectValidatorsStartWireframeProtocol - typealias Verification = __VerificationProxy_SelectValidatorsStartWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreWireframeProtocol + typealias Verification = __VerificationProxy_StakingBondMoreWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectValidatorsStartWireframeProtocol? + private var __defaultImplStub: StakingBondMoreWireframeProtocol? - func enableDefaultImplementation(_ stub: SelectValidatorsStartWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -32694,46 +31647,31 @@ import SoraFoundation - func proceedToCustomList(from view: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams) { - - return cuckoo_manager.call("proceedToCustomList(from: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams)", - parameters: (view, selectionValidatorGroups, selectedValidatorList, validatorsSelectionParams), - escapingParameters: (view, selectionValidatorGroups, selectedValidatorList, validatorsSelectionParams), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.proceedToCustomList(from: view, selectionValidatorGroups: selectionValidatorGroups, selectedValidatorList: selectedValidatorList, validatorsSelectionParams: validatorsSelectionParams)) - - } - - - - func proceedToRecommendedList(from view: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int) { + func showConfirmation(from view: ControllerBackedProtocol?, amount: Decimal) { - return cuckoo_manager.call("proceedToRecommendedList(from: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int)", - parameters: (view, validatorList, maxTargets), - escapingParameters: (view, validatorList, maxTargets), + return cuckoo_manager.call("showConfirmation(from: ControllerBackedProtocol?, amount: Decimal)", + parameters: (view, amount), + escapingParameters: (view, amount), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceedToRecommendedList(from: view, validatorList: validatorList, maxTargets: maxTargets)) + defaultCall: __defaultImplStub!.showConfirmation(from: view, amount: amount)) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func close(view: ControllerBackedProtocol?) { - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), + return cuckoo_manager.call("close(view: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + defaultCall: __defaultImplStub!.close(view: view)) } @@ -32768,7 +31706,7 @@ import SoraFoundation } - struct __StubbingProxy_SelectValidatorsStartWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMoreWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -32776,34 +31714,29 @@ import SoraFoundation } - func proceedToCustomList(from view: M1, selectionValidatorGroups: M2, selectedValidatorList: M3, validatorsSelectionParams: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, SelectionValidatorGroups, SharedList, ValidatorsSelectionParams)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == SelectionValidatorGroups, M3.MatchedType == SharedList, M4.MatchedType == ValidatorsSelectionParams { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, SelectionValidatorGroups, SharedList, ValidatorsSelectionParams)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: selectionValidatorGroups) { $0.1 }, wrap(matchable: selectedValidatorList) { $0.2 }, wrap(matchable: validatorsSelectionParams) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "proceedToCustomList(from: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams)", parameterMatchers: matchers)) - } - - func proceedToRecommendedList(from view: M1, validatorList: M2, maxTargets: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectValidatorsStartViewProtocol?, [SelectedValidatorInfo], Int)> where M1.OptionalMatchedType == SelectValidatorsStartViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsStartViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: validatorList) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "proceedToRecommendedList(from: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int)", parameterMatchers: matchers)) + func showConfirmation(from view: M1, amount: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, Decimal)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: amount) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreWireframeProtocol.self, method: "showConfirmation(from: ControllerBackedProtocol?, amount: Decimal)", parameterMatchers: matchers)) } - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreWireframeProtocol.self, method: "close(view: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectValidatorsStartWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectValidatorsStartWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -32818,21 +31751,15 @@ import SoraFoundation @discardableResult - func proceedToCustomList(from view: M1, selectionValidatorGroups: M2, selectedValidatorList: M3, validatorsSelectionParams: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, SelectionValidatorGroups, SharedList, ValidatorsSelectionParams), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == SelectionValidatorGroups, M3.MatchedType == SharedList, M4.MatchedType == ValidatorsSelectionParams { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, SelectionValidatorGroups, SharedList, ValidatorsSelectionParams)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: selectionValidatorGroups) { $0.1 }, wrap(matchable: selectedValidatorList) { $0.2 }, wrap(matchable: validatorsSelectionParams) { $0.3 }] - return cuckoo_manager.verify("proceedToCustomList(from: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func proceedToRecommendedList(from view: M1, validatorList: M2, maxTargets: M3) -> Cuckoo.__DoNotUse<(SelectValidatorsStartViewProtocol?, [SelectedValidatorInfo], Int), Void> where M1.OptionalMatchedType == SelectValidatorsStartViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(SelectValidatorsStartViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: validatorList) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] - return cuckoo_manager.verify("proceedToRecommendedList(from: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showConfirmation(from view: M1, amount: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, Decimal), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: amount) { $0.1 }] + return cuckoo_manager.verify("showConfirmation(from: ControllerBackedProtocol?, amount: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close(view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -32850,7 +31777,7 @@ import SoraFoundation } } - class SelectValidatorsStartWireframeProtocolStub: SelectValidatorsStartWireframeProtocol { + class StakingBondMoreWireframeProtocolStub: StakingBondMoreWireframeProtocol { @@ -32858,19 +31785,13 @@ import SoraFoundation - func proceedToCustomList(from view: ControllerBackedProtocol?, selectionValidatorGroups: SelectionValidatorGroups, selectedValidatorList: SharedList, validatorsSelectionParams: ValidatorsSelectionParams) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func proceedToRecommendedList(from view: SelectValidatorsStartViewProtocol?, validatorList: [SelectedValidatorInfo], maxTargets: Int) { + func showConfirmation(from view: ControllerBackedProtocol?, amount: Decimal) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func close(view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -32892,22 +31813,24 @@ import SoraFoundation import Cuckoo @testable import novawallet +import BigInt +import CommonWallet import SoraFoundation - class MockSelectedValidatorListViewProtocol: SelectedValidatorListViewProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreConfirmationViewProtocol: StakingBondMoreConfirmationViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectedValidatorListViewProtocol + typealias MocksType = StakingBondMoreConfirmationViewProtocol - typealias Stubbing = __StubbingProxy_SelectedValidatorListViewProtocol - typealias Verification = __VerificationProxy_SelectedValidatorListViewProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationViewProtocol + typealias Verification = __VerificationProxy_StakingBondMoreConfirmationViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectedValidatorListViewProtocol? + private var __defaultImplStub: StakingBondMoreConfirmationViewProtocol? - func enableDefaultImplementation(_ stub: SelectedValidatorListViewProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -32966,37 +31889,80 @@ import SoraFoundation } + + + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } + + } + - func didReload(_ viewModel: SelectedValidatorListViewModel) { + func didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel) { - return cuckoo_manager.call("didReload(_: SelectedValidatorListViewModel)", + return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReload(viewModel)) + defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) } - func didChangeViewModel(_ viewModel: SelectedValidatorListViewModel, byRemovingItemAt index: Int) { + func didReceiveAmount(viewModel: LocalizableResource) { - return cuckoo_manager.call("didChangeViewModel(_: SelectedValidatorListViewModel, byRemovingItemAt: Int)", - parameters: (viewModel, index), - escapingParameters: (viewModel, index), + return cuckoo_manager.call("didReceiveAmount(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didChangeViewModel(viewModel, byRemovingItemAt: index)) + defaultCall: __defaultImplStub!.didReceiveAmount(viewModel: viewModel)) + + } + + + + func didReceiveFee(viewModel: LocalizableResource?) { + + return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) } @@ -33015,48 +31981,103 @@ import SoraFoundation } - - struct __StubbingProxy_SelectedValidatorListViewProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + + + func didStartLoading() { + + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStartLoading()) + + } + + + + func didStopLoading() { + + return cuckoo_manager.call("didStopLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStopLoading()) + + } + + + struct __StubbingProxy_StakingBondMoreConfirmationViewProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") + } + + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") + } + + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func didReload(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorListViewModel)> where M1.MatchedType == SelectedValidatorListViewModel { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListViewProtocol.self, method: "didReload(_: SelectedValidatorListViewModel)", parameterMatchers: matchers)) + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") } - func didChangeViewModel(_ viewModel: M1, byRemovingItemAt index: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorListViewModel, Int)> where M1.MatchedType == SelectedValidatorListViewModel, M2.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewModel, Int)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: index) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListViewProtocol.self, method: "didChangeViewModel(_: SelectedValidatorListViewModel, byRemovingItemAt: Int)", parameterMatchers: matchers)) + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + } + + + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingBondMoreConfirmViewModel)> where M1.MatchedType == StakingBondMoreConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingBondMoreConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel)", parameterMatchers: matchers)) + } + + func didReceiveAmount(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didReceiveAmount(viewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + } + + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectedValidatorListViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreConfirmationViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -33083,18 +32104,34 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func didReload(_ viewModel: M1) -> Cuckoo.__DoNotUse<(SelectedValidatorListViewModel), Void> where M1.MatchedType == SelectedValidatorListViewModel { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReload(_: SelectedValidatorListViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingBondMoreConfirmViewModel), Void> where M1.MatchedType == StakingBondMoreConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingBondMoreConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didChangeViewModel(_ viewModel: M1, byRemovingItemAt index: M2) -> Cuckoo.__DoNotUse<(SelectedValidatorListViewModel, Int), Void> where M1.MatchedType == SelectedValidatorListViewModel, M2.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewModel, Int)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: index) { $0.1 }] - return cuckoo_manager.verify("didChangeViewModel(_: SelectedValidatorListViewModel, byRemovingItemAt: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAmount(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAmount(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -33103,10 +32140,22 @@ import SoraFoundation return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class SelectedValidatorListViewProtocolStub: SelectedValidatorListViewProtocol { + class StakingBondMoreConfirmationViewProtocolStub: StakingBondMoreConfirmationViewProtocol { @@ -33136,6 +32185,24 @@ import SoraFoundation set { } } + + + + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } @@ -33143,112 +32210,37 @@ import SoraFoundation - func didReload(_ viewModel: SelectedValidatorListViewModel) { + func didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didChangeViewModel(_ viewModel: SelectedValidatorListViewModel, byRemovingItemAt index: Int) { + func didReceiveAmount(viewModel: LocalizableResource) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func didReceiveFee(viewModel: LocalizableResource?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockSelectedValidatorListDelegate: SelectedValidatorListDelegate, Cuckoo.ProtocolMock { - - typealias MocksType = SelectedValidatorListDelegate - typealias Stubbing = __StubbingProxy_SelectedValidatorListDelegate - typealias Verification = __VerificationProxy_SelectedValidatorListDelegate - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: SelectedValidatorListDelegate? - - func enableDefaultImplementation(_ stub: SelectedValidatorListDelegate) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + public func applyLocalization() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - - - - - func didRemove(_ validator: SelectedValidatorInfo) { - - return cuckoo_manager.call("didRemove(_: SelectedValidatorInfo)", - parameters: (validator), - escapingParameters: (validator), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didRemove(validator)) - + func didStartLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - struct __StubbingProxy_SelectedValidatorListDelegate: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didRemove(_ validator: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorInfo)> where M1.MatchedType == SelectedValidatorInfo { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo)>] = [wrap(matchable: validator) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListDelegate.self, method: "didRemove(_: SelectedValidatorInfo)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_SelectedValidatorListDelegate: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func didRemove(_ validator: M1) -> Cuckoo.__DoNotUse<(SelectedValidatorInfo), Void> where M1.MatchedType == SelectedValidatorInfo { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorInfo)>] = [wrap(matchable: validator) { $0 }] - return cuckoo_manager.verify("didRemove(_: SelectedValidatorInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class SelectedValidatorListDelegateStub: SelectedValidatorListDelegate { - - - - - - func didRemove(_ validator: SelectedValidatorInfo) { + func didStopLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -33256,19 +32248,19 @@ import SoraFoundation - class MockSelectedValidatorListPresenterProtocol: SelectedValidatorListPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreConfirmationPresenterProtocol: StakingBondMoreConfirmationPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectedValidatorListPresenterProtocol + typealias MocksType = StakingBondMoreConfirmationPresenterProtocol - typealias Stubbing = __StubbingProxy_SelectedValidatorListPresenterProtocol - typealias Verification = __VerificationProxy_SelectedValidatorListPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationPresenterProtocol + typealias Verification = __VerificationProxy_StakingBondMoreConfirmationPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectedValidatorListPresenterProtocol? + private var __defaultImplStub: StakingBondMoreConfirmationPresenterProtocol? - func enableDefaultImplementation(_ stub: SelectedValidatorListPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -33296,66 +32288,36 @@ import SoraFoundation - func didSelectValidator(at index: Int) { - - return cuckoo_manager.call("didSelectValidator(at: Int)", - parameters: (index), - escapingParameters: (index), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didSelectValidator(at: index)) - - } - - - - func removeItem(at index: Int) { - - return cuckoo_manager.call("removeItem(at: Int)", - parameters: (index), - escapingParameters: (index), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.removeItem(at: index)) - - } - - - - func proceed() { + func confirm() { - return cuckoo_manager.call("proceed()", + return cuckoo_manager.call("confirm()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.confirm()) } - func dismiss() { + func selectAccount() { - return cuckoo_manager.call("dismiss()", + return cuckoo_manager.call("selectAccount()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.dismiss()) + defaultCall: __defaultImplStub!.selectAccount()) } - struct __StubbingProxy_SelectedValidatorListPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMoreConfirmationPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -33365,32 +32327,22 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func didSelectValidator(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "didSelectValidator(at: Int)", parameterMatchers: matchers)) - } - - func removeItem(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "removeItem(at: Int)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) } - func dismiss() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func selectAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListPresenterProtocol.self, method: "dismiss()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationPresenterProtocol.self, method: "selectAccount()", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectedValidatorListPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreConfirmationPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -33411,33 +32363,21 @@ import SoraFoundation } @discardableResult - func didSelectValidator(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("didSelectValidator(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func removeItem(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("removeItem(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { + func confirm() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func dismiss() -> Cuckoo.__DoNotUse<(), Void> { + func selectAccount() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("dismiss()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("selectAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectedValidatorListPresenterProtocolStub: SelectedValidatorListPresenterProtocol { + class StakingBondMoreConfirmationPresenterProtocolStub: StakingBondMoreConfirmationPresenterProtocol { @@ -33451,25 +32391,13 @@ import SoraFoundation - func didSelectValidator(at index: Int) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func removeItem(at index: Int) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func proceed() { + func confirm() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func dismiss() { + func selectAccount() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -33477,19 +32405,19 @@ import SoraFoundation - class MockSelectedValidatorListViewModelFactoryProtocol: SelectedValidatorListViewModelFactoryProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreConfirmationInteractorInputProtocol: StakingBondMoreConfirmationInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectedValidatorListViewModelFactoryProtocol + typealias MocksType = StakingBondMoreConfirmationInteractorInputProtocol - typealias Stubbing = __StubbingProxy_SelectedValidatorListViewModelFactoryProtocol - typealias Verification = __VerificationProxy_SelectedValidatorListViewModelFactoryProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingBondMoreConfirmationInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectedValidatorListViewModelFactoryProtocol? + private var __defaultImplStub: StakingBondMoreConfirmationInteractorInputProtocol? - func enableDefaultImplementation(_ stub: SelectedValidatorListViewModelFactoryProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -33502,21 +32430,51 @@ import SoraFoundation - func createViewModel(from validatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel { + func setup() { - return cuckoo_manager.call("createViewModel(from: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel", - parameters: (validatorList, totalValidatorsCount, locale), - escapingParameters: (validatorList, totalValidatorsCount, locale), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.createViewModel(from: validatorList, totalValidatorsCount: totalValidatorsCount, locale: locale)) + defaultCall: __defaultImplStub!.setup()) + + } + + + + func submit(for amount: Decimal) { + + return cuckoo_manager.call("submit(for: Decimal)", + parameters: (amount), + escapingParameters: (amount), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.submit(for: amount)) + + } + + + + func estimateFee(for amount: Decimal) { + + return cuckoo_manager.call("estimateFee(for: Decimal)", + parameters: (amount), + escapingParameters: (amount), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.estimateFee(for: amount)) } - struct __StubbingProxy_SelectedValidatorListViewModelFactoryProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMoreConfirmationInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -33524,14 +32482,24 @@ import SoraFoundation } - func createViewModel(from validatorList: M1, totalValidatorsCount: M2, locale: M3) -> Cuckoo.ProtocolStubFunction<([SelectedValidatorInfo], Int, Locale), SelectedValidatorListViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == Int, M3.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], Int, Locale)>] = [wrap(matchable: validatorList) { $0.0 }, wrap(matchable: totalValidatorsCount) { $0.1 }, wrap(matchable: locale) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListViewModelFactoryProtocol.self, method: "createViewModel(from: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func submit(for amount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationInteractorInputProtocol.self, method: "submit(for: Decimal)", parameterMatchers: matchers)) + } + + func estimateFee(for amount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationInteractorInputProtocol.self, method: "estimateFee(for: Decimal)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectedValidatorListViewModelFactoryProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreConfirmationInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -33546,15 +32514,27 @@ import SoraFoundation @discardableResult - func createViewModel(from validatorList: M1, totalValidatorsCount: M2, locale: M3) -> Cuckoo.__DoNotUse<([SelectedValidatorInfo], Int, Locale), SelectedValidatorListViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == Int, M3.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], Int, Locale)>] = [wrap(matchable: validatorList) { $0.0 }, wrap(matchable: totalValidatorsCount) { $0.1 }, wrap(matchable: locale) { $0.2 }] - return cuckoo_manager.verify("createViewModel(from: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func submit(for amount: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] + return cuckoo_manager.verify("submit(for: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func estimateFee(for amount: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] + return cuckoo_manager.verify("estimateFee(for: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectedValidatorListViewModelFactoryProtocolStub: SelectedValidatorListViewModelFactoryProtocol { + class StakingBondMoreConfirmationInteractorInputProtocolStub: StakingBondMoreConfirmationInteractorInputProtocol { @@ -33562,27 +32542,39 @@ import SoraFoundation - func createViewModel(from validatorList: [SelectedValidatorInfo], totalValidatorsCount: Int, locale: Locale) -> SelectedValidatorListViewModel { - return DefaultValueRegistry.defaultValue(for: (SelectedValidatorListViewModel).self) + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func submit(for amount: Decimal) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func estimateFee(for amount: Decimal) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } } - class MockSelectedValidatorListWireframeProtocol: SelectedValidatorListWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreConfirmationOutputProtocol: StakingBondMoreConfirmationOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = SelectedValidatorListWireframeProtocol + typealias MocksType = StakingBondMoreConfirmationOutputProtocol - typealias Stubbing = __StubbingProxy_SelectedValidatorListWireframeProtocol - typealias Verification = __VerificationProxy_SelectedValidatorListWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationOutputProtocol + typealias Verification = __VerificationProxy_StakingBondMoreConfirmationOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: SelectedValidatorListWireframeProtocol? + private var __defaultImplStub: StakingBondMoreConfirmationOutputProtocol? - func enableDefaultImplementation(_ stub: SelectedValidatorListWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -33595,81 +32587,96 @@ import SoraFoundation - func present(_ validatorInfo: ValidatorInfoProtocol, from view: ControllerBackedProtocol?) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", - parameters: (validatorInfo, view), - escapingParameters: (validatorInfo, view), + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(validatorInfo, from: view)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - func proceed(from view: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int) { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("proceed(from: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", - parameters: (view, targets, maxTargets), - escapingParameters: (view, targets, maxTargets), + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed(from: view, targets: targets, maxTargets: maxTargets)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - func dismiss(_ view: ControllerBackedProtocol?) { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("dismiss(_: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.dismiss(view)) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func didReceiveStash(result: Result) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), - superclassCall: + return cuckoo_manager.call("didReceiveStash(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.didReceiveStash(result: result)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceiveStashItem(result: Result) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("didReceiveStashItem(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) + + } + + + + func didSubmitBonding(result: Result) { + + return cuckoo_manager.call("didSubmitBonding(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didSubmitBonding(result: result)) } - struct __StubbingProxy_SelectedValidatorListWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMoreConfirmationOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -33677,34 +32684,39 @@ import SoraFoundation } - func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoProtocol, ControllerBackedProtocol?)> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func proceed(from view: M1, targets: M2, maxTargets: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(SelectedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)> where M1.OptionalMatchedType == SelectedValidatorListViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: targets) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "proceed(from: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } - func dismiss(_ view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "dismiss(_: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveStash(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceiveStash(result: Result)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockSelectedValidatorListWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + } + + func didSubmitBonding(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didSubmitBonding(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_SelectedValidatorListWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreConfirmationOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -33719,39 +32731,45 @@ import SoraFoundation @discardableResult - func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.__DoNotUse<(ValidatorInfoProtocol, ControllerBackedProtocol?), Void> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceed(from view: M1, targets: M2, maxTargets: M3) -> Cuckoo.__DoNotUse<(SelectedValidatorListViewProtocol?, [SelectedValidatorInfo], Int), Void> where M1.OptionalMatchedType == SelectedValidatorListViewProtocol, M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(SelectedValidatorListViewProtocol?, [SelectedValidatorInfo], Int)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: targets) { $0.1 }, wrap(matchable: maxTargets) { $0.2 }] - return cuckoo_manager.verify("proceed(from: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func dismiss(_ view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("dismiss(_: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStash(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStash(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didSubmitBonding(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didSubmitBonding(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class SelectedValidatorListWireframeProtocolStub: SelectedValidatorListWireframeProtocol { + class StakingBondMoreConfirmationOutputProtocolStub: StakingBondMoreConfirmationOutputProtocol { @@ -33759,153 +32777,114 @@ import SoraFoundation - func present(_ validatorInfo: ValidatorInfoProtocol, from view: ControllerBackedProtocol?) { + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func proceed(from view: SelectedValidatorListViewProtocol?, targets: [SelectedValidatorInfo], maxTargets: Int) { + func didReceivePriceData(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func dismiss(_ view: ControllerBackedProtocol?) { + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func didReceiveStash(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceiveStashItem(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didSubmitBonding(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import Foundation -import SoraFoundation - - class MockValidatorStakeInfoProtocol: ValidatorStakeInfoProtocol, Cuckoo.ProtocolMock { + class MockStakingBondMoreConfirmationWireframeProtocol: StakingBondMoreConfirmationWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorStakeInfoProtocol + typealias MocksType = StakingBondMoreConfirmationWireframeProtocol - typealias Stubbing = __StubbingProxy_ValidatorStakeInfoProtocol - typealias Verification = __VerificationProxy_ValidatorStakeInfoProtocol + typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationWireframeProtocol + typealias Verification = __VerificationProxy_StakingBondMoreConfirmationWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorStakeInfoProtocol? + private var __defaultImplStub: StakingBondMoreConfirmationWireframeProtocol? - func enableDefaultImplementation(_ stub: ValidatorStakeInfoProtocol) { + func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + - - var nominators: [NominatorInfo] { - get { - return cuckoo_manager.getter("nominators", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.nominators) - } - - } + - var totalStake: Decimal { - get { - return cuckoo_manager.getter("totalStake", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.totalStake) - } + func complete(from view: StakingBondMoreConfirmationViewProtocol?) { - } - - - - var ownStake: Decimal { - get { - return cuckoo_manager.getter("ownStake", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.ownStake) - } + return cuckoo_manager.call("complete(from: StakingBondMoreConfirmationViewProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.complete(from: view)) } - var stakeReturn: Decimal { - get { - return cuckoo_manager.getter("stakeReturn", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.stakeReturn) - } + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - } - - - - var maxNominatorsRewarded: UInt32 { - get { - return cuckoo_manager.getter("maxNominatorsRewarded", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.maxNominatorsRewarded) - } + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - var oversubscribed: Bool { - get { - return cuckoo_manager.getter("oversubscribed", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.oversubscribed) - } + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - - - - - struct __StubbingProxy_ValidatorStakeInfoProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingBondMoreConfirmationWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -33913,39 +32892,24 @@ import SoraFoundation } - var nominators: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "nominators") - } - - - var totalStake: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "totalStake") - } - - - var ownStake: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "ownStake") - } - - - var stakeReturn: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "stakeReturn") + func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingBondMoreConfirmationViewProtocol?)> where M1.OptionalMatchedType == StakingBondMoreConfirmationViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingBondMoreConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationWireframeProtocol.self, method: "complete(from: StakingBondMoreConfirmationViewProtocol?)", parameterMatchers: matchers)) } - - var maxNominatorsRewarded: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "maxNominatorsRewarded") + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - - var oversubscribed: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "oversubscribed") + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - } - struct __VerificationProxy_ValidatorStakeInfoProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingBondMoreConfirmationWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -33957,242 +32921,646 @@ import SoraFoundation } + - var nominators: Cuckoo.VerifyReadOnlyProperty<[NominatorInfo]> { - return .init(manager: cuckoo_manager, name: "nominators", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var totalStake: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "totalStake", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var ownStake: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "ownStake", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var stakeReturn: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "stakeReturn", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingBondMoreConfirmationViewProtocol?), Void> where M1.OptionalMatchedType == StakingBondMoreConfirmationViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingBondMoreConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(from: StakingBondMoreConfirmationViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var maxNominatorsRewarded: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "maxNominatorsRewarded", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var oversubscribed: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "oversubscribed", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - } } - class ValidatorStakeInfoProtocolStub: ValidatorStakeInfoProtocol { - + class StakingBondMoreConfirmationWireframeProtocolStub: StakingBondMoreConfirmationWireframeProtocol { + + + - var nominators: [NominatorInfo] { - get { - return DefaultValueRegistry.defaultValue(for: ([NominatorInfo]).self) - } - - } - - var totalStake: Decimal { - get { - return DefaultValueRegistry.defaultValue(for: (Decimal).self) - } - + func complete(from view: StakingBondMoreConfirmationViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var ownStake: Decimal { - get { - return DefaultValueRegistry.defaultValue(for: (Decimal).self) - } - + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var stakeReturn: Decimal { - get { - return DefaultValueRegistry.defaultValue(for: (Decimal).self) - } - + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - +} + + +import Cuckoo +@testable import novawallet + +import BigInt +import Foundation + + + class MockStakingRelaychainInteractorInputProtocol: StakingRelaychainInteractorInputProtocol, Cuckoo.ProtocolMock { - var maxNominatorsRewarded: UInt32 { - get { - return DefaultValueRegistry.defaultValue(for: (UInt32).self) - } - + typealias MocksType = StakingRelaychainInteractorInputProtocol + + typealias Stubbing = __StubbingProxy_StakingRelaychainInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingRelaychainInteractorInputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: StakingRelaychainInteractorInputProtocol? + + func enableDefaultImplementation(_ stub: StakingRelaychainInteractorInputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } - + - var oversubscribed: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } + + + + + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) } + struct __StubbingProxy_StakingRelaychainInteractorInputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_StakingRelaychainInteractorInputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class StakingRelaychainInteractorInputProtocolStub: StakingRelaychainInteractorInputProtocol { + + + + + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } - class MockValidatorInfoProtocol: ValidatorInfoProtocol, Cuckoo.ProtocolMock { + class MockStakingRelaychainInteractorOutputProtocol: StakingRelaychainInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorInfoProtocol + typealias MocksType = StakingRelaychainInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_ValidatorInfoProtocol - typealias Verification = __VerificationProxy_ValidatorInfoProtocol + typealias Stubbing = __StubbingProxy_StakingRelaychainInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingRelaychainInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorInfoProtocol? + private var __defaultImplStub: StakingRelaychainInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: ValidatorInfoProtocol) { + func enableDefaultImplementation(_ stub: StakingRelaychainInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - var address: String { - get { - return cuckoo_manager.getter("address", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.address) - } + + + func didReceive(selectedAddress: String) { + + return cuckoo_manager.call("didReceive(selectedAddress: String)", + parameters: (selectedAddress), + escapingParameters: (selectedAddress), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(selectedAddress: selectedAddress)) } - var identity: AccountIdentity? { - get { - return cuckoo_manager.getter("identity", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.identity) - } + func didReceive(price: PriceData?) { + + return cuckoo_manager.call("didReceive(price: PriceData?)", + parameters: (price), + escapingParameters: (price), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(price: price)) } - var stakeInfo: ValidatorStakeInfoProtocol? { - get { - return cuckoo_manager.getter("stakeInfo", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.stakeInfo) - } + func didReceive(priceError: Error) { + + return cuckoo_manager.call("didReceive(priceError: Error)", + parameters: (priceError), + escapingParameters: (priceError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(priceError: priceError)) } - var myNomination: ValidatorMyNominationStatus? { - get { - return cuckoo_manager.getter("myNomination", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.myNomination) - } + func didReceive(totalReward: TotalRewardItem) { + + return cuckoo_manager.call("didReceive(totalReward: TotalRewardItem)", + parameters: (totalReward), + escapingParameters: (totalReward), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(totalReward: totalReward)) } - var totalStake: Decimal { - get { - return cuckoo_manager.getter("totalStake", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.totalStake) - } + func didReceive(totalRewardError: Error) { + + return cuckoo_manager.call("didReceive(totalRewardError: Error)", + parameters: (totalRewardError), + escapingParameters: (totalRewardError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(totalRewardError: totalRewardError)) } - var ownStake: Decimal { - get { - return cuckoo_manager.getter("ownStake", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.ownStake) - } + func didReceive(accountInfo: AccountInfo?) { + + return cuckoo_manager.call("didReceive(accountInfo: AccountInfo?)", + parameters: (accountInfo), + escapingParameters: (accountInfo), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(accountInfo: accountInfo)) } - var hasSlashes: Bool { - get { - return cuckoo_manager.getter("hasSlashes", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.hasSlashes) - } + func didReceive(balanceError: Error) { + + return cuckoo_manager.call("didReceive(balanceError: Error)", + parameters: (balanceError), + escapingParameters: (balanceError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(balanceError: balanceError)) } - var blocked: Bool { - get { - return cuckoo_manager.getter("blocked", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.blocked) - } + func didReceive(calculator: RewardCalculatorEngineProtocol) { + + return cuckoo_manager.call("didReceive(calculator: RewardCalculatorEngineProtocol)", + parameters: (calculator), + escapingParameters: (calculator), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(calculator: calculator)) + + } + + + + func didReceive(calculatorError: Error) { + + return cuckoo_manager.call("didReceive(calculatorError: Error)", + parameters: (calculatorError), + escapingParameters: (calculatorError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(calculatorError: calculatorError)) + + } + + + + func didReceive(stashItem: StashItem?) { + + return cuckoo_manager.call("didReceive(stashItem: StashItem?)", + parameters: (stashItem), + escapingParameters: (stashItem), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(stashItem: stashItem)) + + } + + + + func didReceive(stashItemError: Error) { + + return cuckoo_manager.call("didReceive(stashItemError: Error)", + parameters: (stashItemError), + escapingParameters: (stashItemError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(stashItemError: stashItemError)) + + } + + + + func didReceive(ledgerInfo: StakingLedger?) { + + return cuckoo_manager.call("didReceive(ledgerInfo: StakingLedger?)", + parameters: (ledgerInfo), + escapingParameters: (ledgerInfo), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(ledgerInfo: ledgerInfo)) + + } + + + + func didReceive(ledgerInfoError: Error) { + + return cuckoo_manager.call("didReceive(ledgerInfoError: Error)", + parameters: (ledgerInfoError), + escapingParameters: (ledgerInfoError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(ledgerInfoError: ledgerInfoError)) + + } + + + + func didReceive(nomination: Nomination?) { + + return cuckoo_manager.call("didReceive(nomination: Nomination?)", + parameters: (nomination), + escapingParameters: (nomination), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(nomination: nomination)) + + } + + + + func didReceive(nominationError: Error) { + + return cuckoo_manager.call("didReceive(nominationError: Error)", + parameters: (nominationError), + escapingParameters: (nominationError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(nominationError: nominationError)) + + } + + + + func didReceive(validatorPrefs: ValidatorPrefs?) { + + return cuckoo_manager.call("didReceive(validatorPrefs: ValidatorPrefs?)", + parameters: (validatorPrefs), + escapingParameters: (validatorPrefs), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(validatorPrefs: validatorPrefs)) + + } + + + + func didReceive(validatorError: Error) { + + return cuckoo_manager.call("didReceive(validatorError: Error)", + parameters: (validatorError), + escapingParameters: (validatorError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(validatorError: validatorError)) + + } + + + + func didReceive(eraStakersInfo: EraStakersInfo) { + + return cuckoo_manager.call("didReceive(eraStakersInfo: EraStakersInfo)", + parameters: (eraStakersInfo), + escapingParameters: (eraStakersInfo), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(eraStakersInfo: eraStakersInfo)) + + } + + + + func didReceive(eraStakersInfoError: Error) { + + return cuckoo_manager.call("didReceive(eraStakersInfoError: Error)", + parameters: (eraStakersInfoError), + escapingParameters: (eraStakersInfoError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(eraStakersInfoError: eraStakersInfoError)) + + } + + + + func didReceive(networkStakingInfo: NetworkStakingInfo) { + + return cuckoo_manager.call("didReceive(networkStakingInfo: NetworkStakingInfo)", + parameters: (networkStakingInfo), + escapingParameters: (networkStakingInfo), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(networkStakingInfo: networkStakingInfo)) + + } + + + + func didReceive(networkStakingInfoError: Error) { + + return cuckoo_manager.call("didReceive(networkStakingInfoError: Error)", + parameters: (networkStakingInfoError), + escapingParameters: (networkStakingInfoError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(networkStakingInfoError: networkStakingInfoError)) + + } + + + + func didReceive(payee: RewardDestinationArg?) { + + return cuckoo_manager.call("didReceive(payee: RewardDestinationArg?)", + parameters: (payee), + escapingParameters: (payee), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(payee: payee)) + + } + + + + func didReceive(payeeError: Error) { + + return cuckoo_manager.call("didReceive(payeeError: Error)", + parameters: (payeeError), + escapingParameters: (payeeError), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(payeeError: payeeError)) + + } + + + + func didReceive(newChainAsset: ChainAsset) { + + return cuckoo_manager.call("didReceive(newChainAsset: ChainAsset)", + parameters: (newChainAsset), + escapingParameters: (newChainAsset), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(newChainAsset: newChainAsset)) + + } + + + + func didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod) { + + return cuckoo_manager.call("didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod)", + parameters: (subqueryRewards, period), + escapingParameters: (subqueryRewards, period), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceieve(subqueryRewards: subqueryRewards, period: period)) } - - + + func didReceiveMinNominatorBond(result: Result) { + + return cuckoo_manager.call("didReceiveMinNominatorBond(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMinNominatorBond(result: result)) + + } + + + + func didReceiveCounterForNominators(result: Result) { + + return cuckoo_manager.call("didReceiveCounterForNominators(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveCounterForNominators(result: result)) + + } + + + + func didReceiveMaxNominatorsCount(result: Result) { + + return cuckoo_manager.call("didReceiveMaxNominatorsCount(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMaxNominatorsCount(result: result)) + + } + + + + func didReceive(eraCountdownResult: Result) { + + return cuckoo_manager.call("didReceive(eraCountdownResult: Result)", + parameters: (eraCountdownResult), + escapingParameters: (eraCountdownResult), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(eraCountdownResult: eraCountdownResult)) + + } + + + + func didReceiveMaxNominatorsPerValidator(result: Result) { + + return cuckoo_manager.call("didReceiveMaxNominatorsPerValidator(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMaxNominatorsPerValidator(result: result)) + + } + + + + func didReceiveAccount(_ account: MetaChainAccountResponse?, for accountId: AccountId) { + + return cuckoo_manager.call("didReceiveAccount(_: MetaChainAccountResponse?, for: AccountId)", + parameters: (account, accountId), + escapingParameters: (account, accountId), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAccount(account, for: accountId)) + + } - struct __StubbingProxy_ValidatorInfoProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRelaychainInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -34200,698 +33568,555 @@ import SoraFoundation } - var address: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "address") + func didReceive(selectedAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: selectedAddress) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(selectedAddress: String)", parameterMatchers: matchers)) } + func didReceive(price: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PriceData?)> where M1.OptionalMatchedType == PriceData { + let matchers: [Cuckoo.ParameterMatcher<(PriceData?)>] = [wrap(matchable: price) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(price: PriceData?)", parameterMatchers: matchers)) + } - var identity: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "identity") + func didReceive(priceError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: priceError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(priceError: Error)", parameterMatchers: matchers)) } + func didReceive(totalReward: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(TotalRewardItem)> where M1.MatchedType == TotalRewardItem { + let matchers: [Cuckoo.ParameterMatcher<(TotalRewardItem)>] = [wrap(matchable: totalReward) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(totalReward: TotalRewardItem)", parameterMatchers: matchers)) + } - var stakeInfo: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "stakeInfo") + func didReceive(totalRewardError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: totalRewardError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(totalRewardError: Error)", parameterMatchers: matchers)) } + func didReceive(accountInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountInfo?)> where M1.OptionalMatchedType == AccountInfo { + let matchers: [Cuckoo.ParameterMatcher<(AccountInfo?)>] = [wrap(matchable: accountInfo) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(accountInfo: AccountInfo?)", parameterMatchers: matchers)) + } - var myNomination: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "myNomination") + func didReceive(balanceError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: balanceError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(balanceError: Error)", parameterMatchers: matchers)) + } + + func didReceive(calculator: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RewardCalculatorEngineProtocol)> where M1.MatchedType == RewardCalculatorEngineProtocol { + let matchers: [Cuckoo.ParameterMatcher<(RewardCalculatorEngineProtocol)>] = [wrap(matchable: calculator) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(calculator: RewardCalculatorEngineProtocol)", parameterMatchers: matchers)) + } + + func didReceive(calculatorError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: calculatorError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(calculatorError: Error)", parameterMatchers: matchers)) + } + + func didReceive(stashItem: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StashItem?)> where M1.OptionalMatchedType == StashItem { + let matchers: [Cuckoo.ParameterMatcher<(StashItem?)>] = [wrap(matchable: stashItem) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(stashItem: StashItem?)", parameterMatchers: matchers)) + } + + func didReceive(stashItemError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: stashItemError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(stashItemError: Error)", parameterMatchers: matchers)) + } + + func didReceive(ledgerInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingLedger?)> where M1.OptionalMatchedType == StakingLedger { + let matchers: [Cuckoo.ParameterMatcher<(StakingLedger?)>] = [wrap(matchable: ledgerInfo) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(ledgerInfo: StakingLedger?)", parameterMatchers: matchers)) + } + + func didReceive(ledgerInfoError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: ledgerInfoError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(ledgerInfoError: Error)", parameterMatchers: matchers)) + } + + func didReceive(nomination: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Nomination?)> where M1.OptionalMatchedType == Nomination { + let matchers: [Cuckoo.ParameterMatcher<(Nomination?)>] = [wrap(matchable: nomination) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(nomination: Nomination?)", parameterMatchers: matchers)) + } + + func didReceive(nominationError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: nominationError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(nominationError: Error)", parameterMatchers: matchers)) + } + + func didReceive(validatorPrefs: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorPrefs?)> where M1.OptionalMatchedType == ValidatorPrefs { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorPrefs?)>] = [wrap(matchable: validatorPrefs) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(validatorPrefs: ValidatorPrefs?)", parameterMatchers: matchers)) + } + + func didReceive(validatorError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: validatorError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(validatorError: Error)", parameterMatchers: matchers)) + } + + func didReceive(eraStakersInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(EraStakersInfo)> where M1.MatchedType == EraStakersInfo { + let matchers: [Cuckoo.ParameterMatcher<(EraStakersInfo)>] = [wrap(matchable: eraStakersInfo) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(eraStakersInfo: EraStakersInfo)", parameterMatchers: matchers)) + } + + func didReceive(eraStakersInfoError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: eraStakersInfoError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(eraStakersInfoError: Error)", parameterMatchers: matchers)) + } + + func didReceive(networkStakingInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(NetworkStakingInfo)> where M1.MatchedType == NetworkStakingInfo { + let matchers: [Cuckoo.ParameterMatcher<(NetworkStakingInfo)>] = [wrap(matchable: networkStakingInfo) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(networkStakingInfo: NetworkStakingInfo)", parameterMatchers: matchers)) + } + + func didReceive(networkStakingInfoError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: networkStakingInfoError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(networkStakingInfoError: Error)", parameterMatchers: matchers)) + } + + func didReceive(payee: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RewardDestinationArg?)> where M1.OptionalMatchedType == RewardDestinationArg { + let matchers: [Cuckoo.ParameterMatcher<(RewardDestinationArg?)>] = [wrap(matchable: payee) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(payee: RewardDestinationArg?)", parameterMatchers: matchers)) + } + + func didReceive(payeeError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: payeeError) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(payeeError: Error)", parameterMatchers: matchers)) + } + + func didReceive(newChainAsset: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainAsset)> where M1.MatchedType == ChainAsset { + let matchers: [Cuckoo.ParameterMatcher<(ChainAsset)>] = [wrap(matchable: newChainAsset) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(newChainAsset: ChainAsset)", parameterMatchers: matchers)) + } + + func didReceieve(subqueryRewards: M1, period: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[SubqueryRewardItemData]?, Error>, AnalyticsPeriod)> where M1.MatchedType == Result<[SubqueryRewardItemData]?, Error>, M2.MatchedType == AnalyticsPeriod { + let matchers: [Cuckoo.ParameterMatcher<(Result<[SubqueryRewardItemData]?, Error>, AnalyticsPeriod)>] = [wrap(matchable: subqueryRewards) { $0.0 }, wrap(matchable: period) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod)", parameterMatchers: matchers)) + } + + func didReceiveMinNominatorBond(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveMinNominatorBond(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveCounterForNominators(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveCounterForNominators(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveMaxNominatorsCount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveMaxNominatorsCount(result: Result)", parameterMatchers: matchers)) + } + + func didReceive(eraCountdownResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: eraCountdownResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(eraCountdownResult: Result)", parameterMatchers: matchers)) + } + + func didReceiveMaxNominatorsPerValidator(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveMaxNominatorsPerValidator(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveAccount(_ account: M1, for accountId: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaChainAccountResponse?, AccountId)> where M1.OptionalMatchedType == MetaChainAccountResponse, M2.MatchedType == AccountId { + let matchers: [Cuckoo.ParameterMatcher<(MetaChainAccountResponse?, AccountId)>] = [wrap(matchable: account) { $0.0 }, wrap(matchable: accountId) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveAccount(_: MetaChainAccountResponse?, for: AccountId)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_StakingRelaychainInteractorOutputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didReceive(selectedAddress: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: selectedAddress) { $0 }] + return cuckoo_manager.verify("didReceive(selectedAddress: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(price: M1) -> Cuckoo.__DoNotUse<(PriceData?), Void> where M1.OptionalMatchedType == PriceData { + let matchers: [Cuckoo.ParameterMatcher<(PriceData?)>] = [wrap(matchable: price) { $0 }] + return cuckoo_manager.verify("didReceive(price: PriceData?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(priceError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: priceError) { $0 }] + return cuckoo_manager.verify("didReceive(priceError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(totalReward: M1) -> Cuckoo.__DoNotUse<(TotalRewardItem), Void> where M1.MatchedType == TotalRewardItem { + let matchers: [Cuckoo.ParameterMatcher<(TotalRewardItem)>] = [wrap(matchable: totalReward) { $0 }] + return cuckoo_manager.verify("didReceive(totalReward: TotalRewardItem)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(totalRewardError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: totalRewardError) { $0 }] + return cuckoo_manager.verify("didReceive(totalRewardError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(accountInfo: M1) -> Cuckoo.__DoNotUse<(AccountInfo?), Void> where M1.OptionalMatchedType == AccountInfo { + let matchers: [Cuckoo.ParameterMatcher<(AccountInfo?)>] = [wrap(matchable: accountInfo) { $0 }] + return cuckoo_manager.verify("didReceive(accountInfo: AccountInfo?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(balanceError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: balanceError) { $0 }] + return cuckoo_manager.verify("didReceive(balanceError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(calculator: M1) -> Cuckoo.__DoNotUse<(RewardCalculatorEngineProtocol), Void> where M1.MatchedType == RewardCalculatorEngineProtocol { + let matchers: [Cuckoo.ParameterMatcher<(RewardCalculatorEngineProtocol)>] = [wrap(matchable: calculator) { $0 }] + return cuckoo_manager.verify("didReceive(calculator: RewardCalculatorEngineProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(calculatorError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: calculatorError) { $0 }] + return cuckoo_manager.verify("didReceive(calculatorError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(stashItem: M1) -> Cuckoo.__DoNotUse<(StashItem?), Void> where M1.OptionalMatchedType == StashItem { + let matchers: [Cuckoo.ParameterMatcher<(StashItem?)>] = [wrap(matchable: stashItem) { $0 }] + return cuckoo_manager.verify("didReceive(stashItem: StashItem?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(stashItemError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: stashItemError) { $0 }] + return cuckoo_manager.verify("didReceive(stashItemError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(ledgerInfo: M1) -> Cuckoo.__DoNotUse<(StakingLedger?), Void> where M1.OptionalMatchedType == StakingLedger { + let matchers: [Cuckoo.ParameterMatcher<(StakingLedger?)>] = [wrap(matchable: ledgerInfo) { $0 }] + return cuckoo_manager.verify("didReceive(ledgerInfo: StakingLedger?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(ledgerInfoError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: ledgerInfoError) { $0 }] + return cuckoo_manager.verify("didReceive(ledgerInfoError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(nomination: M1) -> Cuckoo.__DoNotUse<(Nomination?), Void> where M1.OptionalMatchedType == Nomination { + let matchers: [Cuckoo.ParameterMatcher<(Nomination?)>] = [wrap(matchable: nomination) { $0 }] + return cuckoo_manager.verify("didReceive(nomination: Nomination?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var totalStake: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "totalStake") + @discardableResult + func didReceive(nominationError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: nominationError) { $0 }] + return cuckoo_manager.verify("didReceive(nominationError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var ownStake: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "ownStake") + @discardableResult + func didReceive(validatorPrefs: M1) -> Cuckoo.__DoNotUse<(ValidatorPrefs?), Void> where M1.OptionalMatchedType == ValidatorPrefs { + let matchers: [Cuckoo.ParameterMatcher<(ValidatorPrefs?)>] = [wrap(matchable: validatorPrefs) { $0 }] + return cuckoo_manager.verify("didReceive(validatorPrefs: ValidatorPrefs?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var hasSlashes: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "hasSlashes") + @discardableResult + func didReceive(validatorError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: validatorError) { $0 }] + return cuckoo_manager.verify("didReceive(validatorError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var blocked: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "blocked") + @discardableResult + func didReceive(eraStakersInfo: M1) -> Cuckoo.__DoNotUse<(EraStakersInfo), Void> where M1.MatchedType == EraStakersInfo { + let matchers: [Cuckoo.ParameterMatcher<(EraStakersInfo)>] = [wrap(matchable: eraStakersInfo) { $0 }] + return cuckoo_manager.verify("didReceive(eraStakersInfo: EraStakersInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - } - - struct __VerificationProxy_ValidatorInfoProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation + @discardableResult + func didReceive(eraStakersInfoError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: eraStakersInfoError) { $0 }] + return cuckoo_manager.verify("didReceive(eraStakersInfoError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - - var address: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "address", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceive(networkStakingInfo: M1) -> Cuckoo.__DoNotUse<(NetworkStakingInfo), Void> where M1.MatchedType == NetworkStakingInfo { + let matchers: [Cuckoo.ParameterMatcher<(NetworkStakingInfo)>] = [wrap(matchable: networkStakingInfo) { $0 }] + return cuckoo_manager.verify("didReceive(networkStakingInfo: NetworkStakingInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var identity: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "identity", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceive(networkStakingInfoError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: networkStakingInfoError) { $0 }] + return cuckoo_manager.verify("didReceive(networkStakingInfoError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var stakeInfo: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "stakeInfo", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceive(payee: M1) -> Cuckoo.__DoNotUse<(RewardDestinationArg?), Void> where M1.OptionalMatchedType == RewardDestinationArg { + let matchers: [Cuckoo.ParameterMatcher<(RewardDestinationArg?)>] = [wrap(matchable: payee) { $0 }] + return cuckoo_manager.verify("didReceive(payee: RewardDestinationArg?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var myNomination: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "myNomination", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceive(payeeError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: payeeError) { $0 }] + return cuckoo_manager.verify("didReceive(payeeError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var totalStake: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "totalStake", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceive(newChainAsset: M1) -> Cuckoo.__DoNotUse<(ChainAsset), Void> where M1.MatchedType == ChainAsset { + let matchers: [Cuckoo.ParameterMatcher<(ChainAsset)>] = [wrap(matchable: newChainAsset) { $0 }] + return cuckoo_manager.verify("didReceive(newChainAsset: ChainAsset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didReceieve(subqueryRewards: M1, period: M2) -> Cuckoo.__DoNotUse<(Result<[SubqueryRewardItemData]?, Error>, AnalyticsPeriod), Void> where M1.MatchedType == Result<[SubqueryRewardItemData]?, Error>, M2.MatchedType == AnalyticsPeriod { + let matchers: [Cuckoo.ParameterMatcher<(Result<[SubqueryRewardItemData]?, Error>, AnalyticsPeriod)>] = [wrap(matchable: subqueryRewards) { $0.0 }, wrap(matchable: period) { $0.1 }] + return cuckoo_manager.verify("didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } - var ownStake: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "ownStake", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveMinNominatorBond(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinNominatorBond(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didReceiveCounterForNominators(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveCounterForNominators(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } - var hasSlashes: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "hasSlashes", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveMaxNominatorsCount(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMaxNominatorsCount(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didReceive(eraCountdownResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: eraCountdownResult) { $0 }] + return cuckoo_manager.verify("didReceive(eraCountdownResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } - var blocked: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "blocked", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveMaxNominatorsPerValidator(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMaxNominatorsPerValidator(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - + @discardableResult + func didReceiveAccount(_ account: M1, for accountId: M2) -> Cuckoo.__DoNotUse<(MetaChainAccountResponse?, AccountId), Void> where M1.OptionalMatchedType == MetaChainAccountResponse, M2.MatchedType == AccountId { + let matchers: [Cuckoo.ParameterMatcher<(MetaChainAccountResponse?, AccountId)>] = [wrap(matchable: account) { $0.0 }, wrap(matchable: accountId) { $0.1 }] + return cuckoo_manager.verify("didReceiveAccount(_: MetaChainAccountResponse?, for: AccountId)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } } } - class ValidatorInfoProtocolStub: ValidatorInfoProtocol { - - + class StakingRelaychainInteractorOutputProtocolStub: StakingRelaychainInteractorOutputProtocol { - var address: String { - get { - return DefaultValueRegistry.defaultValue(for: (String).self) - } - - } - + + - var identity: AccountIdentity? { - get { - return DefaultValueRegistry.defaultValue(for: (AccountIdentity?).self) - } - - } - - var stakeInfo: ValidatorStakeInfoProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (ValidatorStakeInfoProtocol?).self) - } - + func didReceive(selectedAddress: String) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - var myNomination: ValidatorMyNominationStatus? { - get { - return DefaultValueRegistry.defaultValue(for: (ValidatorMyNominationStatus?).self) - } - - } - - var totalStake: Decimal { - get { - return DefaultValueRegistry.defaultValue(for: (Decimal).self) - } - + func didReceive(price: PriceData?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - var ownStake: Decimal { - get { - return DefaultValueRegistry.defaultValue(for: (Decimal).self) - } - - } - - var hasSlashes: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + func didReceive(priceError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var blocked: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + + func didReceive(totalReward: TotalRewardItem) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - -} - - - - class MockValidatorInfoViewProtocol: ValidatorInfoViewProtocol, Cuckoo.ProtocolMock { + func didReceive(totalRewardError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - typealias MocksType = ValidatorInfoViewProtocol - typealias Stubbing = __StubbingProxy_ValidatorInfoViewProtocol - typealias Verification = __VerificationProxy_ValidatorInfoViewProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ValidatorInfoViewProtocol? - - func enableDefaultImplementation(_ stub: ValidatorInfoViewProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceive(accountInfo: AccountInfo?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - + func didReceive(balanceError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - + func didReceive(calculator: RewardCalculatorEngineProtocol) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } - - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - + func didReceive(calculatorError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - - - func didRecieve(state: ValidatorInfoState) { - - return cuckoo_manager.call("didRecieve(state: ValidatorInfoState)", - parameters: (state), - escapingParameters: (state), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didRecieve(state: state)) - + func didReceive(stashItem: StashItem?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { - - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.applyLocalization()) - + func didReceive(stashItemError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - struct __StubbingProxy_ValidatorInfoViewProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") - } - - - func didRecieve(state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoState)> where M1.MatchedType == ValidatorInfoState { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoState)>] = [wrap(matchable: state) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoViewProtocol.self, method: "didRecieve(state: ValidatorInfoState)", parameterMatchers: matchers)) - } - - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ValidatorInfoViewProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - - @discardableResult - func didRecieve(state: M1) -> Cuckoo.__DoNotUse<(ValidatorInfoState), Void> where M1.MatchedType == ValidatorInfoState { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoState)>] = [wrap(matchable: state) { $0 }] - return cuckoo_manager.verify("didRecieve(state: ValidatorInfoState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ValidatorInfoViewProtocolStub: ValidatorInfoViewProtocol { - - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + func didReceive(ledgerInfo: StakingLedger?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - + func didReceive(ledgerInfoError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - - - func didRecieve(state: ValidatorInfoState) { + func didReceive(nomination: Nomination?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func didReceive(nominationError: Error) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockValidatorInfoInteractorInputProtocol: ValidatorInfoInteractorInputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = ValidatorInfoInteractorInputProtocol - typealias Stubbing = __StubbingProxy_ValidatorInfoInteractorInputProtocol - typealias Verification = __VerificationProxy_ValidatorInfoInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ValidatorInfoInteractorInputProtocol? - - func enableDefaultImplementation(_ stub: ValidatorInfoInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceive(validatorPrefs: ValidatorPrefs?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - + func didReceive(validatorError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - + func didReceive(eraStakersInfo: EraStakersInfo) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func reload() { - - return cuckoo_manager.call("reload()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.reload()) - + func didReceive(eraStakersInfoError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - struct __StubbingProxy_ValidatorInfoInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorInputProtocol.self, method: "reload()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ValidatorInfoInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func reload() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ValidatorInfoInteractorInputProtocolStub: ValidatorInfoInteractorInputProtocol { - - + func didReceive(networkStakingInfo: NetworkStakingInfo) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func setup() { + func didReceive(networkStakingInfoError: Error) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func reload() { + func didReceive(payee: RewardDestinationArg?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockValidatorInfoInteractorOutputProtocol: ValidatorInfoInteractorOutputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = ValidatorInfoInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_ValidatorInfoInteractorOutputProtocol - typealias Verification = __VerificationProxy_ValidatorInfoInteractorOutputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ValidatorInfoInteractorOutputProtocol? - - func enableDefaultImplementation(_ stub: ValidatorInfoInteractorOutputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceive(payeeError: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - + func didReceive(newChainAsset: ChainAsset) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func didReceivePriceData(result: Result) { - - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) - + func didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartLoadingValidatorInfo() { - - return cuckoo_manager.call("didStartLoadingValidatorInfo()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didStartLoadingValidatorInfo()) - + func didReceiveMinNominatorBond(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveValidatorInfo(result: Result) { - - return cuckoo_manager.call("didReceiveValidatorInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveValidatorInfo(result: result)) - + func didReceiveCounterForNominators(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - struct __StubbingProxy_ValidatorInfoInteractorOutputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) - } - - func didStartLoadingValidatorInfo() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorOutputProtocol.self, method: "didStartLoadingValidatorInfo()", parameterMatchers: matchers)) - } - - func didReceiveValidatorInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoInteractorOutputProtocol.self, method: "didReceiveValidatorInfo(result: Result)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ValidatorInfoInteractorOutputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didStartLoadingValidatorInfo() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoadingValidatorInfo()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveValidatorInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveValidatorInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ValidatorInfoInteractorOutputProtocolStub: ValidatorInfoInteractorOutputProtocol { - - + func didReceiveMaxNominatorsCount(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func didReceivePriceData(result: Result) { + func didReceive(eraCountdownResult: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartLoadingValidatorInfo() { + func didReceiveMaxNominatorsPerValidator(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveValidatorInfo(result: Result) { + func didReceiveAccount(_ account: MetaChainAccountResponse?, for accountId: AccountId) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -34899,19 +34124,19 @@ import SoraFoundation - class MockValidatorInfoPresenterProtocol: ValidatorInfoPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingRelaychainWireframeProtocol: StakingRelaychainWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorInfoPresenterProtocol + typealias MocksType = StakingRelaychainWireframeProtocol - typealias Stubbing = __StubbingProxy_ValidatorInfoPresenterProtocol - typealias Verification = __VerificationProxy_ValidatorInfoPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingRelaychainWireframeProtocol + typealias Verification = __VerificationProxy_StakingRelaychainWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorInfoPresenterProtocol? + private var __defaultImplStub: StakingRelaychainWireframeProtocol? - func enableDefaultImplementation(_ stub: ValidatorInfoPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingRelaychainWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -34924,468 +34149,246 @@ import SoraFoundation - func setup() { + func showSetupAmount(from view: StakingMainViewProtocol?) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("showSetupAmount(from: StakingMainViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.showSetupAmount(from: view)) } - func reload() { + func proceedToSelectValidatorsStart(from view: StakingMainViewProtocol?, existingBonding: ExistingBonding) { - return cuckoo_manager.call("reload()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("proceedToSelectValidatorsStart(from: StakingMainViewProtocol?, existingBonding: ExistingBonding)", + parameters: (view, existingBonding), + escapingParameters: (view, existingBonding), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload()) + defaultCall: __defaultImplStub!.proceedToSelectValidatorsStart(from: view, existingBonding: existingBonding)) } - func presentAccountOptions() { + func showRewardDetails(from view: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal) { - return cuckoo_manager.call("presentAccountOptions()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("showRewardDetails(from: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal)", + parameters: (view, maxReward, avgReward), + escapingParameters: (view, maxReward, avgReward), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentAccountOptions()) + defaultCall: __defaultImplStub!.showRewardDetails(from: view, maxReward: maxReward, avgReward: avgReward)) } - func presentTotalStake() { + func showRewardPayoutsForNominator(from view: ControllerBackedProtocol?, stashAddress: AccountAddress) { - return cuckoo_manager.call("presentTotalStake()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("showRewardPayoutsForNominator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", + parameters: (view, stashAddress), + escapingParameters: (view, stashAddress), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentTotalStake()) + defaultCall: __defaultImplStub!.showRewardPayoutsForNominator(from: view, stashAddress: stashAddress)) } - func presentIdentityItem(_ value: ValidatorInfoViewModel.IdentityItemValue) { + func showRewardPayoutsForValidator(from view: ControllerBackedProtocol?, stashAddress: AccountAddress) { - return cuckoo_manager.call("presentIdentityItem(_: ValidatorInfoViewModel.IdentityItemValue)", - parameters: (value), - escapingParameters: (value), + return cuckoo_manager.call("showRewardPayoutsForValidator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", + parameters: (view, stashAddress), + escapingParameters: (view, stashAddress), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentIdentityItem(value)) + defaultCall: __defaultImplStub!.showRewardPayoutsForValidator(from: view, stashAddress: stashAddress)) } - - struct __StubbingProxy_ValidatorInfoPresenterProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "reload()", parameterMatchers: matchers)) - } - - func presentAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "presentAccountOptions()", parameterMatchers: matchers)) - } - - func presentTotalStake() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "presentTotalStake()", parameterMatchers: matchers)) - } - - func presentIdentityItem(_ value: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoViewModel.IdentityItemValue)> where M1.MatchedType == ValidatorInfoViewModel.IdentityItemValue { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoViewModel.IdentityItemValue)>] = [wrap(matchable: value) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorInfoPresenterProtocol.self, method: "presentIdentityItem(_: ValidatorInfoViewModel.IdentityItemValue)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ValidatorInfoPresenterProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func reload() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentTotalStake() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentTotalStake()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func presentIdentityItem(_ value: M1) -> Cuckoo.__DoNotUse<(ValidatorInfoViewModel.IdentityItemValue), Void> where M1.MatchedType == ValidatorInfoViewModel.IdentityItemValue { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoViewModel.IdentityItemValue)>] = [wrap(matchable: value) { $0 }] - return cuckoo_manager.verify("presentIdentityItem(_: ValidatorInfoViewModel.IdentityItemValue)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ValidatorInfoPresenterProtocolStub: ValidatorInfoPresenterProtocol { - - - - - - - - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func reload() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentAccountOptions() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentTotalStake() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func presentIdentityItem(_ value: ValidatorInfoViewModel.IdentityItemValue) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - - - class MockValidatorInfoWireframeProtocol: ValidatorInfoWireframeProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = ValidatorInfoWireframeProtocol - typealias Stubbing = __StubbingProxy_ValidatorInfoWireframeProtocol - typealias Verification = __VerificationProxy_ValidatorInfoWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ValidatorInfoWireframeProtocol? - - func enableDefaultImplementation(_ stub: ValidatorInfoWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func showNominatorValidators(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showNominatorValidators(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showNominatorValidators(from: view)) + } - - - - - - - - struct __StubbingProxy_ValidatorInfoWireframeProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - } - - struct __VerificationProxy_ValidatorInfoWireframeProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - } -} - - class ValidatorInfoWireframeProtocolStub: ValidatorInfoWireframeProtocol { - - - - - -} - - -import Cuckoo -@testable import novawallet - -import SoraFoundation - - - class MockValidatorListFilterWireframeProtocol: ValidatorListFilterWireframeProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = ValidatorListFilterWireframeProtocol - typealias Stubbing = __StubbingProxy_ValidatorListFilterWireframeProtocol - typealias Verification = __VerificationProxy_ValidatorListFilterWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ValidatorListFilterWireframeProtocol? - - func enableDefaultImplementation(_ stub: ValidatorListFilterWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func showRewardDestination(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showRewardDestination(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showRewardDestination(from: view)) + } - - - - - - - func close(_ view: ControllerBackedProtocol?) { + func showControllerAccount(from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("close(_: ControllerBackedProtocol?)", + return cuckoo_manager.call("showControllerAccount(from: ControllerBackedProtocol?)", parameters: (view), escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(view)) + defaultCall: __defaultImplStub!.showControllerAccount(from: view)) } - - struct __StubbingProxy_ValidatorListFilterWireframeProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func close(_ view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterWireframeProtocol.self, method: "close(_: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ValidatorListFilterWireframeProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func close(_ view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(_: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ValidatorListFilterWireframeProtocolStub: ValidatorListFilterWireframeProtocol { - - - - - - func close(_ view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func showBondMore(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showBondMore(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showBondMore(from: view)) + } -} - - - - class MockValidatorListFilterViewProtocol: ValidatorListFilterViewProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = ValidatorListFilterViewProtocol - typealias Stubbing = __StubbingProxy_ValidatorListFilterViewProtocol - typealias Verification = __VerificationProxy_ValidatorListFilterViewProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ValidatorListFilterViewProtocol? - - func enableDefaultImplementation(_ stub: ValidatorListFilterViewProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func showUnbond(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showUnbond(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showUnbond(from: view)) + } - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + func showRedeem(from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showRedeem(from: ControllerBackedProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showRedeem(from: view)) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func showRebond(from view: ControllerBackedProtocol?, option: StakingRebondOption) { + + return cuckoo_manager.call("showRebond(from: ControllerBackedProtocol?, option: StakingRebondOption)", + parameters: (view, option), + escapingParameters: (view, option), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showRebond(from: view, option: option)) } - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } + func showAnalytics(from view: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode) { - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } + return cuckoo_manager.call("showAnalytics(from: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode)", + parameters: (view, mode), + escapingParameters: (view, mode), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showAnalytics(from: view, mode: mode)) } - - + + func showYourValidatorInfo(_ stashAddress: AccountAddress, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showYourValidatorInfo(_: AccountAddress, from: ControllerBackedProtocol?)", + parameters: (stashAddress, view), + escapingParameters: (stashAddress, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showYourValidatorInfo(stashAddress, from: view)) + + } - func didUpdateViewModel(_ viewModel: ValidatorListFilterViewModel) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didUpdateViewModel(_: ValidatorListFilterViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didUpdateViewModel(viewModel)) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - public func applyLocalization() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_ValidatorListFilterViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRelaychainWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -35393,34 +34396,89 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") + func showSetupAmount(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainViewProtocol?)> where M1.OptionalMatchedType == StakingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showSetupAmount(from: StakingMainViewProtocol?)", parameterMatchers: matchers)) + } + + func proceedToSelectValidatorsStart(from view: M1, existingBonding: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainViewProtocol?, ExistingBonding)> where M1.OptionalMatchedType == StakingMainViewProtocol, M2.MatchedType == ExistingBonding { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?, ExistingBonding)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: existingBonding) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "proceedToSelectValidatorsStart(from: StakingMainViewProtocol?, existingBonding: ExistingBonding)", parameterMatchers: matchers)) } + func showRewardDetails(from view: M1, maxReward: M2, avgReward: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, Decimal, Decimal)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == Decimal, M3.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, Decimal, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: maxReward) { $0.1 }, wrap(matchable: avgReward) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRewardDetails(from: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal)", parameterMatchers: matchers)) + } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func showRewardPayoutsForNominator(from view: M1, stashAddress: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, AccountAddress)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AccountAddress)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: stashAddress) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRewardPayoutsForNominator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", parameterMatchers: matchers)) } + func showRewardPayoutsForValidator(from view: M1, stashAddress: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, AccountAddress)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AccountAddress)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: stashAddress) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRewardPayoutsForValidator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", parameterMatchers: matchers)) + } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") + func showNominatorValidators(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showNominatorValidators(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } + func showRewardDestination(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRewardDestination(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } - func didUpdateViewModel(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorListFilterViewModel)> where M1.MatchedType == ValidatorListFilterViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterViewProtocol.self, method: "didUpdateViewModel(_: ValidatorListFilterViewModel)", parameterMatchers: matchers)) + func showControllerAccount(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showControllerAccount(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func showBondMore(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showBondMore(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func showUnbond(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showUnbond(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func showRedeem(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRedeem(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func showRebond(from view: M1, option: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, StakingRebondOption)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == StakingRebondOption { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, StakingRebondOption)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: option) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRebond(from: ControllerBackedProtocol?, option: StakingRebondOption)", parameterMatchers: matchers)) + } + + func showAnalytics(from view: M1, mode: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, AnalyticsContainerViewMode)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AnalyticsContainerViewMode { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AnalyticsContainerViewMode)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: mode) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showAnalytics(from: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode)", parameterMatchers: matchers)) + } + + func showYourValidatorInfo(_ stashAddress: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress, ControllerBackedProtocol?)> where M1.MatchedType == AccountAddress, M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress, ControllerBackedProtocol?)>] = [wrap(matchable: stashAddress) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showYourValidatorInfo(_: AccountAddress, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ValidatorListFilterViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRelaychainWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -35432,102 +34490,234 @@ import SoraFoundation } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func showSetupAmount(from view: M1) -> Cuckoo.__DoNotUse<(StakingMainViewProtocol?), Void> where M1.OptionalMatchedType == StakingMainViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showSetupAmount(from: StakingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func proceedToSelectValidatorsStart(from view: M1, existingBonding: M2) -> Cuckoo.__DoNotUse<(StakingMainViewProtocol?, ExistingBonding), Void> where M1.OptionalMatchedType == StakingMainViewProtocol, M2.MatchedType == ExistingBonding { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?, ExistingBonding)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: existingBonding) { $0.1 }] + return cuckoo_manager.verify("proceedToSelectValidatorsStart(from: StakingMainViewProtocol?, existingBonding: ExistingBonding)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func showRewardDetails(from view: M1, maxReward: M2, avgReward: M3) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, Decimal, Decimal), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == Decimal, M3.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, Decimal, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: maxReward) { $0.1 }, wrap(matchable: avgReward) { $0.2 }] + return cuckoo_manager.verify("showRewardDetails(from: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func showRewardPayoutsForNominator(from view: M1, stashAddress: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, AccountAddress), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AccountAddress)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: stashAddress) { $0.1 }] + return cuckoo_manager.verify("showRewardPayoutsForNominator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func showRewardPayoutsForValidator(from view: M1, stashAddress: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, AccountAddress), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AccountAddress)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: stashAddress) { $0.1 }] + return cuckoo_manager.verify("showRewardPayoutsForValidator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - + @discardableResult + func showNominatorValidators(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showNominatorValidators(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } @discardableResult - func didUpdateViewModel(_ viewModel: M1) -> Cuckoo.__DoNotUse<(ValidatorListFilterViewModel), Void> where M1.MatchedType == ValidatorListFilterViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didUpdateViewModel(_: ValidatorListFilterViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showRewardDestination(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showRewardDestination(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showControllerAccount(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showControllerAccount(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showBondMore(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showBondMore(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showUnbond(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showUnbond(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showRedeem(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showRedeem(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showRebond(from view: M1, option: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, StakingRebondOption), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == StakingRebondOption { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, StakingRebondOption)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: option) { $0.1 }] + return cuckoo_manager.verify("showRebond(from: ControllerBackedProtocol?, option: StakingRebondOption)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showAnalytics(from view: M1, mode: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, AnalyticsContainerViewMode), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AnalyticsContainerViewMode { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AnalyticsContainerViewMode)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: mode) { $0.1 }] + return cuckoo_manager.verify("showAnalytics(from: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showYourValidatorInfo(_ stashAddress: M1, from view: M2) -> Cuckoo.__DoNotUse<(AccountAddress, ControllerBackedProtocol?), Void> where M1.MatchedType == AccountAddress, M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress, ControllerBackedProtocol?)>] = [wrap(matchable: stashAddress) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("showYourValidatorInfo(_: AccountAddress, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ValidatorListFilterViewProtocolStub: ValidatorListFilterViewProtocol { - + class StakingRelaychainWireframeProtocolStub: StakingRelaychainWireframeProtocol { + - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + + + + + func showSetupAmount(from view: StakingMainViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - + + func proceedToSelectValidatorsStart(from view: StakingMainViewProtocol?, existingBonding: ExistingBonding) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - + + func showRewardDetails(from view: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - + func showRewardPayoutsForNominator(from view: ControllerBackedProtocol?, stashAddress: AccountAddress) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func didUpdateViewModel(_ viewModel: ValidatorListFilterViewModel) { + + func showRewardPayoutsForValidator(from view: ControllerBackedProtocol?, stashAddress: AccountAddress) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func showNominatorValidators(from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showRewardDestination(from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showControllerAccount(from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showBondMore(from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showUnbond(from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showRedeem(from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showRebond(from view: ControllerBackedProtocol?, option: StakingRebondOption) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showAnalytics(from view: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showYourValidatorInfo(_ stashAddress: AccountAddress, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet - class MockValidatorListFilterPresenterProtocol: ValidatorListFilterPresenterProtocol, Cuckoo.ProtocolMock { +import BigInt +import CommonWallet +import Foundation +import SoraFoundation + + + class MockStakingMainViewProtocol: StakingMainViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorListFilterPresenterProtocol + typealias MocksType = StakingMainViewProtocol - typealias Stubbing = __StubbingProxy_ValidatorListFilterPresenterProtocol - typealias Verification = __VerificationProxy_ValidatorListFilterPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingMainViewProtocol + typealias Verification = __VerificationProxy_StakingMainViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorListFilterPresenterProtocol? + private var __defaultImplStub: StakingMainViewProtocol? - func enableDefaultImplementation(_ stub: ValidatorListFilterPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingMainViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -35536,24 +34726,28 @@ import SoraFoundation - var view: ValidatorListFilterViewProtocol? { + var isSetup: Bool { get { - return cuckoo_manager.getter("view", + return cuckoo_manager.getter("isSetup", superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.view) + defaultCall: __defaultImplStub!.isSetup) } - set { - cuckoo_manager.setter("view", - value: newValue, + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.view = newValue) + defaultCall: __defaultImplStub!.controller) } } @@ -35588,76 +34782,76 @@ import SoraFoundation - func setup() { + func didReceive(viewModel: StakingMainViewModel) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(viewModel: StakingMainViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) } - func toggleFilter(for viewModel: ValidatorListFilterCellViewModel) { + func didRecieveNetworkStakingInfo(viewModel: LocalizableResource?) { - return cuckoo_manager.call("toggleFilter(for: ValidatorListFilterCellViewModel)", + return cuckoo_manager.call("didRecieveNetworkStakingInfo(viewModel: LocalizableResource?)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.toggleFilter(for: viewModel)) + defaultCall: __defaultImplStub!.didRecieveNetworkStakingInfo(viewModel: viewModel)) } - func selectSorting(for viewModel: ValidatorListFilterCellViewModel) { + func didReceiveStakingState(viewModel: StakingViewState) { - return cuckoo_manager.call("selectSorting(for: ValidatorListFilterCellViewModel)", + return cuckoo_manager.call("didReceiveStakingState(viewModel: StakingViewState)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectSorting(for: viewModel)) + defaultCall: __defaultImplStub!.didReceiveStakingState(viewModel: viewModel)) } - func applyFilter() { + func expandNetworkInfoView(_ isExpanded: Bool) { - return cuckoo_manager.call("applyFilter()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("expandNetworkInfoView(_: Bool)", + parameters: (isExpanded), + escapingParameters: (isExpanded), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyFilter()) + defaultCall: __defaultImplStub!.expandNetworkInfoView(isExpanded)) } - func resetFilter() { + func didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol) { - return cuckoo_manager.call("resetFilter()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.resetFilter()) + defaultCall: __defaultImplStub!.didReceiveStatics(viewModel: viewModel)) } @@ -35677,7 +34871,7 @@ import SoraFoundation } - struct __StubbingProxy_ValidatorListFilterPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingMainViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -35685,49 +34879,54 @@ import SoraFoundation } - var view: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "view") + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - func toggleFilter(for viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorListFilterCellViewModel)> where M1.MatchedType == ValidatorListFilterCellViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterCellViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "toggleFilter(for: ValidatorListFilterCellViewModel)", parameterMatchers: matchers)) + + func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainViewModel)> where M1.MatchedType == StakingMainViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "didReceive(viewModel: StakingMainViewModel)", parameterMatchers: matchers)) } - func selectSorting(for viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorListFilterCellViewModel)> where M1.MatchedType == ValidatorListFilterCellViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterCellViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "selectSorting(for: ValidatorListFilterCellViewModel)", parameterMatchers: matchers)) + func didRecieveNetworkStakingInfo(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "didRecieveNetworkStakingInfo(viewModel: LocalizableResource?)", parameterMatchers: matchers)) } - func applyFilter() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "applyFilter()", parameterMatchers: matchers)) + func didReceiveStakingState(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingViewState)> where M1.MatchedType == StakingViewState { + let matchers: [Cuckoo.ParameterMatcher<(StakingViewState)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "didReceiveStakingState(viewModel: StakingViewState)", parameterMatchers: matchers)) } - func resetFilter() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "resetFilter()", parameterMatchers: matchers)) + func expandNetworkInfoView(_ isExpanded: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "expandNetworkInfoView(_: Bool)", parameterMatchers: matchers)) + } + + func didReceiveStatics(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainStaticViewModelProtocol)> where M1.MatchedType == StakingMainStaticViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainStaticViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterPresenterProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_ValidatorListFilterPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingMainViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -35740,8 +34939,13 @@ import SoraFoundation - var view: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "view", callMatcher: callMatcher, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } @@ -35752,33 +34956,33 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingMainViewModel), Void> where M1.MatchedType == StakingMainViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceive(viewModel: StakingMainViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func toggleFilter(for viewModel: M1) -> Cuckoo.__DoNotUse<(ValidatorListFilterCellViewModel), Void> where M1.MatchedType == ValidatorListFilterCellViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterCellViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("toggleFilter(for: ValidatorListFilterCellViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didRecieveNetworkStakingInfo(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didRecieveNetworkStakingInfo(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectSorting(for viewModel: M1) -> Cuckoo.__DoNotUse<(ValidatorListFilterCellViewModel), Void> where M1.MatchedType == ValidatorListFilterCellViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorListFilterCellViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("selectSorting(for: ValidatorListFilterCellViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStakingState(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingViewState), Void> where M1.MatchedType == StakingViewState { + let matchers: [Cuckoo.ParameterMatcher<(StakingViewState)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveStakingState(viewModel: StakingViewState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyFilter() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyFilter()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func expandNetworkInfoView(_ isExpanded: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] + return cuckoo_manager.verify("expandNetworkInfoView(_: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func resetFilter() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("resetFilter()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStatics(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingMainStaticViewModelProtocol), Void> where M1.MatchedType == StakingMainStaticViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainStaticViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -35790,16 +34994,23 @@ import SoraFoundation } } - class ValidatorListFilterPresenterProtocolStub: ValidatorListFilterPresenterProtocol { + class StakingMainViewProtocolStub: StakingMainViewProtocol { - var view: ValidatorListFilterViewProtocol? { + var isSetup: Bool { get { - return DefaultValueRegistry.defaultValue(for: (ValidatorListFilterViewProtocol?).self) + return DefaultValueRegistry.defaultValue(for: (Bool).self) } - set { } + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } } @@ -35820,31 +35031,31 @@ import SoraFoundation - func setup() { + func didReceive(viewModel: StakingMainViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func toggleFilter(for viewModel: ValidatorListFilterCellViewModel) { + func didRecieveNetworkStakingInfo(viewModel: LocalizableResource?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectSorting(for viewModel: ValidatorListFilterCellViewModel) { + func didReceiveStakingState(viewModel: StakingViewState) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func applyFilter() { + func expandNetworkInfoView(_ isExpanded: Bool) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func resetFilter() { + func didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -35858,19 +35069,19 @@ import SoraFoundation - class MockValidatorListFilterDelegate: ValidatorListFilterDelegate, Cuckoo.ProtocolMock { + class MockStakingMainPresenterProtocol: StakingMainPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorListFilterDelegate + typealias MocksType = StakingMainPresenterProtocol - typealias Stubbing = __StubbingProxy_ValidatorListFilterDelegate - typealias Verification = __VerificationProxy_ValidatorListFilterDelegate + typealias Stubbing = __StubbingProxy_StakingMainPresenterProtocol + typealias Verification = __VerificationProxy_StakingMainPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorListFilterDelegate? + private var __defaultImplStub: StakingMainPresenterProtocol? - func enableDefaultImplementation(_ stub: ValidatorListFilterDelegate) { + func enableDefaultImplementation(_ stub: StakingMainPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -35883,164 +35094,201 @@ import SoraFoundation - func didUpdate(_ filter: CustomValidatorListFilter) { + func setup() { - return cuckoo_manager.call("didUpdate(_: CustomValidatorListFilter)", - parameters: (filter), - escapingParameters: (filter), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didUpdate(filter)) + defaultCall: __defaultImplStub!.setup()) } - - struct __StubbingProxy_ValidatorListFilterDelegate: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didUpdate(_ filter: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CustomValidatorListFilter)> where M1.MatchedType == CustomValidatorListFilter { - let matchers: [Cuckoo.ParameterMatcher<(CustomValidatorListFilter)>] = [wrap(matchable: filter) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorListFilterDelegate.self, method: "didUpdate(_: CustomValidatorListFilter)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ValidatorListFilterDelegate: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func didUpdate(_ filter: M1) -> Cuckoo.__DoNotUse<(CustomValidatorListFilter), Void> where M1.MatchedType == CustomValidatorListFilter { - let matchers: [Cuckoo.ParameterMatcher<(CustomValidatorListFilter)>] = [wrap(matchable: filter) { $0 }] - return cuckoo_manager.verify("didUpdate(_: CustomValidatorListFilter)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ValidatorListFilterDelegateStub: ValidatorListFilterDelegate { - - + func performAssetSelection() { + + return cuckoo_manager.call("performAssetSelection()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performAssetSelection()) + + } - func didUpdate(_ filter: CustomValidatorListFilter) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func performMainAction() { + + return cuckoo_manager.call("performMainAction()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performMainAction()) + } -} - - -import Cuckoo -@testable import novawallet - -import SoraFoundation - - - class MockValidatorSearchWireframeProtocol: ValidatorSearchWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorSearchWireframeProtocol - typealias Stubbing = __StubbingProxy_ValidatorSearchWireframeProtocol - typealias Verification = __VerificationProxy_ValidatorSearchWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - + func performAccountAction() { + + return cuckoo_manager.call("performAccountAction()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performAccountAction()) + + } - private var __defaultImplStub: ValidatorSearchWireframeProtocol? - - func enableDefaultImplementation(_ stub: ValidatorSearchWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + + + func performRewardInfoAction() { + + return cuckoo_manager.call("performRewardInfoAction()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performRewardInfoAction()) + } - - - + func performChangeValidatorsAction() { + + return cuckoo_manager.call("performChangeValidatorsAction()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performChangeValidatorsAction()) + + } - func present(_ validatorInfo: ValidatorInfoProtocol, from view: ControllerBackedProtocol?) { + func performSetupValidatorsForBondedAction() { - return cuckoo_manager.call("present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", - parameters: (validatorInfo, view), - escapingParameters: (validatorInfo, view), + return cuckoo_manager.call("performSetupValidatorsForBondedAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(validatorInfo, from: view)) + defaultCall: __defaultImplStub!.performSetupValidatorsForBondedAction()) } - func close(_ view: ControllerBackedProtocol?) { + func performStakeMoreAction() { - return cuckoo_manager.call("close(_: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("performStakeMoreAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(view)) + defaultCall: __defaultImplStub!.performStakeMoreAction()) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func performRedeemAction() { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("performRedeemAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.performRedeemAction()) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func performRebondAction() { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("performRebondAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.performRebondAction()) + + } + + + + func performAnalyticsAction() { + + return cuckoo_manager.call("performAnalyticsAction()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performAnalyticsAction()) + + } + + + + func networkInfoViewDidChangeExpansion(isExpanded: Bool) { + + return cuckoo_manager.call("networkInfoViewDidChangeExpansion(isExpanded: Bool)", + parameters: (isExpanded), + escapingParameters: (isExpanded), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.networkInfoViewDidChangeExpansion(isExpanded: isExpanded)) + + } + + + + func performManageAction(_ action: StakingManageOption) { + + return cuckoo_manager.call("performManageAction(_: StakingManageOption)", + parameters: (action), + escapingParameters: (action), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performManageAction(action)) } - struct __StubbingProxy_ValidatorSearchWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingMainPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -36048,29 +35296,74 @@ import SoraFoundation } - func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoProtocol, ControllerBackedProtocol?)> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchWireframeProtocol.self, method: "present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func close(_ view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchWireframeProtocol.self, method: "close(_: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func performAssetSelection() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performAssetSelection()", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func performMainAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performMainAction()", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func performAccountAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performAccountAction()", parameterMatchers: matchers)) + } + + func performRewardInfoAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performRewardInfoAction()", parameterMatchers: matchers)) + } + + func performChangeValidatorsAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performChangeValidatorsAction()", parameterMatchers: matchers)) + } + + func performSetupValidatorsForBondedAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performSetupValidatorsForBondedAction()", parameterMatchers: matchers)) + } + + func performStakeMoreAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performStakeMoreAction()", parameterMatchers: matchers)) + } + + func performRedeemAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performRedeemAction()", parameterMatchers: matchers)) + } + + func performRebondAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performRebondAction()", parameterMatchers: matchers)) + } + + func performAnalyticsAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performAnalyticsAction()", parameterMatchers: matchers)) + } + + func networkInfoViewDidChangeExpansion(isExpanded: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "networkInfoViewDidChangeExpansion(isExpanded: Bool)", parameterMatchers: matchers)) + } + + func performManageAction(_ action: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingManageOption)> where M1.MatchedType == StakingManageOption { + let matchers: [Cuckoo.ParameterMatcher<(StakingManageOption)>] = [wrap(matchable: action) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performManageAction(_: StakingManageOption)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ValidatorSearchWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingMainPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -36085,33 +35378,87 @@ import SoraFoundation @discardableResult - func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.__DoNotUse<(ValidatorInfoProtocol, ControllerBackedProtocol?), Void> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, ControllerBackedProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("present(_: ValidatorInfoProtocol, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func close(_ view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(_: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func performAssetSelection() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performAssetSelection()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func performMainAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performMainAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func performAccountAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performAccountAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performRewardInfoAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performRewardInfoAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performChangeValidatorsAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performChangeValidatorsAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performSetupValidatorsForBondedAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performSetupValidatorsForBondedAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performStakeMoreAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performStakeMoreAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performRedeemAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performRedeemAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performRebondAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performRebondAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performAnalyticsAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performAnalyticsAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func networkInfoViewDidChangeExpansion(isExpanded: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] + return cuckoo_manager.verify("networkInfoViewDidChangeExpansion(isExpanded: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performManageAction(_ action: M1) -> Cuckoo.__DoNotUse<(StakingManageOption), Void> where M1.MatchedType == StakingManageOption { + let matchers: [Cuckoo.ParameterMatcher<(StakingManageOption)>] = [wrap(matchable: action) { $0 }] + return cuckoo_manager.verify("performManageAction(_: StakingManageOption)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ValidatorSearchWireframeProtocolStub: ValidatorSearchWireframeProtocol { + class StakingMainPresenterProtocolStub: StakingMainPresenterProtocol { @@ -36119,25 +35466,79 @@ import SoraFoundation - func present(_ validatorInfo: ValidatorInfoProtocol, from view: ControllerBackedProtocol?) { + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performAssetSelection() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performMainAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performAccountAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performRewardInfoAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performChangeValidatorsAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performSetupValidatorsForBondedAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performStakeMoreAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performRedeemAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func performRebondAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func close(_ view: ControllerBackedProtocol?) { + func performAnalyticsAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func networkInfoViewDidChangeExpansion(isExpanded: Bool) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func performManageAction(_ action: StakingManageOption) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -36145,19 +35546,19 @@ import SoraFoundation - class MockValidatorSearchDelegate: ValidatorSearchDelegate, Cuckoo.ProtocolMock { + class MockStakingMainInteractorInputProtocol: StakingMainInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorSearchDelegate + typealias MocksType = StakingMainInteractorInputProtocol - typealias Stubbing = __StubbingProxy_ValidatorSearchDelegate - typealias Verification = __VerificationProxy_ValidatorSearchDelegate + typealias Stubbing = __StubbingProxy_StakingMainInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingMainInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorSearchDelegate? + private var __defaultImplStub: StakingMainInteractorInputProtocol? - func enableDefaultImplementation(_ stub: ValidatorSearchDelegate) { + func enableDefaultImplementation(_ stub: StakingMainInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -36170,21 +35571,51 @@ import SoraFoundation - func validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo]) { + func setup() { - return cuckoo_manager.call("validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo])", - parameters: (selectedValidatorList), - escapingParameters: (selectedValidatorList), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.validatorSearchDidUpdate(selectedValidatorList: selectedValidatorList)) + defaultCall: __defaultImplStub!.setup()) + + } + + + + func saveNetworkInfoViewExpansion(isExpanded: Bool) { + + return cuckoo_manager.call("saveNetworkInfoViewExpansion(isExpanded: Bool)", + parameters: (isExpanded), + escapingParameters: (isExpanded), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.saveNetworkInfoViewExpansion(isExpanded: isExpanded)) + + } + + + + func save(chainAsset: ChainAsset) { + + return cuckoo_manager.call("save(chainAsset: ChainAsset)", + parameters: (chainAsset), + escapingParameters: (chainAsset), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.save(chainAsset: chainAsset)) } - struct __StubbingProxy_ValidatorSearchDelegate: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingMainInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -36192,14 +35623,24 @@ import SoraFoundation } - func validatorSearchDidUpdate(selectedValidatorList: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([SelectedValidatorInfo])> where M1.MatchedType == [SelectedValidatorInfo] { - let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo])>] = [wrap(matchable: selectedValidatorList) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchDelegate.self, method: "validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo])", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func saveNetworkInfoViewExpansion(isExpanded: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorInputProtocol.self, method: "saveNetworkInfoViewExpansion(isExpanded: Bool)", parameterMatchers: matchers)) + } + + func save(chainAsset: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainAsset)> where M1.MatchedType == ChainAsset { + let matchers: [Cuckoo.ParameterMatcher<(ChainAsset)>] = [wrap(matchable: chainAsset) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorInputProtocol.self, method: "save(chainAsset: ChainAsset)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ValidatorSearchDelegate: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingMainInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -36214,15 +35655,27 @@ import SoraFoundation @discardableResult - func validatorSearchDidUpdate(selectedValidatorList: M1) -> Cuckoo.__DoNotUse<([SelectedValidatorInfo]), Void> where M1.MatchedType == [SelectedValidatorInfo] { - let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo])>] = [wrap(matchable: selectedValidatorList) { $0 }] - return cuckoo_manager.verify("validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func saveNetworkInfoViewExpansion(isExpanded: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] + return cuckoo_manager.verify("saveNetworkInfoViewExpansion(isExpanded: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func save(chainAsset: M1) -> Cuckoo.__DoNotUse<(ChainAsset), Void> where M1.MatchedType == ChainAsset { + let matchers: [Cuckoo.ParameterMatcher<(ChainAsset)>] = [wrap(matchable: chainAsset) { $0 }] + return cuckoo_manager.verify("save(chainAsset: ChainAsset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ValidatorSearchDelegateStub: ValidatorSearchDelegate { + class StakingMainInteractorInputProtocolStub: StakingMainInteractorInputProtocol { @@ -36230,7 +35683,19 @@ import SoraFoundation - func validatorSearchDidUpdate(selectedValidatorList: [SelectedValidatorInfo]) { + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func saveNetworkInfoViewExpansion(isExpanded: Bool) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func save(chainAsset: ChainAsset) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -36238,158 +35703,106 @@ import SoraFoundation - class MockValidatorSearchViewProtocol: ValidatorSearchViewProtocol, Cuckoo.ProtocolMock { + class MockStakingMainInteractorOutputProtocol: StakingMainInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorSearchViewProtocol + typealias MocksType = StakingMainInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_ValidatorSearchViewProtocol - typealias Verification = __VerificationProxy_ValidatorSearchViewProtocol + typealias Stubbing = __StubbingProxy_StakingMainInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingMainInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorSearchViewProtocol? + private var __defaultImplStub: StakingMainInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: ValidatorSearchViewProtocol) { + func enableDefaultImplementation(_ stub: StakingMainInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } - - - - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - - } - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } - - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - - } - - func didReload(_ viewModel: ValidatorSearchViewModel) { + func didReceiveAccountInfo(_ accountInfo: AccountInfo?) { - return cuckoo_manager.call("didReload(_: ValidatorSearchViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didReceiveAccountInfo(_: AccountInfo?)", + parameters: (accountInfo), + escapingParameters: (accountInfo), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReload(viewModel)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(accountInfo)) } - func didStartSearch() { + func didReceiveSelectedAccount(_ metaAccount: MetaAccountModel) { - return cuckoo_manager.call("didStartSearch()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveSelectedAccount(_: MetaAccountModel)", + parameters: (metaAccount), + escapingParameters: (metaAccount), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartSearch()) + defaultCall: __defaultImplStub!.didReceiveSelectedAccount(metaAccount)) } - func didStopSearch() { + func didReceiveStakingSettings(_ stakingSettings: StakingAssetSettings) { - return cuckoo_manager.call("didStopSearch()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStakingSettings(_: StakingAssetSettings)", + parameters: (stakingSettings), + escapingParameters: (stakingSettings), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopSearch()) + defaultCall: __defaultImplStub!.didReceiveStakingSettings(stakingSettings)) } - func didReset() { + func didReceiveExpansion(_ isExpanded: Bool) { - return cuckoo_manager.call("didReset()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveExpansion(_: Bool)", + parameters: (isExpanded), + escapingParameters: (isExpanded), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReset()) + defaultCall: __defaultImplStub!.didReceiveExpansion(isExpanded)) } - public func applyLocalization() { + func didReceiveError(_ error: Error) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveError(_: Error)", + parameters: (error), + escapingParameters: (error), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.didReceiveError(error)) } - struct __StubbingProxy_ValidatorSearchViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingMainInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -36397,49 +35810,34 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") - } - - - func didReload(_ viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorSearchViewModel)> where M1.MatchedType == ValidatorSearchViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorSearchViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "didReload(_: ValidatorSearchViewModel)", parameterMatchers: matchers)) + func didReceiveAccountInfo(_ accountInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountInfo?)> where M1.OptionalMatchedType == AccountInfo { + let matchers: [Cuckoo.ParameterMatcher<(AccountInfo?)>] = [wrap(matchable: accountInfo) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveAccountInfo(_: AccountInfo?)", parameterMatchers: matchers)) } - func didStartSearch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "didStartSearch()", parameterMatchers: matchers)) + func didReceiveSelectedAccount(_ metaAccount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaAccountModel)> where M1.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: metaAccount) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveSelectedAccount(_: MetaAccountModel)", parameterMatchers: matchers)) } - func didStopSearch() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "didStopSearch()", parameterMatchers: matchers)) + func didReceiveStakingSettings(_ stakingSettings: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingAssetSettings)> where M1.MatchedType == StakingAssetSettings { + let matchers: [Cuckoo.ParameterMatcher<(StakingAssetSettings)>] = [wrap(matchable: stakingSettings) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveStakingSettings(_: StakingAssetSettings)", parameterMatchers: matchers)) } - func didReset() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "didReset()", parameterMatchers: matchers)) + func didReceiveExpansion(_ isExpanded: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveExpansion(_: Bool)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func didReceiveError(_ error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveError(_: Error)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ValidatorSearchViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingMainInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -36451,86 +35849,42 @@ import SoraFoundation } - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReload(_ viewModel: M1) -> Cuckoo.__DoNotUse<(ValidatorSearchViewModel), Void> where M1.MatchedType == ValidatorSearchViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorSearchViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReload(_: ValidatorSearchViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(_ accountInfo: M1) -> Cuckoo.__DoNotUse<(AccountInfo?), Void> where M1.OptionalMatchedType == AccountInfo { + let matchers: [Cuckoo.ParameterMatcher<(AccountInfo?)>] = [wrap(matchable: accountInfo) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(_: AccountInfo?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartSearch() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartSearch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveSelectedAccount(_ metaAccount: M1) -> Cuckoo.__DoNotUse<(MetaAccountModel), Void> where M1.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: metaAccount) { $0 }] + return cuckoo_manager.verify("didReceiveSelectedAccount(_: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopSearch() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopSearch()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStakingSettings(_ stakingSettings: M1) -> Cuckoo.__DoNotUse<(StakingAssetSettings), Void> where M1.MatchedType == StakingAssetSettings { + let matchers: [Cuckoo.ParameterMatcher<(StakingAssetSettings)>] = [wrap(matchable: stakingSettings) { $0 }] + return cuckoo_manager.verify("didReceiveStakingSettings(_: StakingAssetSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReset() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didReset()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveExpansion(_ isExpanded: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] + return cuckoo_manager.verify("didReceiveExpansion(_: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveError(_ error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return cuckoo_manager.verify("didReceiveError(_: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ValidatorSearchViewProtocolStub: ValidatorSearchViewProtocol { - - - - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - - - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - - } + class StakingMainInteractorOutputProtocolStub: StakingMainInteractorOutputProtocol { @@ -36538,31 +35892,31 @@ import SoraFoundation - func didReload(_ viewModel: ValidatorSearchViewModel) { + func didReceiveAccountInfo(_ accountInfo: AccountInfo?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartSearch() { + func didReceiveSelectedAccount(_ metaAccount: MetaAccountModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStopSearch() { + func didReceiveStakingSettings(_ stakingSettings: StakingAssetSettings) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReset() { + func didReceiveExpansion(_ isExpanded: Bool) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func didReceiveError(_ error: Error) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -36570,19 +35924,19 @@ import SoraFoundation - class MockValidatorSearchInteractorInputProtocol: ValidatorSearchInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockStakingMainWireframeProtocol: StakingMainWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorSearchInteractorInputProtocol + typealias MocksType = StakingMainWireframeProtocol - typealias Stubbing = __StubbingProxy_ValidatorSearchInteractorInputProtocol - typealias Verification = __VerificationProxy_ValidatorSearchInteractorInputProtocol + typealias Stubbing = __StubbingProxy_StakingMainWireframeProtocol + typealias Verification = __VerificationProxy_StakingMainWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorSearchInteractorInputProtocol? + private var __defaultImplStub: StakingMainWireframeProtocol? - func enableDefaultImplementation(_ stub: ValidatorSearchInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: StakingMainWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -36595,114 +35949,66 @@ import SoraFoundation - func performValidatorSearch(accountId: AccountId) { + func showChainAssetSelection(from view: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate) { - return cuckoo_manager.call("performValidatorSearch(accountId: AccountId)", - parameters: (accountId), - escapingParameters: (accountId), + return cuckoo_manager.call("showChainAssetSelection(from: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate)", + parameters: (view, selectedChainAssetId, delegate), + escapingParameters: (view, selectedChainAssetId, delegate), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performValidatorSearch(accountId: accountId)) + defaultCall: __defaultImplStub!.showChainAssetSelection(from: view, selectedChainAssetId: selectedChainAssetId, delegate: delegate)) } - - struct __StubbingProxy_ValidatorSearchInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func performValidatorSearch(accountId: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountId)> where M1.MatchedType == AccountId { - let matchers: [Cuckoo.ParameterMatcher<(AccountId)>] = [wrap(matchable: accountId) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchInteractorInputProtocol.self, method: "performValidatorSearch(accountId: AccountId)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ValidatorSearchInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func performValidatorSearch(accountId: M1) -> Cuckoo.__DoNotUse<(AccountId), Void> where M1.MatchedType == AccountId { - let matchers: [Cuckoo.ParameterMatcher<(AccountId)>] = [wrap(matchable: accountId) { $0 }] - return cuckoo_manager.verify("performValidatorSearch(accountId: AccountId)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ValidatorSearchInteractorInputProtocolStub: ValidatorSearchInteractorInputProtocol { - - - - - - func performValidatorSearch(accountId: AccountId) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { + + return cuckoo_manager.call("showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", + parameters: (view, wallet), + escapingParameters: (view, wallet), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showWalletDetails(from: view, wallet: wallet)) + } -} - - - - class MockValidatorSearchInteractorOutputProtocol: ValidatorSearchInteractorOutputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = ValidatorSearchInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_ValidatorSearchInteractorOutputProtocol - typealias Verification = __VerificationProxy_ValidatorSearchInteractorOutputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ValidatorSearchInteractorOutputProtocol? - - func enableDefaultImplementation(_ stub: ValidatorSearchInteractorOutputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + } - - - - - - - func didReceiveValidatorInfo(result: Result) { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didReceiveValidatorInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveValidatorInfo(result: result)) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_ValidatorSearchInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingMainWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -36710,14 +36016,29 @@ import SoraFoundation } - func didReceiveValidatorInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchInteractorOutputProtocol.self, method: "didReceiveValidatorInfo(result: Result)", parameterMatchers: matchers)) + func showChainAssetSelection(from view: M1, selectedChainAssetId: M2, delegate: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainViewProtocol?, ChainAssetId?, AssetSelectionDelegate)> where M1.OptionalMatchedType == StakingMainViewProtocol, M2.OptionalMatchedType == ChainAssetId, M3.MatchedType == AssetSelectionDelegate { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?, ChainAssetId?, AssetSelectionDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: selectedChainAssetId) { $0.1 }, wrap(matchable: delegate) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainWireframeProtocol.self, method: "showChainAssetSelection(from: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate)", parameterMatchers: matchers)) + } + + func showWalletDetails(from view: M1, wallet: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, MetaAccountModel)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaAccountModel)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: wallet) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainWireframeProtocol.self, method: "showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", parameterMatchers: matchers)) + } + + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ValidatorSearchInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingMainWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -36732,15 +36053,33 @@ import SoraFoundation @discardableResult - func didReceiveValidatorInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveValidatorInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showChainAssetSelection(from view: M1, selectedChainAssetId: M2, delegate: M3) -> Cuckoo.__DoNotUse<(StakingMainViewProtocol?, ChainAssetId?, AssetSelectionDelegate), Void> where M1.OptionalMatchedType == StakingMainViewProtocol, M2.OptionalMatchedType == ChainAssetId, M3.MatchedType == AssetSelectionDelegate { + let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?, ChainAssetId?, AssetSelectionDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: selectedChainAssetId) { $0.1 }, wrap(matchable: delegate) { $0.2 }] + return cuckoo_manager.verify("showChainAssetSelection(from: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showWalletDetails(from view: M1, wallet: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, MetaAccountModel), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaAccountModel)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: wallet) { $0.1 }] + return cuckoo_manager.verify("showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ValidatorSearchInteractorOutputProtocolStub: ValidatorSearchInteractorOutputProtocol { + class StakingMainWireframeProtocolStub: StakingMainWireframeProtocol { @@ -36748,7 +36087,25 @@ import SoraFoundation - func didReceiveValidatorInfo(result: Result) { + func showChainAssetSelection(from view: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -36756,145 +36113,181 @@ import SoraFoundation - class MockValidatorSearchPresenterProtocol: ValidatorSearchPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingMainChildPresenterProtocol: StakingMainChildPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = ValidatorSearchPresenterProtocol + typealias MocksType = StakingMainChildPresenterProtocol - typealias Stubbing = __StubbingProxy_ValidatorSearchPresenterProtocol - typealias Verification = __VerificationProxy_ValidatorSearchPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingMainChildPresenterProtocol + typealias Verification = __VerificationProxy_StakingMainChildPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: ValidatorSearchPresenterProtocol? + private var __defaultImplStub: StakingMainChildPresenterProtocol? - func enableDefaultImplementation(_ stub: ValidatorSearchPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingMainChildPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } + + + func setup() { - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) } - - + + func performMainAction() { + + return cuckoo_manager.call("performMainAction()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performMainAction()) + + } - func setup() { + func performRewardInfoAction() { - return cuckoo_manager.call("setup()", + return cuckoo_manager.call("performRewardInfoAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.performRewardInfoAction()) } - func changeValidatorSelection(at index: Int) { + func performChangeValidatorsAction() { - return cuckoo_manager.call("changeValidatorSelection(at: Int)", - parameters: (index), - escapingParameters: (index), + return cuckoo_manager.call("performChangeValidatorsAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.changeValidatorSelection(at: index)) + defaultCall: __defaultImplStub!.performChangeValidatorsAction()) } - func search(for textEntry: String) { + func performSetupValidatorsForBondedAction() { - return cuckoo_manager.call("search(for: String)", - parameters: (textEntry), - escapingParameters: (textEntry), + return cuckoo_manager.call("performSetupValidatorsForBondedAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.search(for: textEntry)) + defaultCall: __defaultImplStub!.performSetupValidatorsForBondedAction()) } - func didSelectValidator(at index: Int) { + func performStakeMoreAction() { - return cuckoo_manager.call("didSelectValidator(at: Int)", - parameters: (index), - escapingParameters: (index), + return cuckoo_manager.call("performStakeMoreAction()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSelectValidator(at: index)) + defaultCall: __defaultImplStub!.performStakeMoreAction()) } - func applyChanges() { + func performRedeemAction() { - return cuckoo_manager.call("applyChanges()", + return cuckoo_manager.call("performRedeemAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyChanges()) + defaultCall: __defaultImplStub!.performRedeemAction()) } - public func applyLocalization() { + func performRebondAction() { - return cuckoo_manager.call("applyLocalization()", + return cuckoo_manager.call("performRebondAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.performRebondAction()) + + } + + + + func performAnalyticsAction() { + + return cuckoo_manager.call("performAnalyticsAction()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performAnalyticsAction()) + + } + + + + func performManageAction(_ action: StakingManageOption) { + + return cuckoo_manager.call("performManageAction(_: StakingManageOption)", + parameters: (action), + escapingParameters: (action), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.performManageAction(action)) } - struct __StubbingProxy_ValidatorSearchPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingMainChildPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -36902,44 +36295,59 @@ import SoraFoundation } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } + func performMainAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performMainAction()", parameterMatchers: matchers)) + } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func performRewardInfoAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performRewardInfoAction()", parameterMatchers: matchers)) } - func changeValidatorSelection(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "changeValidatorSelection(at: Int)", parameterMatchers: matchers)) + func performChangeValidatorsAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performChangeValidatorsAction()", parameterMatchers: matchers)) } - func search(for textEntry: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: textEntry) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "search(for: String)", parameterMatchers: matchers)) + func performSetupValidatorsForBondedAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performSetupValidatorsForBondedAction()", parameterMatchers: matchers)) } - func didSelectValidator(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "didSelectValidator(at: Int)", parameterMatchers: matchers)) + func performStakeMoreAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performStakeMoreAction()", parameterMatchers: matchers)) } - func applyChanges() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func performRedeemAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "applyChanges()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performRedeemAction()", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func performRebondAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchPresenterProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performRebondAction()", parameterMatchers: matchers)) + } + + func performAnalyticsAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performAnalyticsAction()", parameterMatchers: matchers)) + } + + func performManageAction(_ action: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingManageOption)> where M1.MatchedType == StakingManageOption { + let matchers: [Cuckoo.ParameterMatcher<(StakingManageOption)>] = [wrap(matchable: action) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performManageAction(_: StakingManageOption)", parameterMatchers: matchers)) } } - struct __VerificationProxy_ValidatorSearchPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingMainChildPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -36951,11 +36359,6 @@ import SoraFoundation } - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult @@ -36965,50 +36368,63 @@ import SoraFoundation } @discardableResult - func changeValidatorSelection(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("changeValidatorSelection(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func performMainAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performMainAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func search(for textEntry: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: textEntry) { $0 }] - return cuckoo_manager.verify("search(for: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func performRewardInfoAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performRewardInfoAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didSelectValidator(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("didSelectValidator(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func performChangeValidatorsAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performChangeValidatorsAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyChanges() -> Cuckoo.__DoNotUse<(), Void> { + func performSetupValidatorsForBondedAction() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyChanges()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("performSetupValidatorsForBondedAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + func performStakeMoreAction() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("performStakeMoreAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performRedeemAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performRedeemAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performRebondAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performRebondAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performAnalyticsAction() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("performAnalyticsAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func performManageAction(_ action: M1) -> Cuckoo.__DoNotUse<(StakingManageOption), Void> where M1.MatchedType == StakingManageOption { + let matchers: [Cuckoo.ParameterMatcher<(StakingManageOption)>] = [wrap(matchable: action) { $0 }] + return cuckoo_manager.verify("performManageAction(_: StakingManageOption)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class ValidatorSearchPresenterProtocolStub: ValidatorSearchPresenterProtocol { - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - - } + class StakingMainChildPresenterProtocolStub: StakingMainChildPresenterProtocol { @@ -37022,125 +36438,56 @@ import SoraFoundation - func changeValidatorSelection(at index: Int) { + func performMainAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func search(for textEntry: String) { + func performRewardInfoAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didSelectValidator(at index: Int) { + func performChangeValidatorsAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func applyChanges() { + func performSetupValidatorsForBondedAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func performStakeMoreAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockValidatorSearchViewModelFactoryProtocol: ValidatorSearchViewModelFactoryProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = ValidatorSearchViewModelFactoryProtocol - typealias Stubbing = __StubbingProxy_ValidatorSearchViewModelFactoryProtocol - typealias Verification = __VerificationProxy_ValidatorSearchViewModelFactoryProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: ValidatorSearchViewModelFactoryProtocol? - - func enableDefaultImplementation(_ stub: ValidatorSearchViewModelFactoryProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func performRedeemAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - - - - - func createViewModel(from displayValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel { - - return cuckoo_manager.call("createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel", - parameters: (displayValidatorList, selectedValidatorList, locale), - escapingParameters: (displayValidatorList, selectedValidatorList, locale), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.createViewModel(from: displayValidatorList, selectedValidatorList: selectedValidatorList, locale: locale)) - + func performRebondAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - struct __StubbingProxy_ValidatorSearchViewModelFactoryProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func createViewModel(from displayValidatorList: M1, selectedValidatorList: M2, locale: M3) -> Cuckoo.ProtocolStubFunction<([SelectedValidatorInfo], [SelectedValidatorInfo], Locale), ValidatorSearchViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], [SelectedValidatorInfo], Locale)>] = [wrap(matchable: displayValidatorList) { $0.0 }, wrap(matchable: selectedValidatorList) { $0.1 }, wrap(matchable: locale) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockValidatorSearchViewModelFactoryProtocol.self, method: "createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_ValidatorSearchViewModelFactoryProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func createViewModel(from displayValidatorList: M1, selectedValidatorList: M2, locale: M3) -> Cuckoo.__DoNotUse<([SelectedValidatorInfo], [SelectedValidatorInfo], Locale), ValidatorSearchViewModel> where M1.MatchedType == [SelectedValidatorInfo], M2.MatchedType == [SelectedValidatorInfo], M3.MatchedType == Locale { - let matchers: [Cuckoo.ParameterMatcher<([SelectedValidatorInfo], [SelectedValidatorInfo], Locale)>] = [wrap(matchable: displayValidatorList) { $0.0 }, wrap(matchable: selectedValidatorList) { $0.1 }, wrap(matchable: locale) { $0.2 }] - return cuckoo_manager.verify("createViewModel(from: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class ValidatorSearchViewModelFactoryProtocolStub: ValidatorSearchViewModelFactoryProtocol { - - + func performAnalyticsAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func createViewModel(from displayValidatorList: [SelectedValidatorInfo], selectedValidatorList: [SelectedValidatorInfo], locale: Locale) -> ValidatorSearchViewModel { - return DefaultValueRegistry.defaultValue(for: (ValidatorSearchViewModel).self) + func performManageAction(_ action: StakingManageOption) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } } @@ -37152,19 +36499,19 @@ import Cuckoo import SoraFoundation - class MockYourValidatorListViewProtocol: YourValidatorListViewProtocol, Cuckoo.ProtocolMock { + class MockStakingPayoutConfirmationViewProtocol: StakingPayoutConfirmationViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = YourValidatorListViewProtocol + typealias MocksType = StakingPayoutConfirmationViewProtocol - typealias Stubbing = __StubbingProxy_YourValidatorListViewProtocol - typealias Verification = __VerificationProxy_YourValidatorListViewProtocol + typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationViewProtocol + typealias Verification = __VerificationProxy_StakingPayoutConfirmationViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: YourValidatorListViewProtocol? + private var __defaultImplStub: StakingPayoutConfirmationViewProtocol? - func enableDefaultImplementation(_ stub: YourValidatorListViewProtocol) { + func enableDefaultImplementation(_ stub: StakingPayoutConfirmationViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -37223,22 +36570,80 @@ import SoraFoundation } + + + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } + + } + - func reload(state: YourValidatorListViewState) { + func didRecieve(viewModel: LocalizableResource) { - return cuckoo_manager.call("reload(state: YourValidatorListViewState)", - parameters: (state), - escapingParameters: (state), + return cuckoo_manager.call("didRecieve(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload(state: state)) + defaultCall: __defaultImplStub!.didRecieve(viewModel: viewModel)) + + } + + + + func didRecieve(amountViewModel: LocalizableResource) { + + return cuckoo_manager.call("didRecieve(amountViewModel: LocalizableResource)", + parameters: (amountViewModel), + escapingParameters: (amountViewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didRecieve(amountViewModel: amountViewModel)) + + } + + + + func didReceive(feeViewModel: LocalizableResource?) { + + return cuckoo_manager.call("didReceive(feeViewModel: LocalizableResource?)", + parameters: (feeViewModel), + escapingParameters: (feeViewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(feeViewModel: feeViewModel)) } @@ -37253,12 +36658,42 @@ import SoraFoundation Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.applyLocalization()) + + } + + + + func didStartLoading() { + + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStartLoading()) + + } + + + + func didStopLoading() { + + return cuckoo_manager.call("didStopLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStopLoading()) } - struct __StubbingProxy_YourValidatorListViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingPayoutConfirmationViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -37266,34 +36701,64 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func reload(state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(YourValidatorListViewState)> where M1.MatchedType == YourValidatorListViewState { - let matchers: [Cuckoo.ParameterMatcher<(YourValidatorListViewState)>] = [wrap(matchable: state) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListViewProtocol.self, method: "reload(state: YourValidatorListViewState)", parameterMatchers: matchers)) + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + } + + + func didRecieve(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didRecieve(viewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func didRecieve(amountViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: amountViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didRecieve(amountViewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func didReceive(feeViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: feeViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didReceive(feeViewModel: LocalizableResource?)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + } + + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_YourValidatorListViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingPayoutConfirmationViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -37320,12 +36785,34 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func reload(state: M1) -> Cuckoo.__DoNotUse<(YourValidatorListViewState), Void> where M1.MatchedType == YourValidatorListViewState { - let matchers: [Cuckoo.ParameterMatcher<(YourValidatorListViewState)>] = [wrap(matchable: state) { $0 }] - return cuckoo_manager.verify("reload(state: YourValidatorListViewState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didRecieve(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didRecieve(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didRecieve(amountViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: amountViewModel) { $0 }] + return cuckoo_manager.verify("didRecieve(amountViewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(feeViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: feeViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(feeViewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -37334,10 +36821,22 @@ import SoraFoundation return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class YourValidatorListViewProtocolStub: YourValidatorListViewProtocol { + class StakingPayoutConfirmationViewProtocolStub: StakingPayoutConfirmationViewProtocol { @@ -37367,6 +36866,24 @@ import SoraFoundation set { } } + + + + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } @@ -37374,7 +36891,19 @@ import SoraFoundation - func reload(state: YourValidatorListViewState) { + func didRecieve(viewModel: LocalizableResource) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didRecieve(amountViewModel: LocalizableResource) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceive(feeViewModel: LocalizableResource?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -37384,23 +36913,35 @@ import SoraFoundation return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func didStartLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStopLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } - class MockYourValidatorListPresenterProtocol: YourValidatorListPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingPayoutConfirmationPresenterProtocol: StakingPayoutConfirmationPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = YourValidatorListPresenterProtocol + typealias MocksType = StakingPayoutConfirmationPresenterProtocol - typealias Stubbing = __StubbingProxy_YourValidatorListPresenterProtocol - typealias Verification = __VerificationProxy_YourValidatorListPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationPresenterProtocol + typealias Verification = __VerificationProxy_StakingPayoutConfirmationPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: YourValidatorListPresenterProtocol? + private var __defaultImplStub: StakingPayoutConfirmationPresenterProtocol? - func enableDefaultImplementation(_ stub: YourValidatorListPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingPayoutConfirmationPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -37428,51 +36969,36 @@ import SoraFoundation - func retry() { + func proceed() { - return cuckoo_manager.call("retry()", + return cuckoo_manager.call("proceed()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.retry()) - - } - - - - func didSelectValidator(viewModel: YourValidatorViewModel) { - - return cuckoo_manager.call("didSelectValidator(viewModel: YourValidatorViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didSelectValidator(viewModel: viewModel)) + defaultCall: __defaultImplStub!.proceed()) } - func changeValidators() { + func presentAccountOptions() { - return cuckoo_manager.call("changeValidators()", + return cuckoo_manager.call("presentAccountOptions()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.changeValidators()) + defaultCall: __defaultImplStub!.presentAccountOptions()) } - struct __StubbingProxy_YourValidatorListPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingPayoutConfirmationPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -37482,27 +37008,22 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func retry() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListPresenterProtocol.self, method: "retry()", parameterMatchers: matchers)) - } - - func didSelectValidator(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(YourValidatorViewModel)> where M1.MatchedType == YourValidatorViewModel { - let matchers: [Cuckoo.ParameterMatcher<(YourValidatorViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListPresenterProtocol.self, method: "didSelectValidator(viewModel: YourValidatorViewModel)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } - func changeValidators() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func presentAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListPresenterProtocol.self, method: "changeValidators()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationPresenterProtocol.self, method: "presentAccountOptions()", parameterMatchers: matchers)) } } - struct __VerificationProxy_YourValidatorListPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingPayoutConfirmationPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -37523,27 +37044,21 @@ import SoraFoundation } @discardableResult - func retry() -> Cuckoo.__DoNotUse<(), Void> { + func proceed() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("retry()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didSelectValidator(viewModel: M1) -> Cuckoo.__DoNotUse<(YourValidatorViewModel), Void> where M1.MatchedType == YourValidatorViewModel { - let matchers: [Cuckoo.ParameterMatcher<(YourValidatorViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didSelectValidator(viewModel: YourValidatorViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func changeValidators() -> Cuckoo.__DoNotUse<(), Void> { + func presentAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("changeValidators()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("presentAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class YourValidatorListPresenterProtocolStub: YourValidatorListPresenterProtocol { + class StakingPayoutConfirmationPresenterProtocolStub: StakingPayoutConfirmationPresenterProtocol { @@ -37557,19 +37072,13 @@ import SoraFoundation - func retry() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didSelectValidator(viewModel: YourValidatorViewModel) { + func proceed() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func changeValidators() { + func presentAccountOptions() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -37577,19 +37086,19 @@ import SoraFoundation - class MockYourValidatorListInteractorInputProtocol: YourValidatorListInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockStakingPayoutConfirmationInteractorInputProtocol: StakingPayoutConfirmationInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = YourValidatorListInteractorInputProtocol + typealias MocksType = StakingPayoutConfirmationInteractorInputProtocol - typealias Stubbing = __StubbingProxy_YourValidatorListInteractorInputProtocol - typealias Verification = __VerificationProxy_YourValidatorListInteractorInputProtocol + typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingPayoutConfirmationInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: YourValidatorListInteractorInputProtocol? + private var __defaultImplStub: StakingPayoutConfirmationInteractorInputProtocol? - func enableDefaultImplementation(_ stub: YourValidatorListInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: StakingPayoutConfirmationInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -37617,21 +37126,36 @@ import SoraFoundation - func refresh() { + func submitPayout() { - return cuckoo_manager.call("refresh()", + return cuckoo_manager.call("submitPayout()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.refresh()) + defaultCall: __defaultImplStub!.submitPayout()) + + } + + + + func estimateFee() { + + return cuckoo_manager.call("estimateFee()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.estimateFee()) } - struct __StubbingProxy_YourValidatorListInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingPayoutConfirmationInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -37641,17 +37165,22 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func refresh() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func submitPayout() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorInputProtocol.self, method: "refresh()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorInputProtocol.self, method: "submitPayout()", parameterMatchers: matchers)) + } + + func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) } } - struct __VerificationProxy_YourValidatorListInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingPayoutConfirmationInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -37672,15 +37201,21 @@ import SoraFoundation } @discardableResult - func refresh() -> Cuckoo.__DoNotUse<(), Void> { + func submitPayout() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("refresh()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("submitPayout()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class YourValidatorListInteractorInputProtocolStub: YourValidatorListInteractorInputProtocol { + class StakingPayoutConfirmationInteractorInputProtocolStub: StakingPayoutConfirmationInteractorInputProtocol { @@ -37694,7 +37229,13 @@ import SoraFoundation - func refresh() { + func submitPayout() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func estimateFee() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -37702,19 +37243,19 @@ import SoraFoundation - class MockYourValidatorListInteractorOutputProtocol: YourValidatorListInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingPayoutConfirmationInteractorOutputProtocol: StakingPayoutConfirmationInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = YourValidatorListInteractorOutputProtocol + typealias MocksType = StakingPayoutConfirmationInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_YourValidatorListInteractorOutputProtocol - typealias Verification = __VerificationProxy_YourValidatorListInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingPayoutConfirmationInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: YourValidatorListInteractorOutputProtocol? + private var __defaultImplStub: StakingPayoutConfirmationInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: YourValidatorListInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingPayoutConfirmationInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -37727,81 +37268,111 @@ import SoraFoundation - func didReceiveValidators(result: Result) { + func didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal) { - return cuckoo_manager.call("didReceiveValidators(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal)", + parameters: (account, rewardAmount), + escapingParameters: (account, rewardAmount), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveValidators(result: result)) + defaultCall: __defaultImplStub!.didRecieve(account: account, rewardAmount: rewardAmount)) } - func didReceiveController(result: Result) { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("didReceiveController(result: Result)", + return cuckoo_manager.call("didReceivePriceData(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveController(result: result)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - func didReceiveStashItem(result: Result) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("didReceiveStashItem(result: Result)", + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - func didReceiveLedger(result: Result) { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("didReceiveLedger(result: Result)", + return cuckoo_manager.call("didReceiveFee(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveLedger(result: result)) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - func didReceiveRewardDestination(result: Result) { + func didStartPayout() { - return cuckoo_manager.call("didReceiveRewardDestination(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didStartPayout()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveRewardDestination(result: result)) + defaultCall: __defaultImplStub!.didStartPayout()) + + } + + + + func didCompletePayout(txHashes: [String]) { + + return cuckoo_manager.call("didCompletePayout(txHashes: [String])", + parameters: (txHashes), + escapingParameters: (txHashes), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didCompletePayout(txHashes: txHashes)) + + } + + + + func didFailPayout(error: Error) { + + return cuckoo_manager.call("didFailPayout(error: Error)", + parameters: (error), + escapingParameters: (error), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didFailPayout(error: error)) } - struct __StubbingProxy_YourValidatorListInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingPayoutConfirmationInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -37809,34 +37380,44 @@ import SoraFoundation } - func didReceiveValidators(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveValidators(result: Result)", parameterMatchers: matchers)) + func didRecieve(account: M1, rewardAmount: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaChainAccountResponse, Decimal)> where M1.MatchedType == MetaChainAccountResponse, M2.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(MetaChainAccountResponse, Decimal)>] = [wrap(matchable: account) { $0.0 }, wrap(matchable: rewardAmount) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal)", parameterMatchers: matchers)) } - func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func didReceiveLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveLedger(result: Result)", parameterMatchers: matchers)) + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func didReceiveRewardDestination(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListInteractorOutputProtocol.self, method: "didReceiveRewardDestination(result: Result)", parameterMatchers: matchers)) + func didStartPayout() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didStartPayout()", parameterMatchers: matchers)) + } + + func didCompletePayout(txHashes: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([String])> where M1.MatchedType == [String] { + let matchers: [Cuckoo.ParameterMatcher<([String])>] = [wrap(matchable: txHashes) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didCompletePayout(txHashes: [String])", parameterMatchers: matchers)) + } + + func didFailPayout(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didFailPayout(error: Error)", parameterMatchers: matchers)) } } - struct __VerificationProxy_YourValidatorListInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingPayoutConfirmationInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -37851,39 +37432,51 @@ import SoraFoundation @discardableResult - func didReceiveValidators(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveValidators(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didRecieve(account: M1, rewardAmount: M2) -> Cuckoo.__DoNotUse<(MetaChainAccountResponse, Decimal), Void> where M1.MatchedType == MetaChainAccountResponse, M2.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(MetaChainAccountResponse, Decimal)>] = [wrap(matchable: account) { $0.0 }, wrap(matchable: rewardAmount) { $0.1 }] + return cuckoo_manager.verify("didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveRewardDestination(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveRewardDestination(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStartPayout() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartPayout()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didCompletePayout(txHashes: M1) -> Cuckoo.__DoNotUse<([String]), Void> where M1.MatchedType == [String] { + let matchers: [Cuckoo.ParameterMatcher<([String])>] = [wrap(matchable: txHashes) { $0 }] + return cuckoo_manager.verify("didCompletePayout(txHashes: [String])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didFailPayout(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return cuckoo_manager.verify("didFailPayout(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class YourValidatorListInteractorOutputProtocolStub: YourValidatorListInteractorOutputProtocol { + class StakingPayoutConfirmationInteractorOutputProtocolStub: StakingPayoutConfirmationInteractorOutputProtocol { @@ -37891,88 +37484,85 @@ import SoraFoundation - func didReceiveValidators(result: Result) { + func didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveController(result: Result) { + func didReceivePriceData(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStashItem(result: Result) { + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveLedger(result: Result) { + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveRewardDestination(result: Result) { + func didStartPayout() { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockYourValidatorListWireframeProtocol: YourValidatorListWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = YourValidatorListWireframeProtocol - typealias Stubbing = __StubbingProxy_YourValidatorListWireframeProtocol - typealias Verification = __VerificationProxy_YourValidatorListWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - + func didCompletePayout(txHashes: [String]) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - private var __defaultImplStub: YourValidatorListWireframeProtocol? - - func enableDefaultImplementation(_ stub: YourValidatorListWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + + + func didFailPayout(error: Error) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} - - + class MockStakingPayoutConfirmationWireframeProtocol: StakingPayoutConfirmationWireframeProtocol, Cuckoo.ProtocolMock { + typealias MocksType = StakingPayoutConfirmationWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationWireframeProtocol + typealias Verification = __VerificationProxy_StakingPayoutConfirmationWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func present(_ validatorInfo: ValidatorInfoProtocol, from view: YourValidatorListViewProtocol?) { - - return cuckoo_manager.call("present(_: ValidatorInfoProtocol, from: YourValidatorListViewProtocol?)", - parameters: (validatorInfo, view), - escapingParameters: (validatorInfo, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(validatorInfo, from: view)) - + private var __defaultImplStub: StakingPayoutConfirmationWireframeProtocol? + + func enableDefaultImplementation(_ stub: StakingPayoutConfirmationWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func proceedToSelectValidatorsStart(from view: YourValidatorListViewProtocol?, existingBonding: ExistingBonding) { + + + + + func complete(from view: StakingPayoutConfirmationViewProtocol?) { - return cuckoo_manager.call("proceedToSelectValidatorsStart(from: YourValidatorListViewProtocol?, existingBonding: ExistingBonding)", - parameters: (view, existingBonding), - escapingParameters: (view, existingBonding), + return cuckoo_manager.call("complete(from: StakingPayoutConfirmationViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceedToSelectValidatorsStart(from: view, existingBonding: existingBonding)) + defaultCall: __defaultImplStub!.complete(from: view)) } @@ -38007,7 +37597,7 @@ import SoraFoundation } - struct __StubbingProxy_YourValidatorListWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingPayoutConfirmationWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -38015,29 +37605,24 @@ import SoraFoundation } - func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorInfoProtocol, YourValidatorListViewProtocol?)> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == YourValidatorListViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, YourValidatorListViewProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListWireframeProtocol.self, method: "present(_: ValidatorInfoProtocol, from: YourValidatorListViewProtocol?)", parameterMatchers: matchers)) - } - - func proceedToSelectValidatorsStart(from view: M1, existingBonding: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(YourValidatorListViewProtocol?, ExistingBonding)> where M1.OptionalMatchedType == YourValidatorListViewProtocol, M2.MatchedType == ExistingBonding { - let matchers: [Cuckoo.ParameterMatcher<(YourValidatorListViewProtocol?, ExistingBonding)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: existingBonding) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListWireframeProtocol.self, method: "proceedToSelectValidatorsStart(from: YourValidatorListViewProtocol?, existingBonding: ExistingBonding)", parameterMatchers: matchers)) + func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingPayoutConfirmationViewProtocol?)> where M1.OptionalMatchedType == StakingPayoutConfirmationViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingPayoutConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationWireframeProtocol.self, method: "complete(from: StakingPayoutConfirmationViewProtocol?)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockYourValidatorListWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_YourValidatorListWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingPayoutConfirmationWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -38052,15 +37637,9 @@ import SoraFoundation @discardableResult - func present(_ validatorInfo: M1, from view: M2) -> Cuckoo.__DoNotUse<(ValidatorInfoProtocol, YourValidatorListViewProtocol?), Void> where M1.MatchedType == ValidatorInfoProtocol, M2.OptionalMatchedType == YourValidatorListViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorInfoProtocol, YourValidatorListViewProtocol?)>] = [wrap(matchable: validatorInfo) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("present(_: ValidatorInfoProtocol, from: YourValidatorListViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func proceedToSelectValidatorsStart(from view: M1, existingBonding: M2) -> Cuckoo.__DoNotUse<(YourValidatorListViewProtocol?, ExistingBonding), Void> where M1.OptionalMatchedType == YourValidatorListViewProtocol, M2.MatchedType == ExistingBonding { - let matchers: [Cuckoo.ParameterMatcher<(YourValidatorListViewProtocol?, ExistingBonding)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: existingBonding) { $0.1 }] - return cuckoo_manager.verify("proceedToSelectValidatorsStart(from: YourValidatorListViewProtocol?, existingBonding: ExistingBonding)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingPayoutConfirmationViewProtocol?), Void> where M1.OptionalMatchedType == StakingPayoutConfirmationViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingPayoutConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(from: StakingPayoutConfirmationViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -38078,7 +37657,7 @@ import SoraFoundation } } - class YourValidatorListWireframeProtocolStub: YourValidatorListWireframeProtocol { + class StakingPayoutConfirmationWireframeProtocolStub: StakingPayoutConfirmationWireframeProtocol { @@ -38086,13 +37665,7 @@ import SoraFoundation - func present(_ validatorInfo: ValidatorInfoProtocol, from view: YourValidatorListViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func proceedToSelectValidatorsStart(from view: YourValidatorListViewProtocol?, existingBonding: ExistingBonding) { + func complete(from view: StakingPayoutConfirmationViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -38115,23 +37688,23 @@ import Cuckoo @testable import novawallet import BigInt -import CommonWallet +import Foundation import SoraFoundation - class MockStakingBondMoreViewProtocol: StakingBondMoreViewProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondConfirmationViewProtocol: StakingRebondConfirmationViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreViewProtocol + typealias MocksType = StakingRebondConfirmationViewProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreViewProtocol - typealias Verification = __VerificationProxy_StakingBondMoreViewProtocol + typealias Stubbing = __StubbingProxy_StakingRebondConfirmationViewProtocol + typealias Verification = __VerificationProxy_StakingRebondConfirmationViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreViewProtocol? + private var __defaultImplStub: StakingRebondConfirmationViewProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreViewProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondConfirmationViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -38190,37 +37763,65 @@ import SoraFoundation } + + + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } + + } + - func didReceiveInput(viewModel: LocalizableResource) { + func didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel) { - return cuckoo_manager.call("didReceiveInput(viewModel: LocalizableResource)", + return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) } - func didReceiveAsset(viewModel: LocalizableResource) { + func didReceiveAmount(viewModel: LocalizableResource) { - return cuckoo_manager.call("didReceiveAsset(viewModel: LocalizableResource)", + return cuckoo_manager.call("didReceiveAmount(viewModel: LocalizableResource)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveAmount(viewModel: viewModel)) } @@ -38254,8 +37855,38 @@ import SoraFoundation } + + + func didStartLoading() { + + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStartLoading()) + + } + + + + func didStopLoading() { + + return cuckoo_manager.call("didStopLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStopLoading()) + + } + - struct __StubbingProxy_StakingBondMoreViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondConfirmationViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -38263,44 +37894,64 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreViewProtocol.self, method: "didReceiveInput(viewModel: LocalizableResource)", parameterMatchers: matchers)) + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") } - func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreViewProtocol.self, method: "didReceiveAsset(viewModel: LocalizableResource)", parameterMatchers: matchers)) + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + } + + + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRebondConfirmationViewModel)> where M1.MatchedType == StakingRebondConfirmationViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingRebondConfirmationViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel)", parameterMatchers: matchers)) + } + + func didReceiveAmount(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didReceiveAmount(viewModel: LocalizableResource)", parameterMatchers: matchers)) } func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + } + + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondConfirmationViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -38327,18 +37978,28 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveInput(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingRebondConfirmationViewModel), Void> where M1.MatchedType == StakingRebondConfirmationViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingRebondConfirmationViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAsset(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAmount(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAmount(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -38353,10 +38014,22 @@ import SoraFoundation return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class StakingBondMoreViewProtocolStub: StakingBondMoreViewProtocol { + class StakingRebondConfirmationViewProtocolStub: StakingRebondConfirmationViewProtocol { @@ -38386,6 +38059,24 @@ import SoraFoundation set { } } + + + + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } @@ -38393,13 +38084,13 @@ import SoraFoundation - func didReceiveInput(viewModel: LocalizableResource) { + func didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveAsset(viewModel: LocalizableResource) { + func didReceiveAmount(viewModel: LocalizableResource) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -38415,23 +38106,35 @@ import SoraFoundation return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func didStartLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStopLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } - class MockStakingBondMorePresenterProtocol: StakingBondMorePresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondConfirmationPresenterProtocol: StakingRebondConfirmationPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMorePresenterProtocol + typealias MocksType = StakingRebondConfirmationPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingBondMorePresenterProtocol - typealias Verification = __VerificationProxy_StakingBondMorePresenterProtocol + typealias Stubbing = __StubbingProxy_StakingRebondConfirmationPresenterProtocol + typealias Verification = __VerificationProxy_StakingRebondConfirmationPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMorePresenterProtocol? + private var __defaultImplStub: StakingRebondConfirmationPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingBondMorePresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondConfirmationPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -38459,51 +38162,36 @@ import SoraFoundation - func handleContinueAction() { + func confirm() { - return cuckoo_manager.call("handleContinueAction()", + return cuckoo_manager.call("confirm()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handleContinueAction()) - - } - - - - func updateAmount(_ newValue: Decimal) { - - return cuckoo_manager.call("updateAmount(_: Decimal)", - parameters: (newValue), - escapingParameters: (newValue), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.updateAmount(newValue)) + defaultCall: __defaultImplStub!.confirm()) } - func selectAmountPercentage(_ percentage: Float) { + func selectAccount() { - return cuckoo_manager.call("selectAmountPercentage(_: Float)", - parameters: (percentage), - escapingParameters: (percentage), + return cuckoo_manager.call("selectAccount()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectAmountPercentage(percentage)) + defaultCall: __defaultImplStub!.selectAccount()) } - struct __StubbingProxy_StakingBondMorePresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondConfirmationPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -38513,27 +38201,22 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMorePresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func handleContinueAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMorePresenterProtocol.self, method: "handleContinueAction()", parameterMatchers: matchers)) - } - - func updateAmount(_ newValue: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMorePresenterProtocol.self, method: "updateAmount(_: Decimal)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) } - func selectAmountPercentage(_ percentage: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Float)> where M1.MatchedType == Float { - let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMorePresenterProtocol.self, method: "selectAmountPercentage(_: Float)", parameterMatchers: matchers)) + func selectAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationPresenterProtocol.self, method: "selectAccount()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMorePresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondConfirmationPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -38554,27 +38237,21 @@ import SoraFoundation } @discardableResult - func handleContinueAction() -> Cuckoo.__DoNotUse<(), Void> { + func confirm() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleContinueAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func updateAmount(_ newValue: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] - return cuckoo_manager.verify("updateAmount(_: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectAmountPercentage(_ percentage: M1) -> Cuckoo.__DoNotUse<(Float), Void> where M1.MatchedType == Float { - let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] - return cuckoo_manager.verify("selectAmountPercentage(_: Float)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectAccount() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingBondMorePresenterProtocolStub: StakingBondMorePresenterProtocol { + class StakingRebondConfirmationPresenterProtocolStub: StakingRebondConfirmationPresenterProtocol { @@ -38588,19 +38265,13 @@ import SoraFoundation - func handleContinueAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func updateAmount(_ newValue: Decimal) { + func confirm() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectAmountPercentage(_ percentage: Float) { + func selectAccount() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -38608,19 +38279,19 @@ import SoraFoundation - class MockStakingBondMoreInteractorInputProtocol: StakingBondMoreInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondConfirmationInteractorInputProtocol: StakingRebondConfirmationInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreInteractorInputProtocol + typealias MocksType = StakingRebondConfirmationInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingBondMoreInteractorInputProtocol + typealias Stubbing = __StubbingProxy_StakingRebondConfirmationInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingRebondConfirmationInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreInteractorInputProtocol? + private var __defaultImplStub: StakingRebondConfirmationInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondConfirmationInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -38648,21 +38319,36 @@ import SoraFoundation - func estimateFee() { + func submit(for amount: Decimal) { - return cuckoo_manager.call("estimateFee()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("submit(for: Decimal)", + parameters: (amount), + escapingParameters: (amount), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee()) + defaultCall: __defaultImplStub!.submit(for: amount)) + + } + + + + func estimateFee(for amount: Decimal) { + + return cuckoo_manager.call("estimateFee(for: Decimal)", + parameters: (amount), + escapingParameters: (amount), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.estimateFee(for: amount)) } - struct __StubbingProxy_StakingBondMoreInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondConfirmationInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -38672,17 +38358,22 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) + func submit(for amount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorInputProtocol.self, method: "submit(for: Decimal)", parameterMatchers: matchers)) + } + + func estimateFee(for amount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorInputProtocol.self, method: "estimateFee(for: Decimal)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondConfirmationInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -38703,15 +38394,21 @@ import SoraFoundation } @discardableResult - func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func submit(for amount: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] + return cuckoo_manager.verify("submit(for: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func estimateFee(for amount: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] + return cuckoo_manager.verify("estimateFee(for: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingBondMoreInteractorInputProtocolStub: StakingBondMoreInteractorInputProtocol { + class StakingRebondConfirmationInteractorInputProtocolStub: StakingRebondConfirmationInteractorInputProtocol { @@ -38725,7 +38422,13 @@ import SoraFoundation - func estimateFee() { + func submit(for amount: Decimal) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func estimateFee(for amount: Decimal) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -38733,19 +38436,19 @@ import SoraFoundation - class MockStakingBondMoreInteractorOutputProtocol: StakingBondMoreInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondConfirmationInteractorOutputProtocol: StakingRebondConfirmationInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreInteractorOutputProtocol + typealias MocksType = StakingRebondConfirmationInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingBondMoreInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_StakingRebondConfirmationInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingRebondConfirmationInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreInteractorOutputProtocol? + private var __defaultImplStub: StakingRebondConfirmationInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondConfirmationInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -38758,6 +38461,21 @@ import SoraFoundation + func didReceiveStakingLedger(result: Result) { + + return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) + + } + + + func didReceiveAccountInfo(result: Result) { return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", @@ -38803,16 +38521,16 @@ import SoraFoundation - func didReceiveStash(result: Result) { + func didReceiveController(result: Result) { - return cuckoo_manager.call("didReceiveStash(result: Result)", + return cuckoo_manager.call("didReceiveController(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStash(result: result)) + defaultCall: __defaultImplStub!.didReceiveController(result: result)) } @@ -38831,8 +38549,23 @@ import SoraFoundation } + + + func didSubmitRebonding(result: Result) { + + return cuckoo_manager.call("didSubmitRebonding(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didSubmitRebonding(result: result)) + + } + - struct __StubbingProxy_StakingBondMoreInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondConfirmationInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -38840,34 +38573,44 @@ import SoraFoundation } + func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) + } + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func didReceiveStash(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceiveStash(result: Result)", parameterMatchers: matchers)) + func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) } func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + } + + func didSubmitRebonding(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didSubmitRebonding(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondConfirmationInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -38877,9 +38620,15 @@ import SoraFoundation self.callMatcher = callMatcher self.sourceLocation = sourceLocation } - - - + + + + + @discardableResult + func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } @discardableResult func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { @@ -38900,9 +38649,9 @@ import SoraFoundation } @discardableResult - func didReceiveStash(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStash(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -38911,10 +38660,16 @@ import SoraFoundation return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didSubmitRebonding(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didSubmitRebonding(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class StakingBondMoreInteractorOutputProtocolStub: StakingBondMoreInteractorOutputProtocol { + class StakingRebondConfirmationInteractorOutputProtocolStub: StakingRebondConfirmationInteractorOutputProtocol { @@ -38922,6 +38677,12 @@ import SoraFoundation + func didReceiveStakingLedger(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -38940,7 +38701,7 @@ import SoraFoundation - func didReceiveStash(result: Result) { + func didReceiveController(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -38950,23 +38711,29 @@ import SoraFoundation return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func didSubmitRebonding(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } - class MockStakingBondMoreWireframeProtocol: StakingBondMoreWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondConfirmationWireframeProtocol: StakingRebondConfirmationWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreWireframeProtocol + typealias MocksType = StakingRebondConfirmationWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreWireframeProtocol - typealias Verification = __VerificationProxy_StakingBondMoreWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingRebondConfirmationWireframeProtocol + typealias Verification = __VerificationProxy_StakingRebondConfirmationWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreWireframeProtocol? + private var __defaultImplStub: StakingRebondConfirmationWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondConfirmationWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -38979,31 +38746,16 @@ import SoraFoundation - func showConfirmation(from view: ControllerBackedProtocol?, amount: Decimal) { - - return cuckoo_manager.call("showConfirmation(from: ControllerBackedProtocol?, amount: Decimal)", - parameters: (view, amount), - escapingParameters: (view, amount), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showConfirmation(from: view, amount: amount)) - - } - - - - func close(view: ControllerBackedProtocol?) { + func complete(from view: StakingRebondConfirmationViewProtocol?) { - return cuckoo_manager.call("close(view: ControllerBackedProtocol?)", + return cuckoo_manager.call("complete(from: StakingRebondConfirmationViewProtocol?)", parameters: (view), escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(view: view)) + defaultCall: __defaultImplStub!.complete(from: view)) } @@ -39038,7 +38790,7 @@ import SoraFoundation } - struct __StubbingProxy_StakingBondMoreWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondConfirmationWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -39046,29 +38798,24 @@ import SoraFoundation } - func showConfirmation(from view: M1, amount: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, Decimal)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: amount) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreWireframeProtocol.self, method: "showConfirmation(from: ControllerBackedProtocol?, amount: Decimal)", parameterMatchers: matchers)) - } - - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreWireframeProtocol.self, method: "close(view: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRebondConfirmationViewProtocol?)> where M1.OptionalMatchedType == StakingRebondConfirmationViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingRebondConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationWireframeProtocol.self, method: "complete(from: StakingRebondConfirmationViewProtocol?)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondConfirmationWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -39083,15 +38830,9 @@ import SoraFoundation @discardableResult - func showConfirmation(from view: M1, amount: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, Decimal), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: amount) { $0.1 }] - return cuckoo_manager.verify("showConfirmation(from: ControllerBackedProtocol?, amount: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingRebondConfirmationViewProtocol?), Void> where M1.OptionalMatchedType == StakingRebondConfirmationViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingRebondConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(from: StakingRebondConfirmationViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -39109,7 +38850,7 @@ import SoraFoundation } } - class StakingBondMoreWireframeProtocolStub: StakingBondMoreWireframeProtocol { + class StakingRebondConfirmationWireframeProtocolStub: StakingRebondConfirmationWireframeProtocol { @@ -39117,13 +38858,7 @@ import SoraFoundation - func showConfirmation(from view: ControllerBackedProtocol?, amount: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func close(view: ControllerBackedProtocol?) { + func complete(from view: StakingRebondConfirmationViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -39145,24 +38880,24 @@ import SoraFoundation import Cuckoo @testable import novawallet -import BigInt import CommonWallet +import Foundation import SoraFoundation - class MockStakingBondMoreConfirmationViewProtocol: StakingBondMoreConfirmationViewProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondSetupViewProtocol: StakingRebondSetupViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreConfirmationViewProtocol + typealias MocksType = StakingRebondSetupViewProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationViewProtocol - typealias Verification = __VerificationProxy_StakingBondMoreConfirmationViewProtocol + typealias Stubbing = __StubbingProxy_StakingRebondSetupViewProtocol + typealias Verification = __VerificationProxy_StakingRebondSetupViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreConfirmationViewProtocol? + private var __defaultImplStub: StakingRebondSetupViewProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationViewProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondSetupViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -39221,65 +38956,22 @@ import SoraFoundation } - - - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } - - } - - func didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel) { - - return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) - - } - - - - func didReceiveAmount(viewModel: LocalizableResource) { + func didReceiveAsset(viewModel: LocalizableResource) { - return cuckoo_manager.call("didReceiveAmount(viewModel: LocalizableResource)", + return cuckoo_manager.call("didReceiveAsset(viewModel: LocalizableResource)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAmount(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) } @@ -39300,51 +38992,51 @@ import SoraFoundation - public func applyLocalization() { + func didReceiveInput(viewModel: LocalizableResource) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveInput(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) } - func didStartLoading() { + func didReceiveTransferable(viewModel: LocalizableResource?) { - return cuckoo_manager.call("didStartLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveTransferable(viewModel: LocalizableResource?)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.didReceiveTransferable(viewModel: viewModel)) } - func didStopLoading() { + public func applyLocalization() { - return cuckoo_manager.call("didStopLoading()", + return cuckoo_manager.call("applyLocalization()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_StakingBondMoreConfirmationViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondSetupViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -39352,64 +39044,49 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") - } - - - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingBondMoreConfirmViewModel)> where M1.MatchedType == StakingBondMoreConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingBondMoreConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel)", parameterMatchers: matchers)) - } - - func didReceiveAmount(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didReceiveAmount(viewModel: LocalizableResource)", parameterMatchers: matchers)) + func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "didReceiveAsset(viewModel: LocalizableResource)", parameterMatchers: matchers)) } func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "didReceiveInput(viewModel: LocalizableResource)", parameterMatchers: matchers)) } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + func didReceiveTransferable(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "didReceiveTransferable(viewModel: LocalizableResource?)", parameterMatchers: matchers)) } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreConfirmationViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondSetupViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -39436,28 +39113,12 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingBondMoreConfirmViewModel), Void> where M1.MatchedType == StakingBondMoreConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingBondMoreConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAmount(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAmount(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAsset(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -39467,27 +39128,27 @@ import SoraFoundation } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveInput(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveTransferable(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveTransferable(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingBondMoreConfirmationViewProtocolStub: StakingBondMoreConfirmationViewProtocol { + class StakingRebondSetupViewProtocolStub: StakingRebondSetupViewProtocol { @@ -39517,24 +39178,6 @@ import SoraFoundation set { } } - - - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } @@ -39542,13 +39185,7 @@ import SoraFoundation - func didReceiveConfirmation(viewModel: StakingBondMoreConfirmViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAmount(viewModel: LocalizableResource) { + func didReceiveAsset(viewModel: LocalizableResource) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -39560,19 +39197,19 @@ import SoraFoundation - public func applyLocalization() { + func didReceiveInput(viewModel: LocalizableResource) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartLoading() { + func didReceiveTransferable(viewModel: LocalizableResource?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStopLoading() { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -39580,19 +39217,19 @@ import SoraFoundation - class MockStakingBondMoreConfirmationPresenterProtocol: StakingBondMoreConfirmationPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondSetupPresenterProtocol: StakingRebondSetupPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreConfirmationPresenterProtocol + typealias MocksType = StakingRebondSetupPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationPresenterProtocol - typealias Verification = __VerificationProxy_StakingBondMoreConfirmationPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingRebondSetupPresenterProtocol + typealias Verification = __VerificationProxy_StakingRebondSetupPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreConfirmationPresenterProtocol? + private var __defaultImplStub: StakingRebondSetupPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondSetupPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -39620,36 +39257,66 @@ import SoraFoundation - func confirm() { + func selectAmountPercentage(_ percentage: Float) { - return cuckoo_manager.call("confirm()", + return cuckoo_manager.call("selectAmountPercentage(_: Float)", + parameters: (percentage), + escapingParameters: (percentage), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.selectAmountPercentage(percentage)) + + } + + + + func updateAmount(_ newValue: Decimal) { + + return cuckoo_manager.call("updateAmount(_: Decimal)", + parameters: (newValue), + escapingParameters: (newValue), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.updateAmount(newValue)) + + } + + + + func proceed() { + + return cuckoo_manager.call("proceed()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.confirm()) + defaultCall: __defaultImplStub!.proceed()) } - func selectAccount() { + func close() { - return cuckoo_manager.call("selectAccount()", + return cuckoo_manager.call("close()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectAccount()) + defaultCall: __defaultImplStub!.close()) } - struct __StubbingProxy_StakingBondMoreConfirmationPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondSetupPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -39659,22 +39326,32 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func selectAmountPercentage(_ percentage: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Float)> where M1.MatchedType == Float { + let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "selectAmountPercentage(_: Float)", parameterMatchers: matchers)) + } + + func updateAmount(_ newValue: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "updateAmount(_: Decimal)", parameterMatchers: matchers)) + } + + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } - func selectAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func close() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationPresenterProtocol.self, method: "selectAccount()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "close()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreConfirmationPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondSetupPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -39695,21 +39372,33 @@ import SoraFoundation } @discardableResult - func confirm() -> Cuckoo.__DoNotUse<(), Void> { + func selectAmountPercentage(_ percentage: M1) -> Cuckoo.__DoNotUse<(Float), Void> where M1.MatchedType == Float { + let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] + return cuckoo_manager.verify("selectAmountPercentage(_: Float)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func updateAmount(_ newValue: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] + return cuckoo_manager.verify("updateAmount(_: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func proceed() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectAccount() -> Cuckoo.__DoNotUse<(), Void> { + func close() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("close()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingBondMoreConfirmationPresenterProtocolStub: StakingBondMoreConfirmationPresenterProtocol { + class StakingRebondSetupPresenterProtocolStub: StakingRebondSetupPresenterProtocol { @@ -39723,13 +39412,25 @@ import SoraFoundation - func confirm() { + func selectAmountPercentage(_ percentage: Float) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectAccount() { + func updateAmount(_ newValue: Decimal) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func proceed() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func close() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -39737,19 +39438,19 @@ import SoraFoundation - class MockStakingBondMoreConfirmationInteractorInputProtocol: StakingBondMoreConfirmationInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondSetupInteractorInputProtocol: StakingRebondSetupInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreConfirmationInteractorInputProtocol + typealias MocksType = StakingRebondSetupInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingBondMoreConfirmationInteractorInputProtocol + typealias Stubbing = __StubbingProxy_StakingRebondSetupInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingRebondSetupInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreConfirmationInteractorInputProtocol? + private var __defaultImplStub: StakingRebondSetupInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondSetupInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -39777,36 +39478,21 @@ import SoraFoundation - func submit(for amount: Decimal) { - - return cuckoo_manager.call("submit(for: Decimal)", - parameters: (amount), - escapingParameters: (amount), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.submit(for: amount)) - - } - - - - func estimateFee(for amount: Decimal) { + func estimateFee() { - return cuckoo_manager.call("estimateFee(for: Decimal)", - parameters: (amount), - escapingParameters: (amount), + return cuckoo_manager.call("estimateFee()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee(for: amount)) + defaultCall: __defaultImplStub!.estimateFee()) } - struct __StubbingProxy_StakingBondMoreConfirmationInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondSetupInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -39816,22 +39502,17 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func submit(for amount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationInteractorInputProtocol.self, method: "submit(for: Decimal)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func estimateFee(for amount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationInteractorInputProtocol.self, method: "estimateFee(for: Decimal)", parameterMatchers: matchers)) + func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreConfirmationInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondSetupInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -39852,21 +39533,15 @@ import SoraFoundation } @discardableResult - func submit(for amount: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] - return cuckoo_manager.verify("submit(for: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func estimateFee(for amount: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] - return cuckoo_manager.verify("estimateFee(for: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingBondMoreConfirmationInteractorInputProtocolStub: StakingBondMoreConfirmationInteractorInputProtocol { + class StakingRebondSetupInteractorInputProtocolStub: StakingRebondSetupInteractorInputProtocol { @@ -39880,13 +39555,7 @@ import SoraFoundation - func submit(for amount: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func estimateFee(for amount: Decimal) { + func estimateFee() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -39894,19 +39563,19 @@ import SoraFoundation - class MockStakingBondMoreConfirmationOutputProtocol: StakingBondMoreConfirmationOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondSetupInteractorOutputProtocol: StakingRebondSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreConfirmationOutputProtocol + typealias MocksType = StakingRebondSetupInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationOutputProtocol - typealias Verification = __VerificationProxy_StakingBondMoreConfirmationOutputProtocol + typealias Stubbing = __StubbingProxy_StakingRebondSetupInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingRebondSetupInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreConfirmationOutputProtocol? + private var __defaultImplStub: StakingRebondSetupInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondSetupInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -39919,61 +39588,61 @@ import SoraFoundation - func didReceiveAccountInfo(result: Result) { + func didReceiveStakingLedger(result: Result) { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) } - func didReceivePriceData(result: Result) { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("didReceivePriceData(result: Result)", + return cuckoo_manager.call("didReceiveFee(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - func didReceiveFee(result: Result) { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("didReceiveFee(result: Result)", + return cuckoo_manager.call("didReceivePriceData(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - func didReceiveStash(result: Result) { + func didReceiveController(result: Result) { - return cuckoo_manager.call("didReceiveStash(result: Result)", + return cuckoo_manager.call("didReceiveController(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStash(result: result)) + defaultCall: __defaultImplStub!.didReceiveController(result: result)) } @@ -39994,21 +39663,21 @@ import SoraFoundation - func didSubmitBonding(result: Result) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("didSubmitBonding(result: Result)", + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSubmitBonding(result: result)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - struct __StubbingProxy_StakingBondMoreConfirmationOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -40016,39 +39685,39 @@ import SoraFoundation } - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) } func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func didReceiveStash(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceiveStash(result: Result)", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) } func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) } - func didSubmitBonding(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationOutputProtocol.self, method: "didSubmitBonding(result: Result)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreConfirmationOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -40063,15 +39732,9 @@ import SoraFoundation @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -40081,9 +39744,15 @@ import SoraFoundation } @discardableResult - func didReceiveStash(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStash(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -40093,15 +39762,15 @@ import SoraFoundation } @discardableResult - func didSubmitBonding(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didSubmitBonding(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingBondMoreConfirmationOutputProtocolStub: StakingBondMoreConfirmationOutputProtocol { + class StakingRebondSetupInteractorOutputProtocolStub: StakingRebondSetupInteractorOutputProtocol { @@ -40109,25 +39778,25 @@ import SoraFoundation - func didReceiveAccountInfo(result: Result) { + func didReceiveStakingLedger(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceivePriceData(result: Result) { + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFee(result: Result) { + func didReceivePriceData(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStash(result: Result) { + func didReceiveController(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -40139,7 +39808,7 @@ import SoraFoundation - func didSubmitBonding(result: Result) { + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -40147,19 +39816,19 @@ import SoraFoundation - class MockStakingBondMoreConfirmationWireframeProtocol: StakingBondMoreConfirmationWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingRebondSetupWireframeProtocol: StakingRebondSetupWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingBondMoreConfirmationWireframeProtocol + typealias MocksType = StakingRebondSetupWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingBondMoreConfirmationWireframeProtocol - typealias Verification = __VerificationProxy_StakingBondMoreConfirmationWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingRebondSetupWireframeProtocol + typealias Verification = __VerificationProxy_StakingRebondSetupWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingBondMoreConfirmationWireframeProtocol? + private var __defaultImplStub: StakingRebondSetupWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingBondMoreConfirmationWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingRebondSetupWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -40172,16 +39841,31 @@ import SoraFoundation - func complete(from view: StakingBondMoreConfirmationViewProtocol?) { + func proceed(view parameter0: StakingRebondSetupViewProtocol?, amount parameter1: Decimal) { - return cuckoo_manager.call("complete(from: StakingBondMoreConfirmationViewProtocol?)", + return cuckoo_manager.call("proceed(view: StakingRebondSetupViewProtocol?, amount: Decimal)", + parameters: (parameter0, parameter1), + escapingParameters: (parameter0, parameter1), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.proceed(view: parameter0, amount: parameter1)) + + } + + + + func close(view: StakingRebondSetupViewProtocol?) { + + return cuckoo_manager.call("close(view: StakingRebondSetupViewProtocol?)", parameters: (view), escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.complete(from: view)) + defaultCall: __defaultImplStub!.close(view: view)) } @@ -40216,7 +39900,7 @@ import SoraFoundation } - struct __StubbingProxy_StakingBondMoreConfirmationWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRebondSetupWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -40224,24 +39908,29 @@ import SoraFoundation } - func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingBondMoreConfirmationViewProtocol?)> where M1.OptionalMatchedType == StakingBondMoreConfirmationViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingBondMoreConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationWireframeProtocol.self, method: "complete(from: StakingBondMoreConfirmationViewProtocol?)", parameterMatchers: matchers)) + func proceed(view parameter0: M1, amount parameter1: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRebondSetupViewProtocol?, Decimal)> where M1.OptionalMatchedType == StakingRebondSetupViewProtocol, M2.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(StakingRebondSetupViewProtocol?, Decimal)>] = [wrap(matchable: parameter0) { $0.0 }, wrap(matchable: parameter1) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupWireframeProtocol.self, method: "proceed(view: StakingRebondSetupViewProtocol?, amount: Decimal)", parameterMatchers: matchers)) + } + + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRebondSetupViewProtocol?)> where M1.OptionalMatchedType == StakingRebondSetupViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingRebondSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupWireframeProtocol.self, method: "close(view: StakingRebondSetupViewProtocol?)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingBondMoreConfirmationWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingBondMoreConfirmationWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRebondSetupWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -40256,9 +39945,15 @@ import SoraFoundation @discardableResult - func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingBondMoreConfirmationViewProtocol?), Void> where M1.OptionalMatchedType == StakingBondMoreConfirmationViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingBondMoreConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(from: StakingBondMoreConfirmationViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed(view parameter0: M1, amount parameter1: M2) -> Cuckoo.__DoNotUse<(StakingRebondSetupViewProtocol?, Decimal), Void> where M1.OptionalMatchedType == StakingRebondSetupViewProtocol, M2.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(StakingRebondSetupViewProtocol?, Decimal)>] = [wrap(matchable: parameter0) { $0.0 }, wrap(matchable: parameter1) { $0.1 }] + return cuckoo_manager.verify("proceed(view: StakingRebondSetupViewProtocol?, amount: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func close(view: M1) -> Cuckoo.__DoNotUse<(StakingRebondSetupViewProtocol?), Void> where M1.OptionalMatchedType == StakingRebondSetupViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingRebondSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: StakingRebondSetupViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -40276,1179 +39971,784 @@ import SoraFoundation } } - class StakingBondMoreConfirmationWireframeProtocolStub: StakingBondMoreConfirmationWireframeProtocol { - - - - - - - - func complete(from view: StakingBondMoreConfirmationViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - -import Cuckoo -@testable import novawallet - -import BigInt -import Foundation - - - class MockStakingRelaychainInteractorInputProtocol: StakingRelaychainInteractorInputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRelaychainInteractorInputProtocol - - typealias Stubbing = __StubbingProxy_StakingRelaychainInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingRelaychainInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: StakingRelaychainInteractorInputProtocol? - - func enableDefaultImplementation(_ stub: StakingRelaychainInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - - struct __StubbingProxy_StakingRelaychainInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRelaychainInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class StakingRelaychainInteractorInputProtocolStub: StakingRelaychainInteractorInputProtocol { - - - - - - - - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - - - class MockStakingRelaychainInteractorOutputProtocol: StakingRelaychainInteractorOutputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRelaychainInteractorOutputProtocol - - typealias Stubbing = __StubbingProxy_StakingRelaychainInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingRelaychainInteractorOutputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: StakingRelaychainInteractorOutputProtocol? - - func enableDefaultImplementation(_ stub: StakingRelaychainInteractorOutputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func didReceive(selectedAddress: String) { - - return cuckoo_manager.call("didReceive(selectedAddress: String)", - parameters: (selectedAddress), - escapingParameters: (selectedAddress), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(selectedAddress: selectedAddress)) - - } - - - - func didReceive(price: PriceData?) { - - return cuckoo_manager.call("didReceive(price: PriceData?)", - parameters: (price), - escapingParameters: (price), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(price: price)) - - } - - - - func didReceive(priceError: Error) { - - return cuckoo_manager.call("didReceive(priceError: Error)", - parameters: (priceError), - escapingParameters: (priceError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(priceError: priceError)) - - } - - - - func didReceive(totalReward: TotalRewardItem) { - - return cuckoo_manager.call("didReceive(totalReward: TotalRewardItem)", - parameters: (totalReward), - escapingParameters: (totalReward), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(totalReward: totalReward)) - - } - - - - func didReceive(totalRewardError: Error) { - - return cuckoo_manager.call("didReceive(totalRewardError: Error)", - parameters: (totalRewardError), - escapingParameters: (totalRewardError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(totalRewardError: totalRewardError)) - - } - - - - func didReceive(accountInfo: AccountInfo?) { - - return cuckoo_manager.call("didReceive(accountInfo: AccountInfo?)", - parameters: (accountInfo), - escapingParameters: (accountInfo), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(accountInfo: accountInfo)) - - } - - - - func didReceive(balanceError: Error) { - - return cuckoo_manager.call("didReceive(balanceError: Error)", - parameters: (balanceError), - escapingParameters: (balanceError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(balanceError: balanceError)) - - } - - - - func didReceive(calculator: RewardCalculatorEngineProtocol) { - - return cuckoo_manager.call("didReceive(calculator: RewardCalculatorEngineProtocol)", - parameters: (calculator), - escapingParameters: (calculator), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(calculator: calculator)) - - } - - - - func didReceive(calculatorError: Error) { - - return cuckoo_manager.call("didReceive(calculatorError: Error)", - parameters: (calculatorError), - escapingParameters: (calculatorError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(calculatorError: calculatorError)) - - } - - - - func didReceive(stashItem: StashItem?) { - - return cuckoo_manager.call("didReceive(stashItem: StashItem?)", - parameters: (stashItem), - escapingParameters: (stashItem), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(stashItem: stashItem)) - - } - - - - func didReceive(stashItemError: Error) { - - return cuckoo_manager.call("didReceive(stashItemError: Error)", - parameters: (stashItemError), - escapingParameters: (stashItemError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(stashItemError: stashItemError)) - - } - - - - func didReceive(ledgerInfo: StakingLedger?) { - - return cuckoo_manager.call("didReceive(ledgerInfo: StakingLedger?)", - parameters: (ledgerInfo), - escapingParameters: (ledgerInfo), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(ledgerInfo: ledgerInfo)) - - } - + class StakingRebondSetupWireframeProtocolStub: StakingRebondSetupWireframeProtocol { + - func didReceive(ledgerInfoError: Error) { - - return cuckoo_manager.call("didReceive(ledgerInfoError: Error)", - parameters: (ledgerInfoError), - escapingParameters: (ledgerInfoError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(ledgerInfoError: ledgerInfoError)) - - } + - func didReceive(nomination: Nomination?) { - - return cuckoo_manager.call("didReceive(nomination: Nomination?)", - parameters: (nomination), - escapingParameters: (nomination), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(nomination: nomination)) - + func proceed(view parameter0: StakingRebondSetupViewProtocol?, amount parameter1: Decimal) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(nominationError: Error) { - - return cuckoo_manager.call("didReceive(nominationError: Error)", - parameters: (nominationError), - escapingParameters: (nominationError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(nominationError: nominationError)) - + func close(view: StakingRebondSetupViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(validatorPrefs: ValidatorPrefs?) { - - return cuckoo_manager.call("didReceive(validatorPrefs: ValidatorPrefs?)", - parameters: (validatorPrefs), - escapingParameters: (validatorPrefs), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(validatorPrefs: validatorPrefs)) - + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(validatorError: Error) { - - return cuckoo_manager.call("didReceive(validatorError: Error)", - parameters: (validatorError), - escapingParameters: (validatorError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(validatorError: validatorError)) - + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + +import Cuckoo +@testable import novawallet + +import BigInt +import Foundation +import SoraFoundation + + + class MockStakingRedeemViewProtocol: StakingRedeemViewProtocol, Cuckoo.ProtocolMock { + typealias MocksType = StakingRedeemViewProtocol - func didReceive(eraStakersInfo: EraStakersInfo) { - - return cuckoo_manager.call("didReceive(eraStakersInfo: EraStakersInfo)", - parameters: (eraStakersInfo), - escapingParameters: (eraStakersInfo), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(eraStakersInfo: eraStakersInfo)) - - } - - + typealias Stubbing = __StubbingProxy_StakingRedeemViewProtocol + typealias Verification = __VerificationProxy_StakingRedeemViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func didReceive(eraStakersInfoError: Error) { - - return cuckoo_manager.call("didReceive(eraStakersInfoError: Error)", - parameters: (eraStakersInfoError), - escapingParameters: (eraStakersInfoError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(eraStakersInfoError: eraStakersInfoError)) - + private var __defaultImplStub: StakingRedeemViewProtocol? + + func enableDefaultImplementation(_ stub: StakingRedeemViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + - func didReceive(networkStakingInfo: NetworkStakingInfo) { - - return cuckoo_manager.call("didReceive(networkStakingInfo: NetworkStakingInfo)", - parameters: (networkStakingInfo), - escapingParameters: (networkStakingInfo), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(networkStakingInfo: networkStakingInfo)) + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } - func didReceive(networkStakingInfoError: Error) { - - return cuckoo_manager.call("didReceive(networkStakingInfoError: Error)", - parameters: (networkStakingInfoError), - escapingParameters: (networkStakingInfoError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(networkStakingInfoError: networkStakingInfoError)) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } - func didReceive(payee: RewardDestinationArg?) { + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } - return cuckoo_manager.call("didReceive(payee: RewardDestinationArg?)", - parameters: (payee), - escapingParameters: (payee), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(payee: payee)) + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } } - func didReceive(payeeError: Error) { - - return cuckoo_manager.call("didReceive(payeeError: Error)", - parameters: (payeeError), - escapingParameters: (payeeError), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(payeeError: payeeError)) + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } } - func didReceive(newChainAsset: ChainAsset) { - - return cuckoo_manager.call("didReceive(newChainAsset: ChainAsset)", - parameters: (newChainAsset), - escapingParameters: (newChainAsset), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(newChainAsset: newChainAsset)) + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } } + - - func didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod) { - - return cuckoo_manager.call("didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod)", - parameters: (subqueryRewards, period), - escapingParameters: (subqueryRewards, period), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceieve(subqueryRewards: subqueryRewards, period: period)) - - } + - func didReceiveMinNominatorBond(result: Result) { + func didReceiveConfirmation(viewModel: StakingRedeemViewModel) { - return cuckoo_manager.call("didReceiveMinNominatorBond(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingRedeemViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMinNominatorBond(result: result)) + defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) } - func didReceiveCounterForNominators(result: Result) { + func didReceiveAmount(viewModel: LocalizableResource) { - return cuckoo_manager.call("didReceiveCounterForNominators(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveAmount(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveCounterForNominators(result: result)) + defaultCall: __defaultImplStub!.didReceiveAmount(viewModel: viewModel)) } - func didReceiveMaxNominatorsCount(result: Result) { + func didReceiveFee(viewModel: LocalizableResource?) { - return cuckoo_manager.call("didReceiveMaxNominatorsCount(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMaxNominatorsCount(result: result)) + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) } - func didReceive(eraCountdownResult: Result) { + public func applyLocalization() { - return cuckoo_manager.call("didReceive(eraCountdownResult: Result)", - parameters: (eraCountdownResult), - escapingParameters: (eraCountdownResult), + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(eraCountdownResult: eraCountdownResult)) + defaultCall: __defaultImplStub!.applyLocalization()) } - func didReceiveMaxNominatorsPerValidator(result: Result) { + func didStartLoading() { - return cuckoo_manager.call("didReceiveMaxNominatorsPerValidator(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMaxNominatorsPerValidator(result: result)) + defaultCall: __defaultImplStub!.didStartLoading()) } - func didReceiveAccount(_ account: MetaChainAccountResponse?, for accountId: AccountId) { + func didStopLoading() { - return cuckoo_manager.call("didReceiveAccount(_: MetaChainAccountResponse?, for: AccountId)", - parameters: (account, accountId), - escapingParameters: (account, accountId), + return cuckoo_manager.call("didStopLoading()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccount(account, for: accountId)) + defaultCall: __defaultImplStub!.didStopLoading()) } - struct __StubbingProxy_StakingRelaychainInteractorOutputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didReceive(selectedAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: selectedAddress) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(selectedAddress: String)", parameterMatchers: matchers)) - } - - func didReceive(price: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PriceData?)> where M1.OptionalMatchedType == PriceData { - let matchers: [Cuckoo.ParameterMatcher<(PriceData?)>] = [wrap(matchable: price) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(price: PriceData?)", parameterMatchers: matchers)) - } - - func didReceive(priceError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: priceError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(priceError: Error)", parameterMatchers: matchers)) - } - - func didReceive(totalReward: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(TotalRewardItem)> where M1.MatchedType == TotalRewardItem { - let matchers: [Cuckoo.ParameterMatcher<(TotalRewardItem)>] = [wrap(matchable: totalReward) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(totalReward: TotalRewardItem)", parameterMatchers: matchers)) - } - - func didReceive(totalRewardError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: totalRewardError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(totalRewardError: Error)", parameterMatchers: matchers)) - } - - func didReceive(accountInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountInfo?)> where M1.OptionalMatchedType == AccountInfo { - let matchers: [Cuckoo.ParameterMatcher<(AccountInfo?)>] = [wrap(matchable: accountInfo) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(accountInfo: AccountInfo?)", parameterMatchers: matchers)) - } - - func didReceive(balanceError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: balanceError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(balanceError: Error)", parameterMatchers: matchers)) - } - - func didReceive(calculator: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RewardCalculatorEngineProtocol)> where M1.MatchedType == RewardCalculatorEngineProtocol { - let matchers: [Cuckoo.ParameterMatcher<(RewardCalculatorEngineProtocol)>] = [wrap(matchable: calculator) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(calculator: RewardCalculatorEngineProtocol)", parameterMatchers: matchers)) - } - - func didReceive(calculatorError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: calculatorError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(calculatorError: Error)", parameterMatchers: matchers)) - } - - func didReceive(stashItem: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StashItem?)> where M1.OptionalMatchedType == StashItem { - let matchers: [Cuckoo.ParameterMatcher<(StashItem?)>] = [wrap(matchable: stashItem) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(stashItem: StashItem?)", parameterMatchers: matchers)) - } - - func didReceive(stashItemError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: stashItemError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(stashItemError: Error)", parameterMatchers: matchers)) - } - - func didReceive(ledgerInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingLedger?)> where M1.OptionalMatchedType == StakingLedger { - let matchers: [Cuckoo.ParameterMatcher<(StakingLedger?)>] = [wrap(matchable: ledgerInfo) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(ledgerInfo: StakingLedger?)", parameterMatchers: matchers)) - } - - func didReceive(ledgerInfoError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: ledgerInfoError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(ledgerInfoError: Error)", parameterMatchers: matchers)) - } - - func didReceive(nomination: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Nomination?)> where M1.OptionalMatchedType == Nomination { - let matchers: [Cuckoo.ParameterMatcher<(Nomination?)>] = [wrap(matchable: nomination) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(nomination: Nomination?)", parameterMatchers: matchers)) - } - - func didReceive(nominationError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: nominationError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(nominationError: Error)", parameterMatchers: matchers)) - } - - func didReceive(validatorPrefs: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ValidatorPrefs?)> where M1.OptionalMatchedType == ValidatorPrefs { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorPrefs?)>] = [wrap(matchable: validatorPrefs) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(validatorPrefs: ValidatorPrefs?)", parameterMatchers: matchers)) - } - - func didReceive(validatorError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: validatorError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(validatorError: Error)", parameterMatchers: matchers)) - } - - func didReceive(eraStakersInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(EraStakersInfo)> where M1.MatchedType == EraStakersInfo { - let matchers: [Cuckoo.ParameterMatcher<(EraStakersInfo)>] = [wrap(matchable: eraStakersInfo) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(eraStakersInfo: EraStakersInfo)", parameterMatchers: matchers)) - } - - func didReceive(eraStakersInfoError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: eraStakersInfoError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(eraStakersInfoError: Error)", parameterMatchers: matchers)) - } - - func didReceive(networkStakingInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(NetworkStakingInfo)> where M1.MatchedType == NetworkStakingInfo { - let matchers: [Cuckoo.ParameterMatcher<(NetworkStakingInfo)>] = [wrap(matchable: networkStakingInfo) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(networkStakingInfo: NetworkStakingInfo)", parameterMatchers: matchers)) - } - - func didReceive(networkStakingInfoError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: networkStakingInfoError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(networkStakingInfoError: Error)", parameterMatchers: matchers)) - } - - func didReceive(payee: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(RewardDestinationArg?)> where M1.OptionalMatchedType == RewardDestinationArg { - let matchers: [Cuckoo.ParameterMatcher<(RewardDestinationArg?)>] = [wrap(matchable: payee) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(payee: RewardDestinationArg?)", parameterMatchers: matchers)) - } - - func didReceive(payeeError: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: payeeError) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(payeeError: Error)", parameterMatchers: matchers)) - } - - func didReceive(newChainAsset: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainAsset)> where M1.MatchedType == ChainAsset { - let matchers: [Cuckoo.ParameterMatcher<(ChainAsset)>] = [wrap(matchable: newChainAsset) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(newChainAsset: ChainAsset)", parameterMatchers: matchers)) - } - - func didReceieve(subqueryRewards: M1, period: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[SubqueryRewardItemData]?, Error>, AnalyticsPeriod)> where M1.MatchedType == Result<[SubqueryRewardItemData]?, Error>, M2.MatchedType == AnalyticsPeriod { - let matchers: [Cuckoo.ParameterMatcher<(Result<[SubqueryRewardItemData]?, Error>, AnalyticsPeriod)>] = [wrap(matchable: subqueryRewards) { $0.0 }, wrap(matchable: period) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod)", parameterMatchers: matchers)) - } - - func didReceiveMinNominatorBond(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveMinNominatorBond(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveCounterForNominators(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveCounterForNominators(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveMaxNominatorsCount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveMaxNominatorsCount(result: Result)", parameterMatchers: matchers)) - } - - func didReceive(eraCountdownResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: eraCountdownResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceive(eraCountdownResult: Result)", parameterMatchers: matchers)) - } - - func didReceiveMaxNominatorsPerValidator(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveMaxNominatorsPerValidator(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccount(_ account: M1, for accountId: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaChainAccountResponse?, AccountId)> where M1.OptionalMatchedType == MetaChainAccountResponse, M2.MatchedType == AccountId { - let matchers: [Cuckoo.ParameterMatcher<(MetaChainAccountResponse?, AccountId)>] = [wrap(matchable: account) { $0.0 }, wrap(matchable: accountId) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainInteractorOutputProtocol.self, method: "didReceiveAccount(_: MetaChainAccountResponse?, for: AccountId)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRelaychainInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __StubbingProxy_StakingRedeemViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - @discardableResult - func didReceive(selectedAddress: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: selectedAddress) { $0 }] - return cuckoo_manager.verify("didReceive(selectedAddress: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(price: M1) -> Cuckoo.__DoNotUse<(PriceData?), Void> where M1.OptionalMatchedType == PriceData { - let matchers: [Cuckoo.ParameterMatcher<(PriceData?)>] = [wrap(matchable: price) { $0 }] - return cuckoo_manager.verify("didReceive(price: PriceData?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(priceError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: priceError) { $0 }] - return cuckoo_manager.verify("didReceive(priceError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(totalReward: M1) -> Cuckoo.__DoNotUse<(TotalRewardItem), Void> where M1.MatchedType == TotalRewardItem { - let matchers: [Cuckoo.ParameterMatcher<(TotalRewardItem)>] = [wrap(matchable: totalReward) { $0 }] - return cuckoo_manager.verify("didReceive(totalReward: TotalRewardItem)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(totalRewardError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: totalRewardError) { $0 }] - return cuckoo_manager.verify("didReceive(totalRewardError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(accountInfo: M1) -> Cuckoo.__DoNotUse<(AccountInfo?), Void> where M1.OptionalMatchedType == AccountInfo { - let matchers: [Cuckoo.ParameterMatcher<(AccountInfo?)>] = [wrap(matchable: accountInfo) { $0 }] - return cuckoo_manager.verify("didReceive(accountInfo: AccountInfo?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(balanceError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: balanceError) { $0 }] - return cuckoo_manager.verify("didReceive(balanceError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager } - @discardableResult - func didReceive(calculator: M1) -> Cuckoo.__DoNotUse<(RewardCalculatorEngineProtocol), Void> where M1.MatchedType == RewardCalculatorEngineProtocol { - let matchers: [Cuckoo.ParameterMatcher<(RewardCalculatorEngineProtocol)>] = [wrap(matchable: calculator) { $0 }] - return cuckoo_manager.verify("didReceive(calculator: RewardCalculatorEngineProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - @discardableResult - func didReceive(calculatorError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: calculatorError) { $0 }] - return cuckoo_manager.verify("didReceive(calculatorError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - @discardableResult - func didReceive(stashItem: M1) -> Cuckoo.__DoNotUse<(StashItem?), Void> where M1.OptionalMatchedType == StashItem { - let matchers: [Cuckoo.ParameterMatcher<(StashItem?)>] = [wrap(matchable: stashItem) { $0 }] - return cuckoo_manager.verify("didReceive(stashItem: StashItem?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - @discardableResult - func didReceive(stashItemError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: stashItemError) { $0 }] - return cuckoo_manager.verify("didReceive(stashItemError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - @discardableResult - func didReceive(ledgerInfo: M1) -> Cuckoo.__DoNotUse<(StakingLedger?), Void> where M1.OptionalMatchedType == StakingLedger { - let matchers: [Cuckoo.ParameterMatcher<(StakingLedger?)>] = [wrap(matchable: ledgerInfo) { $0 }] - return cuckoo_manager.verify("didReceive(ledgerInfo: StakingLedger?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") } - @discardableResult - func didReceive(ledgerInfoError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: ledgerInfoError) { $0 }] - return cuckoo_manager.verify("didReceive(ledgerInfoError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") } - @discardableResult - func didReceive(nomination: M1) -> Cuckoo.__DoNotUse<(Nomination?), Void> where M1.OptionalMatchedType == Nomination { - let matchers: [Cuckoo.ParameterMatcher<(Nomination?)>] = [wrap(matchable: nomination) { $0 }] - return cuckoo_manager.verify("didReceive(nomination: Nomination?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRedeemViewModel)> where M1.MatchedType == StakingRedeemViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingRedeemViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingRedeemViewModel)", parameterMatchers: matchers)) } - @discardableResult - func didReceive(nominationError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: nominationError) { $0 }] - return cuckoo_manager.verify("didReceive(nominationError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAmount(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didReceiveAmount(viewModel: LocalizableResource)", parameterMatchers: matchers)) } - @discardableResult - func didReceive(validatorPrefs: M1) -> Cuckoo.__DoNotUse<(ValidatorPrefs?), Void> where M1.OptionalMatchedType == ValidatorPrefs { - let matchers: [Cuckoo.ParameterMatcher<(ValidatorPrefs?)>] = [wrap(matchable: validatorPrefs) { $0 }] - return cuckoo_manager.verify("didReceive(validatorPrefs: ValidatorPrefs?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) } - @discardableResult - func didReceive(validatorError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: validatorError) { $0 }] - return cuckoo_manager.verify("didReceive(validatorError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } - @discardableResult - func didReceive(eraStakersInfo: M1) -> Cuckoo.__DoNotUse<(EraStakersInfo), Void> where M1.MatchedType == EraStakersInfo { - let matchers: [Cuckoo.ParameterMatcher<(EraStakersInfo)>] = [wrap(matchable: eraStakersInfo) { $0 }] - return cuckoo_manager.verify("didReceive(eraStakersInfo: EraStakersInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) } - @discardableResult - func didReceive(eraStakersInfoError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: eraStakersInfoError) { $0 }] - return cuckoo_manager.verify("didReceive(eraStakersInfoError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } - @discardableResult - func didReceive(networkStakingInfo: M1) -> Cuckoo.__DoNotUse<(NetworkStakingInfo), Void> where M1.MatchedType == NetworkStakingInfo { - let matchers: [Cuckoo.ParameterMatcher<(NetworkStakingInfo)>] = [wrap(matchable: networkStakingInfo) { $0 }] - return cuckoo_manager.verify("didReceive(networkStakingInfo: NetworkStakingInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + struct __VerificationProxy_StakingRedeemViewProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation } + - @discardableResult - func didReceive(networkStakingInfoError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: networkStakingInfoError) { $0 }] - return cuckoo_manager.verify("didReceive(networkStakingInfoError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceive(payee: M1) -> Cuckoo.__DoNotUse<(RewardDestinationArg?), Void> where M1.OptionalMatchedType == RewardDestinationArg { - let matchers: [Cuckoo.ParameterMatcher<(RewardDestinationArg?)>] = [wrap(matchable: payee) { $0 }] - return cuckoo_manager.verify("didReceive(payee: RewardDestinationArg?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceive(payeeError: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: payeeError) { $0 }] - return cuckoo_manager.verify("didReceive(payeeError: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceive(newChainAsset: M1) -> Cuckoo.__DoNotUse<(ChainAsset), Void> where M1.MatchedType == ChainAsset { - let matchers: [Cuckoo.ParameterMatcher<(ChainAsset)>] = [wrap(matchable: newChainAsset) { $0 }] - return cuckoo_manager.verify("didReceive(newChainAsset: ChainAsset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceieve(subqueryRewards: M1, period: M2) -> Cuckoo.__DoNotUse<(Result<[SubqueryRewardItemData]?, Error>, AnalyticsPeriod), Void> where M1.MatchedType == Result<[SubqueryRewardItemData]?, Error>, M2.MatchedType == AnalyticsPeriod { - let matchers: [Cuckoo.ParameterMatcher<(Result<[SubqueryRewardItemData]?, Error>, AnalyticsPeriod)>] = [wrap(matchable: subqueryRewards) { $0.0 }, wrap(matchable: period) { $0.1 }] - return cuckoo_manager.verify("didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + @discardableResult - func didReceiveMinNominatorBond(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinNominatorBond(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingRedeemViewModel), Void> where M1.MatchedType == StakingRedeemViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingRedeemViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingRedeemViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveCounterForNominators(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveCounterForNominators(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAmount(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAmount(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveMaxNominatorsCount(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMaxNominatorsCount(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(eraCountdownResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: eraCountdownResult) { $0 }] - return cuckoo_manager.verify("didReceive(eraCountdownResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveMaxNominatorsPerValidator(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMaxNominatorsPerValidator(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveAccount(_ account: M1, for accountId: M2) -> Cuckoo.__DoNotUse<(MetaChainAccountResponse?, AccountId), Void> where M1.OptionalMatchedType == MetaChainAccountResponse, M2.MatchedType == AccountId { - let matchers: [Cuckoo.ParameterMatcher<(MetaChainAccountResponse?, AccountId)>] = [wrap(matchable: account) { $0.0 }, wrap(matchable: accountId) { $0.1 }] - return cuckoo_manager.verify("didReceiveAccount(_: MetaChainAccountResponse?, for: AccountId)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRelaychainInteractorOutputProtocolStub: StakingRelaychainInteractorOutputProtocol { - - - - - + class StakingRedeemViewProtocolStub: StakingRedeemViewProtocol { + - func didReceive(selectedAddress: String) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + - - func didReceive(price: PriceData?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + - - func didReceive(priceError: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + } + - - func didReceive(totalReward: TotalRewardItem) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + } + - - func didReceive(totalRewardError: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + - - func didReceive(accountInfo: AccountInfo?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceive(balanceError: Error) { + func didReceiveConfirmation(viewModel: StakingRedeemViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(calculator: RewardCalculatorEngineProtocol) { + func didReceiveAmount(viewModel: LocalizableResource) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(calculatorError: Error) { + func didReceiveFee(viewModel: LocalizableResource?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(stashItem: StashItem?) { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(stashItemError: Error) { + func didStartLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(ledgerInfo: StakingLedger?) { + func didStopLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockStakingRedeemPresenterProtocol: StakingRedeemPresenterProtocol, Cuckoo.ProtocolMock { + typealias MocksType = StakingRedeemPresenterProtocol - func didReceive(ledgerInfoError: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - + typealias Stubbing = __StubbingProxy_StakingRedeemPresenterProtocol + typealias Verification = __VerificationProxy_StakingRedeemPresenterProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func didReceive(nomination: Nomination?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + private var __defaultImplStub: StakingRedeemPresenterProtocol? + + func enableDefaultImplementation(_ stub: StakingRedeemPresenterProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didReceive(nominationError: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceive(validatorPrefs: ValidatorPrefs?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) + } - func didReceive(validatorError: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func confirm() { + + return cuckoo_manager.call("confirm()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.confirm()) + } - func didReceive(eraStakersInfo: EraStakersInfo) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func selectAccount() { + + return cuckoo_manager.call("selectAccount()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.selectAccount()) + } + + struct __StubbingProxy_StakingRedeemPresenterProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + } + + func selectAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemPresenterProtocol.self, method: "selectAccount()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_StakingRedeemPresenterProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func confirm() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func selectAccount() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class StakingRedeemPresenterProtocolStub: StakingRedeemPresenterProtocol { + - func didReceive(eraStakersInfoError: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceive(networkStakingInfo: NetworkStakingInfo) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(networkStakingInfoError: Error) { + func confirm() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(payee: RewardDestinationArg?) { + func selectAccount() { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockStakingRedeemInteractorInputProtocol: StakingRedeemInteractorInputProtocol, Cuckoo.ProtocolMock { + typealias MocksType = StakingRedeemInteractorInputProtocol - func didReceive(payeeError: Error) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + typealias Stubbing = __StubbingProxy_StakingRedeemInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingRedeemInteractorInputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: StakingRedeemInteractorInputProtocol? + + func enableDefaultImplementation(_ stub: StakingRedeemInteractorInputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didReceive(newChainAsset: ChainAsset) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceieve(subqueryRewards: Result<[SubqueryRewardItemData]?, Error>, period: AnalyticsPeriod) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) + } - func didReceiveMinNominatorBond(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func submitForStash(_ stashAddress: AccountAddress) { + + return cuckoo_manager.call("submitForStash(_: AccountAddress)", + parameters: (stashAddress), + escapingParameters: (stashAddress), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.submitForStash(stashAddress)) + } - func didReceiveCounterForNominators(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func estimateFeeForStash(_ stashAddress: AccountAddress) { + + return cuckoo_manager.call("estimateFeeForStash(_: AccountAddress)", + parameters: (stashAddress), + escapingParameters: (stashAddress), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.estimateFeeForStash(stashAddress)) + } + + struct __StubbingProxy_StakingRedeemInteractorInputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func submitForStash(_ stashAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: stashAddress) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorInputProtocol.self, method: "submitForStash(_: AccountAddress)", parameterMatchers: matchers)) + } + + func estimateFeeForStash(_ stashAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: stashAddress) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorInputProtocol.self, method: "estimateFeeForStash(_: AccountAddress)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_StakingRedeemInteractorInputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func submitForStash(_ stashAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: stashAddress) { $0 }] + return cuckoo_manager.verify("submitForStash(_: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func estimateFeeForStash(_ stashAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: stashAddress) { $0 }] + return cuckoo_manager.verify("estimateFeeForStash(_: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class StakingRedeemInteractorInputProtocolStub: StakingRedeemInteractorInputProtocol { + - func didReceiveMaxNominatorsCount(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceive(eraCountdownResult: Result) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveMaxNominatorsPerValidator(result: Result) { + func submitForStash(_ stashAddress: AccountAddress) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveAccount(_ account: MetaChainAccountResponse?, for accountId: AccountId) { + func estimateFeeForStash(_ stashAddress: AccountAddress) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -41456,19 +40756,19 @@ import Foundation - class MockStakingRelaychainWireframeProtocol: StakingRelaychainWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingRedeemInteractorOutputProtocol: StakingRedeemInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRelaychainWireframeProtocol + typealias MocksType = StakingRedeemInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingRelaychainWireframeProtocol - typealias Verification = __VerificationProxy_StakingRelaychainWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingRedeemInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingRedeemInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRelaychainWireframeProtocol? + private var __defaultImplStub: StakingRedeemInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingRelaychainWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingRedeemInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -41481,246 +40781,141 @@ import Foundation - func showSetupAmount(from view: StakingMainViewProtocol?) { - - return cuckoo_manager.call("showSetupAmount(from: StakingMainViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showSetupAmount(from: view)) - - } - - - - func proceedToSelectValidatorsStart(from view: StakingMainViewProtocol?, existingBonding: ExistingBonding) { - - return cuckoo_manager.call("proceedToSelectValidatorsStart(from: StakingMainViewProtocol?, existingBonding: ExistingBonding)", - parameters: (view, existingBonding), - escapingParameters: (view, existingBonding), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.proceedToSelectValidatorsStart(from: view, existingBonding: existingBonding)) - - } - - - - func showRewardDetails(from view: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal) { - - return cuckoo_manager.call("showRewardDetails(from: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal)", - parameters: (view, maxReward, avgReward), - escapingParameters: (view, maxReward, avgReward), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showRewardDetails(from: view, maxReward: maxReward, avgReward: avgReward)) - - } - - - - func showRewardPayoutsForNominator(from view: ControllerBackedProtocol?, stashAddress: AccountAddress) { - - return cuckoo_manager.call("showRewardPayoutsForNominator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", - parameters: (view, stashAddress), - escapingParameters: (view, stashAddress), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showRewardPayoutsForNominator(from: view, stashAddress: stashAddress)) - - } - - - - func showRewardPayoutsForValidator(from view: ControllerBackedProtocol?, stashAddress: AccountAddress) { - - return cuckoo_manager.call("showRewardPayoutsForValidator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", - parameters: (view, stashAddress), - escapingParameters: (view, stashAddress), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showRewardPayoutsForValidator(from: view, stashAddress: stashAddress)) - - } - - - - func showNominatorValidators(from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("showNominatorValidators(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showNominatorValidators(from: view)) - - } - - - - func showRewardDestination(from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("showRewardDestination(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showRewardDestination(from: view)) - - } - - - - func showControllerAccount(from view: ControllerBackedProtocol?) { + func didReceiveStakingLedger(result: Result) { - return cuckoo_manager.call("showControllerAccount(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showControllerAccount(from: view)) + defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) } - func showBondMore(from view: ControllerBackedProtocol?) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("showBondMore(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showBondMore(from: view)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - func showUnbond(from view: ControllerBackedProtocol?) { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("showUnbond(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showUnbond(from: view)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - func showRedeem(from view: ControllerBackedProtocol?) { + func didReceiveExistentialDeposit(result: Result) { - return cuckoo_manager.call("showRedeem(from: ControllerBackedProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("didReceiveExistentialDeposit(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showRedeem(from: view)) + defaultCall: __defaultImplStub!.didReceiveExistentialDeposit(result: result)) } - func showRebond(from view: ControllerBackedProtocol?, option: StakingRebondOption) { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("showRebond(from: ControllerBackedProtocol?, option: StakingRebondOption)", - parameters: (view, option), - escapingParameters: (view, option), + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showRebond(from: view, option: option)) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - func showAnalytics(from view: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode) { + func didReceiveController(result: Result) { - return cuckoo_manager.call("showAnalytics(from: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode)", - parameters: (view, mode), - escapingParameters: (view, mode), + return cuckoo_manager.call("didReceiveController(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showAnalytics(from: view, mode: mode)) + defaultCall: __defaultImplStub!.didReceiveController(result: result)) } - func showYourValidatorInfo(_ stashAddress: AccountAddress, from view: ControllerBackedProtocol?) { + func didReceiveStashItem(result: Result) { - return cuckoo_manager.call("showYourValidatorInfo(_: AccountAddress, from: ControllerBackedProtocol?)", - parameters: (stashAddress, view), - escapingParameters: (stashAddress, view), + return cuckoo_manager.call("didReceiveStashItem(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showYourValidatorInfo(stashAddress, from: view)) + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func didReceiveActiveEra(result: Result) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("didReceiveActiveEra(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.didReceiveActiveEra(result: result)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didSubmitRedeeming(result: Result) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("didSubmitRedeeming(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.didSubmitRedeeming(result: result)) } - struct __StubbingProxy_StakingRelaychainWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRedeemInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -41728,89 +40923,54 @@ import Foundation } - func showSetupAmount(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainViewProtocol?)> where M1.OptionalMatchedType == StakingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showSetupAmount(from: StakingMainViewProtocol?)", parameterMatchers: matchers)) - } - - func proceedToSelectValidatorsStart(from view: M1, existingBonding: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainViewProtocol?, ExistingBonding)> where M1.OptionalMatchedType == StakingMainViewProtocol, M2.MatchedType == ExistingBonding { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?, ExistingBonding)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: existingBonding) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "proceedToSelectValidatorsStart(from: StakingMainViewProtocol?, existingBonding: ExistingBonding)", parameterMatchers: matchers)) - } - - func showRewardDetails(from view: M1, maxReward: M2, avgReward: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, Decimal, Decimal)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == Decimal, M3.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, Decimal, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: maxReward) { $0.1 }, wrap(matchable: avgReward) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRewardDetails(from: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal)", parameterMatchers: matchers)) - } - - func showRewardPayoutsForNominator(from view: M1, stashAddress: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, AccountAddress)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AccountAddress)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: stashAddress) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRewardPayoutsForNominator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", parameterMatchers: matchers)) - } - - func showRewardPayoutsForValidator(from view: M1, stashAddress: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, AccountAddress)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AccountAddress)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: stashAddress) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRewardPayoutsForValidator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", parameterMatchers: matchers)) - } - - func showNominatorValidators(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showNominatorValidators(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func showRewardDestination(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRewardDestination(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func showControllerAccount(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showControllerAccount(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) } - func showBondMore(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showBondMore(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func showUnbond(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showUnbond(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } - func showRedeem(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?)> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRedeem(from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveExistentialDeposit(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveExistentialDeposit(result: Result)", parameterMatchers: matchers)) } - func showRebond(from view: M1, option: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, StakingRebondOption)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == StakingRebondOption { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, StakingRebondOption)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: option) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showRebond(from: ControllerBackedProtocol?, option: StakingRebondOption)", parameterMatchers: matchers)) + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func showAnalytics(from view: M1, mode: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, AnalyticsContainerViewMode)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AnalyticsContainerViewMode { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AnalyticsContainerViewMode)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: mode) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showAnalytics(from: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode)", parameterMatchers: matchers)) + func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) } - func showYourValidatorInfo(_ stashAddress: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress, ControllerBackedProtocol?)> where M1.MatchedType == AccountAddress, M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress, ControllerBackedProtocol?)>] = [wrap(matchable: stashAddress) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "showYourValidatorInfo(_: AccountAddress, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveActiveEra(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveActiveEra(result: Result)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRelaychainWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didSubmitRedeeming(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didSubmitRedeeming(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRelaychainWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRedeemInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -41825,87 +40985,238 @@ import Foundation @discardableResult - func showSetupAmount(from view: M1) -> Cuckoo.__DoNotUse<(StakingMainViewProtocol?), Void> where M1.OptionalMatchedType == StakingMainViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showSetupAmount(from: StakingMainViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceedToSelectValidatorsStart(from view: M1, existingBonding: M2) -> Cuckoo.__DoNotUse<(StakingMainViewProtocol?, ExistingBonding), Void> where M1.OptionalMatchedType == StakingMainViewProtocol, M2.MatchedType == ExistingBonding { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?, ExistingBonding)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: existingBonding) { $0.1 }] - return cuckoo_manager.verify("proceedToSelectValidatorsStart(from: StakingMainViewProtocol?, existingBonding: ExistingBonding)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showRewardDetails(from view: M1, maxReward: M2, avgReward: M3) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, Decimal, Decimal), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == Decimal, M3.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, Decimal, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: maxReward) { $0.1 }, wrap(matchable: avgReward) { $0.2 }] - return cuckoo_manager.verify("showRewardDetails(from: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showRewardPayoutsForNominator(from view: M1, stashAddress: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, AccountAddress), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AccountAddress)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: stashAddress) { $0.1 }] - return cuckoo_manager.verify("showRewardPayoutsForNominator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveExistentialDeposit(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveExistentialDeposit(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showRewardPayoutsForValidator(from view: M1, stashAddress: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, AccountAddress), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AccountAddress)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: stashAddress) { $0.1 }] - return cuckoo_manager.verify("showRewardPayoutsForValidator(from: ControllerBackedProtocol?, stashAddress: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showNominatorValidators(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showNominatorValidators(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showRewardDestination(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showRewardDestination(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showControllerAccount(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showControllerAccount(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveActiveEra(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveActiveEra(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showBondMore(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showBondMore(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didSubmitRedeeming(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didSubmitRedeeming(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - @discardableResult - func showUnbond(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showUnbond(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } +} + + class StakingRedeemInteractorOutputProtocolStub: StakingRedeemInteractorOutputProtocol { + + + + + + + + func didReceiveStakingLedger(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveAccountInfo(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceivePriceData(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveExistentialDeposit(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveFee(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveController(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveStashItem(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveActiveEra(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didSubmitRedeeming(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + + class MockStakingRedeemWireframeProtocol: StakingRedeemWireframeProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = StakingRedeemWireframeProtocol + + typealias Stubbing = __StubbingProxy_StakingRedeemWireframeProtocol + typealias Verification = __VerificationProxy_StakingRedeemWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: StakingRedeemWireframeProtocol? + + func enableDefaultImplementation(_ stub: StakingRedeemWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + + + + + func complete(from view: StakingRedeemViewProtocol?) { + + return cuckoo_manager.call("complete(from: StakingRedeemViewProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.complete(from: view)) + + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + + } + + + struct __StubbingProxy_StakingRedeemWireframeProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRedeemViewProtocol?)> where M1.OptionalMatchedType == StakingRedeemViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingRedeemViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemWireframeProtocol.self, method: "complete(from: StakingRedeemViewProtocol?)", parameterMatchers: matchers)) } - @discardableResult - func showRedeem(from view: M1) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("showRedeem(from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - @discardableResult - func showRebond(from view: M1, option: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, StakingRebondOption), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == StakingRebondOption { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, StakingRebondOption)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: option) { $0.1 }] - return cuckoo_manager.verify("showRebond(from: ControllerBackedProtocol?, option: StakingRebondOption)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - @discardableResult - func showAnalytics(from view: M1, mode: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, AnalyticsContainerViewMode), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AnalyticsContainerViewMode { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AnalyticsContainerViewMode)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: mode) { $0.1 }] - return cuckoo_manager.verify("showAnalytics(from: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + struct __VerificationProxy_StakingRedeemWireframeProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation } + + + @discardableResult - func showYourValidatorInfo(_ stashAddress: M1, from view: M2) -> Cuckoo.__DoNotUse<(AccountAddress, ControllerBackedProtocol?), Void> where M1.MatchedType == AccountAddress, M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress, ControllerBackedProtocol?)>] = [wrap(matchable: stashAddress) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("showYourValidatorInfo(_: AccountAddress, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingRedeemViewProtocol?), Void> where M1.OptionalMatchedType == StakingRedeemViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingRedeemViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(from: StakingRedeemViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -41923,7 +41234,7 @@ import Foundation } } - class StakingRelaychainWireframeProtocolStub: StakingRelaychainWireframeProtocol { + class StakingRedeemWireframeProtocolStub: StakingRedeemWireframeProtocol { @@ -41931,85 +41242,7 @@ import Foundation - func showSetupAmount(from view: StakingMainViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func proceedToSelectValidatorsStart(from view: StakingMainViewProtocol?, existingBonding: ExistingBonding) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showRewardDetails(from view: ControllerBackedProtocol?, maxReward: Decimal, avgReward: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showRewardPayoutsForNominator(from view: ControllerBackedProtocol?, stashAddress: AccountAddress) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showRewardPayoutsForValidator(from view: ControllerBackedProtocol?, stashAddress: AccountAddress) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showNominatorValidators(from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showRewardDestination(from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showControllerAccount(from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showBondMore(from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showUnbond(from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showRedeem(from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showRebond(from view: ControllerBackedProtocol?, option: StakingRebondOption) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showAnalytics(from view: ControllerBackedProtocol?, mode: AnalyticsContainerViewMode) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showYourValidatorInfo(_ stashAddress: AccountAddress, from view: ControllerBackedProtocol?) { + func complete(from view: StakingRedeemViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -42031,25 +41264,22 @@ import Foundation import Cuckoo @testable import novawallet -import BigInt -import CommonWallet -import Foundation import SoraFoundation - class MockStakingMainViewProtocol: StakingMainViewProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDestConfirmViewProtocol: StakingRewardDestConfirmViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingMainViewProtocol + typealias MocksType = StakingRewardDestConfirmViewProtocol - typealias Stubbing = __StubbingProxy_StakingMainViewProtocol - typealias Verification = __VerificationProxy_StakingMainViewProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmViewProtocol + typealias Verification = __VerificationProxy_StakingRewardDestConfirmViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingMainViewProtocol? + private var __defaultImplStub: StakingRewardDestConfirmViewProtocol? - func enableDefaultImplementation(_ stub: StakingMainViewProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDestConfirmViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -42108,102 +41338,115 @@ import SoraFoundation } - - + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } + + } - func didReceive(viewModel: StakingMainViewModel) { - - return cuckoo_manager.call("didReceive(viewModel: StakingMainViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceive(viewModel: viewModel)) + + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } } + + + + - func didRecieveNetworkStakingInfo(viewModel: LocalizableResource?) { + func didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel) { - return cuckoo_manager.call("didRecieveNetworkStakingInfo(viewModel: LocalizableResource?)", + return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didRecieveNetworkStakingInfo(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) } - func didReceiveStakingState(viewModel: StakingViewState) { + func didReceiveFee(viewModel: LocalizableResource?) { - return cuckoo_manager.call("didReceiveStakingState(viewModel: StakingViewState)", + return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", parameters: (viewModel), escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStakingState(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) } - func expandNetworkInfoView(_ isExpanded: Bool) { + public func applyLocalization() { - return cuckoo_manager.call("expandNetworkInfoView(_: Bool)", - parameters: (isExpanded), - escapingParameters: (isExpanded), + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.expandNetworkInfoView(isExpanded)) + defaultCall: __defaultImplStub!.applyLocalization()) } - func didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol) { + func didStartLoading() { - return cuckoo_manager.call("didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStatics(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didStartLoading()) } - public func applyLocalization() { + func didStopLoading() { - return cuckoo_manager.call("applyLocalization()", + return cuckoo_manager.call("didStopLoading()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.didStopLoading()) } - struct __StubbingProxy_StakingMainViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDestConfirmViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -42211,54 +41454,59 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func didReceive(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainViewModel)> where M1.MatchedType == StakingMainViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "didReceive(viewModel: StakingMainViewModel)", parameterMatchers: matchers)) + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") } - func didRecieveNetworkStakingInfo(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "didRecieveNetworkStakingInfo(viewModel: LocalizableResource?)", parameterMatchers: matchers)) - } - func didReceiveStakingState(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingViewState)> where M1.MatchedType == StakingViewState { - let matchers: [Cuckoo.ParameterMatcher<(StakingViewState)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "didReceiveStakingState(viewModel: StakingViewState)", parameterMatchers: matchers)) + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") } - func expandNetworkInfoView(_ isExpanded: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "expandNetworkInfoView(_: Bool)", parameterMatchers: matchers)) + + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRewardDestConfirmViewModel)> where M1.MatchedType == StakingRewardDestConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel)", parameterMatchers: matchers)) } - func didReceiveStatics(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainStaticViewModelProtocol)> where M1.MatchedType == StakingMainStaticViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainStaticViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol)", parameterMatchers: matchers)) + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + } + + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingMainViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDestConfirmViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -42285,48 +41533,52 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } - - @discardableResult - func didReceive(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingMainViewModel), Void> where M1.MatchedType == StakingMainViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceive(viewModel: StakingMainViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + @discardableResult - func didRecieveNetworkStakingInfo(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didRecieveNetworkStakingInfo(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingRewardDestConfirmViewModel), Void> where M1.MatchedType == StakingRewardDestConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStakingState(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingViewState), Void> where M1.MatchedType == StakingViewState { - let matchers: [Cuckoo.ParameterMatcher<(StakingViewState)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveStakingState(viewModel: StakingViewState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func expandNetworkInfoView(_ isExpanded: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] - return cuckoo_manager.verify("expandNetworkInfoView(_: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStatics(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingMainStaticViewModelProtocol), Void> where M1.MatchedType == StakingMainStaticViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainStaticViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingMainViewProtocolStub: StakingMainViewProtocol { + class StakingRewardDestConfirmViewProtocolStub: StakingRewardDestConfirmViewProtocol { @@ -42356,44 +41608,245 @@ import SoraFoundation set { } } + + + + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + + + + + func didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveFee(viewModel: LocalizableResource?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + public func applyLocalization() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStartLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStopLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + + class MockStakingRewardDestConfirmPresenterProtocol: StakingRewardDestConfirmPresenterProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = StakingRewardDestConfirmPresenterProtocol + + typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmPresenterProtocol + typealias Verification = __VerificationProxy_StakingRewardDestConfirmPresenterProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: StakingRewardDestConfirmPresenterProtocol? + + func enableDefaultImplementation(_ stub: StakingRewardDestConfirmPresenterProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + + + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) + + } + + + + func confirm() { + + return cuckoo_manager.call("confirm()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.confirm()) + + } + + + + func presentSenderAccountOptions() { + + return cuckoo_manager.call("presentSenderAccountOptions()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentSenderAccountOptions()) + + } + + + + func presentPayoutAccountOptions() { + + return cuckoo_manager.call("presentPayoutAccountOptions()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentPayoutAccountOptions()) + + } + struct __StubbingProxy_StakingRewardDestConfirmPresenterProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + } + + func presentSenderAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmPresenterProtocol.self, method: "presentSenderAccountOptions()", parameterMatchers: matchers)) + } + + func presentPayoutAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmPresenterProtocol.self, method: "presentPayoutAccountOptions()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_StakingRewardDestConfirmPresenterProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func confirm() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentSenderAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentSenderAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentPayoutAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentPayoutAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class StakingRewardDestConfirmPresenterProtocolStub: StakingRewardDestConfirmPresenterProtocol { - - - func didReceive(viewModel: StakingMainViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didRecieveNetworkStakingInfo(viewModel: LocalizableResource?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func didReceiveStakingState(viewModel: StakingViewState) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func expandNetworkInfoView(_ isExpanded: Bool) { + func confirm() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStatics(viewModel: StakingMainStaticViewModelProtocol) { + func presentSenderAccountOptions() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func presentPayoutAccountOptions() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -42401,19 +41854,19 @@ import SoraFoundation - class MockStakingMainPresenterProtocol: StakingMainPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDestConfirmInteractorInputProtocol: StakingRewardDestConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingMainPresenterProtocol + typealias MocksType = StakingRewardDestConfirmInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingMainPresenterProtocol - typealias Verification = __VerificationProxy_StakingMainPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingRewardDestConfirmInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingMainPresenterProtocol? + private var __defaultImplStub: StakingRewardDestConfirmInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingMainPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDestConfirmInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -42441,186 +41894,238 @@ import SoraFoundation - func performAssetSelection() { + func estimateFee(for rewardDestination: RewardDestination, stashItem: StashItem) { - return cuckoo_manager.call("performAssetSelection()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("estimateFee(for: RewardDestination, stashItem: StashItem)", + parameters: (rewardDestination, stashItem), + escapingParameters: (rewardDestination, stashItem), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performAssetSelection()) + defaultCall: __defaultImplStub!.estimateFee(for: rewardDestination, stashItem: stashItem)) } - func performMainAction() { + func submit(rewardDestination: RewardDestination, for stashItem: StashItem) { - return cuckoo_manager.call("performMainAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("submit(rewardDestination: RewardDestination, for: StashItem)", + parameters: (rewardDestination, stashItem), + escapingParameters: (rewardDestination, stashItem), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performMainAction()) + defaultCall: __defaultImplStub!.submit(rewardDestination: rewardDestination, for: stashItem)) } + + struct __StubbingProxy_StakingRewardDestConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func estimateFee(for rewardDestination: M1, stashItem: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(RewardDestination, StashItem)> where M1.MatchedType == RewardDestination, M2.MatchedType == StashItem { + let matchers: [Cuckoo.ParameterMatcher<(RewardDestination, StashItem)>] = [wrap(matchable: rewardDestination) { $0.0 }, wrap(matchable: stashItem) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorInputProtocol.self, method: "estimateFee(for: RewardDestination, stashItem: StashItem)", parameterMatchers: matchers)) + } + + func submit(rewardDestination: M1, for stashItem: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(RewardDestination, StashItem)> where M1.MatchedType == RewardDestination, M2.MatchedType == StashItem { + let matchers: [Cuckoo.ParameterMatcher<(RewardDestination, StashItem)>] = [wrap(matchable: rewardDestination) { $0.0 }, wrap(matchable: stashItem) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorInputProtocol.self, method: "submit(rewardDestination: RewardDestination, for: StashItem)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_StakingRewardDestConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func estimateFee(for rewardDestination: M1, stashItem: M2) -> Cuckoo.__DoNotUse<(RewardDestination, StashItem), Void> where M1.MatchedType == RewardDestination, M2.MatchedType == StashItem { + let matchers: [Cuckoo.ParameterMatcher<(RewardDestination, StashItem)>] = [wrap(matchable: rewardDestination) { $0.0 }, wrap(matchable: stashItem) { $0.1 }] + return cuckoo_manager.verify("estimateFee(for: RewardDestination, stashItem: StashItem)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func submit(rewardDestination: M1, for stashItem: M2) -> Cuckoo.__DoNotUse<(RewardDestination, StashItem), Void> where M1.MatchedType == RewardDestination, M2.MatchedType == StashItem { + let matchers: [Cuckoo.ParameterMatcher<(RewardDestination, StashItem)>] = [wrap(matchable: rewardDestination) { $0.0 }, wrap(matchable: stashItem) { $0.1 }] + return cuckoo_manager.verify("submit(rewardDestination: RewardDestination, for: StashItem)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class StakingRewardDestConfirmInteractorInputProtocolStub: StakingRewardDestConfirmInteractorInputProtocol { + - func performAccountAction() { - - return cuckoo_manager.call("performAccountAction()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.performAccountAction()) - + + + + + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performRewardInfoAction() { - - return cuckoo_manager.call("performRewardInfoAction()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.performRewardInfoAction()) - + func estimateFee(for rewardDestination: RewardDestination, stashItem: StashItem) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performChangeValidatorsAction() { - - return cuckoo_manager.call("performChangeValidatorsAction()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.performChangeValidatorsAction()) - + func submit(rewardDestination: RewardDestination, for stashItem: StashItem) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockStakingRewardDestConfirmInteractorOutputProtocol: StakingRewardDestConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { + typealias MocksType = StakingRewardDestConfirmInteractorOutputProtocol - func performSetupValidatorsForBondedAction() { - - return cuckoo_manager.call("performSetupValidatorsForBondedAction()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.performSetupValidatorsForBondedAction()) - + typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingRewardDestConfirmInteractorOutputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: StakingRewardDestConfirmInteractorOutputProtocol? + + func enableDefaultImplementation(_ stub: StakingRewardDestConfirmInteractorOutputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + + + - func performStakeMoreAction() { + + + func didReceiveFee(result: Result) { - return cuckoo_manager.call("performStakeMoreAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performStakeMoreAction()) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - func performRedeemAction() { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("performRedeemAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performRedeemAction()) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - func performRebondAction() { + func didReceiveStashItem(result: Result) { - return cuckoo_manager.call("performRebondAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStashItem(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performRebondAction()) + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) } - func performAnalyticsAction() { + func didReceiveController(result: Result) { - return cuckoo_manager.call("performAnalyticsAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveController(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performAnalyticsAction()) + defaultCall: __defaultImplStub!.didReceiveController(result: result)) } - func networkInfoViewDidChangeExpansion(isExpanded: Bool) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("networkInfoViewDidChangeExpansion(isExpanded: Bool)", - parameters: (isExpanded), - escapingParameters: (isExpanded), + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.networkInfoViewDidChangeExpansion(isExpanded: isExpanded)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - func performManageAction(_ action: StakingManageOption) { + func didSubmitRewardDest(result: Result) { - return cuckoo_manager.call("performManageAction(_: StakingManageOption)", - parameters: (action), - escapingParameters: (action), + return cuckoo_manager.call("didSubmitRewardDest(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performManageAction(action)) + defaultCall: __defaultImplStub!.didSubmitRewardDest(result: result)) } - struct __StubbingProxy_StakingMainPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDestConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -42628,74 +42133,39 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func performAssetSelection() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performAssetSelection()", parameterMatchers: matchers)) - } - - func performMainAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performMainAction()", parameterMatchers: matchers)) - } - - func performAccountAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performAccountAction()", parameterMatchers: matchers)) - } - - func performRewardInfoAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performRewardInfoAction()", parameterMatchers: matchers)) - } - - func performChangeValidatorsAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performChangeValidatorsAction()", parameterMatchers: matchers)) - } - - func performSetupValidatorsForBondedAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performSetupValidatorsForBondedAction()", parameterMatchers: matchers)) - } - - func performStakeMoreAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performStakeMoreAction()", parameterMatchers: matchers)) + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func performRedeemAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performRedeemAction()", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } - func performRebondAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performRebondAction()", parameterMatchers: matchers)) + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) } - func performAnalyticsAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performAnalyticsAction()", parameterMatchers: matchers)) + func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) } - func networkInfoViewDidChangeExpansion(isExpanded: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "networkInfoViewDidChangeExpansion(isExpanded: Bool)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func performManageAction(_ action: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingManageOption)> where M1.MatchedType == StakingManageOption { - let matchers: [Cuckoo.ParameterMatcher<(StakingManageOption)>] = [wrap(matchable: action) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainPresenterProtocol.self, method: "performManageAction(_: StakingManageOption)", parameterMatchers: matchers)) + func didSubmitRewardDest(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didSubmitRewardDest(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingMainPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDestConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -42710,87 +42180,220 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performAssetSelection() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performAssetSelection()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performMainAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performMainAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performAccountAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performAccountAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performRewardInfoAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performRewardInfoAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performChangeValidatorsAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performChangeValidatorsAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didSubmitRewardDest(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didSubmitRewardDest(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - @discardableResult - func performSetupValidatorsForBondedAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performSetupValidatorsForBondedAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } +} + + class StakingRewardDestConfirmInteractorOutputProtocolStub: StakingRewardDestConfirmInteractorOutputProtocol { + + + + + + + + func didReceiveFee(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceivePriceData(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveStashItem(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveController(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveAccountInfo(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didSubmitRewardDest(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + + class MockStakingRewardDestConfirmWireframeProtocol: StakingRewardDestConfirmWireframeProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = StakingRewardDestConfirmWireframeProtocol + + typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmWireframeProtocol + typealias Verification = __VerificationProxy_StakingRewardDestConfirmWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: StakingRewardDestConfirmWireframeProtocol? + + func enableDefaultImplementation(_ stub: StakingRewardDestConfirmWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + + + + + func complete(from view: StakingRewardDestConfirmViewProtocol?) { + + return cuckoo_manager.call("complete(from: StakingRewardDestConfirmViewProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.complete(from: view)) + + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + + } + + + struct __StubbingProxy_StakingRewardDestConfirmWireframeProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager } - @discardableResult - func performStakeMoreAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performStakeMoreAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRewardDestConfirmViewProtocol?)> where M1.OptionalMatchedType == StakingRewardDestConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmWireframeProtocol.self, method: "complete(from: StakingRewardDestConfirmViewProtocol?)", parameterMatchers: matchers)) } - @discardableResult - func performRedeemAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performRedeemAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - @discardableResult - func performRebondAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performRebondAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + struct __VerificationProxy_StakingRewardDestConfirmWireframeProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation } + + + @discardableResult - func performAnalyticsAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performAnalyticsAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingRewardDestConfirmViewProtocol?), Void> where M1.OptionalMatchedType == StakingRewardDestConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(from: StakingRewardDestConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func networkInfoViewDidChangeExpansion(isExpanded: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] - return cuckoo_manager.verify("networkInfoViewDidChangeExpansion(isExpanded: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performManageAction(_ action: M1) -> Cuckoo.__DoNotUse<(StakingManageOption), Void> where M1.MatchedType == StakingManageOption { - let matchers: [Cuckoo.ParameterMatcher<(StakingManageOption)>] = [wrap(matchable: action) { $0 }] - return cuckoo_manager.verify("performManageAction(_: StakingManageOption)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingMainPresenterProtocolStub: StakingMainPresenterProtocol { + class StakingRewardDestConfirmWireframeProtocolStub: StakingRewardDestConfirmWireframeProtocol { @@ -42798,156 +42401,169 @@ import SoraFoundation - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func performAssetSelection() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func performMainAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func performAccountAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func performRewardInfoAction() { + func complete(from view: StakingRewardDestConfirmViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performChangeValidatorsAction() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performSetupValidatorsForBondedAction() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + +import Cuckoo +@testable import novawallet + +import Foundation +import SoraFoundation + + + class MockStakingRewardDestSetupViewProtocol: StakingRewardDestSetupViewProtocol, Cuckoo.ProtocolMock { + typealias MocksType = StakingRewardDestSetupViewProtocol - func performStakeMoreAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - + typealias Stubbing = __StubbingProxy_StakingRewardDestSetupViewProtocol + typealias Verification = __VerificationProxy_StakingRewardDestSetupViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func performRedeemAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + private var __defaultImplStub: StakingRewardDestSetupViewProtocol? + + func enableDefaultImplementation(_ stub: StakingRewardDestSetupViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } - - - func performRebondAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func performAnalyticsAction() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + } - func networkInfoViewDidChangeExpansion(isExpanded: Bool) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + } - func performManageAction(_ action: StakingManageOption) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + } -} - - - - class MockStakingMainInteractorInputProtocol: StakingMainInteractorInputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingMainInteractorInputProtocol - - typealias Stubbing = __StubbingProxy_StakingMainInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingMainInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingMainInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingMainInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - + func didReceiveFee(viewModel: LocalizableResource?) { + + return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) + + } - func setup() { + func didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceiveRewardDestination(viewModel: viewModel)) } - func saveNetworkInfoViewExpansion(isExpanded: Bool) { + func didCompletionAccountSelection() { - return cuckoo_manager.call("saveNetworkInfoViewExpansion(isExpanded: Bool)", - parameters: (isExpanded), - escapingParameters: (isExpanded), + return cuckoo_manager.call("didCompletionAccountSelection()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.saveNetworkInfoViewExpansion(isExpanded: isExpanded)) + defaultCall: __defaultImplStub!.didCompletionAccountSelection()) } - func save(chainAsset: ChainAsset) { + public func applyLocalization() { - return cuckoo_manager.call("save(chainAsset: ChainAsset)", - parameters: (chainAsset), - escapingParameters: (chainAsset), + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.save(chainAsset: chainAsset)) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_StakingMainInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDestSetupViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -42955,24 +42571,44 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func saveNetworkInfoViewExpansion(isExpanded: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorInputProtocol.self, method: "saveNetworkInfoViewExpansion(isExpanded: Bool)", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func save(chainAsset: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainAsset)> where M1.MatchedType == ChainAsset { - let matchers: [Cuckoo.ParameterMatcher<(ChainAsset)>] = [wrap(matchable: chainAsset) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorInputProtocol.self, method: "save(chainAsset: ChainAsset)", parameterMatchers: matchers)) + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") + } + + + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + } + + func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChangeRewardDestinationViewModel?)> where M1.OptionalMatchedType == ChangeRewardDestinationViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ChangeRewardDestinationViewModel?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupViewProtocol.self, method: "didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?)", parameterMatchers: matchers)) + } + + func didCompletionAccountSelection() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupViewProtocol.self, method: "didCompletionAccountSelection()", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingMainInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDestSetupViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -42984,30 +42620,80 @@ import SoraFoundation } + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func saveNetworkInfoViewExpansion(isExpanded: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] - return cuckoo_manager.verify("saveNetworkInfoViewExpansion(isExpanded: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.__DoNotUse<(ChangeRewardDestinationViewModel?), Void> where M1.OptionalMatchedType == ChangeRewardDestinationViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ChangeRewardDestinationViewModel?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func save(chainAsset: M1) -> Cuckoo.__DoNotUse<(ChainAsset), Void> where M1.MatchedType == ChainAsset { - let matchers: [Cuckoo.ParameterMatcher<(ChainAsset)>] = [wrap(matchable: chainAsset) { $0 }] - return cuckoo_manager.verify("save(chainAsset: ChainAsset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didCompletionAccountSelection() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didCompletionAccountSelection()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingMainInteractorInputProtocolStub: StakingMainInteractorInputProtocol { + class StakingRewardDestSetupViewProtocolStub: StakingRewardDestSetupViewProtocol { + + + + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } @@ -43015,19 +42701,25 @@ import SoraFoundation - func setup() { + func didReceiveFee(viewModel: LocalizableResource?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func saveNetworkInfoViewExpansion(isExpanded: Bool) { + func didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func save(chainAsset: ChainAsset) { + func didCompletionAccountSelection() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -43035,19 +42727,19 @@ import SoraFoundation - class MockStakingMainInteractorOutputProtocol: StakingMainInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDestSetupPresenterProtocol: StakingRewardDestSetupPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingMainInteractorOutputProtocol + typealias MocksType = StakingRewardDestSetupPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingMainInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingMainInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDestSetupPresenterProtocol + typealias Verification = __VerificationProxy_StakingRewardDestSetupPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingMainInteractorOutputProtocol? + private var __defaultImplStub: StakingRewardDestSetupPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingMainInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDestSetupPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -43060,81 +42752,96 @@ import SoraFoundation - func didReceiveAccountInfo(_ accountInfo: AccountInfo?) { + func setup() { - return cuckoo_manager.call("didReceiveAccountInfo(_: AccountInfo?)", - parameters: (accountInfo), - escapingParameters: (accountInfo), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(accountInfo)) + defaultCall: __defaultImplStub!.setup()) } - func didReceiveSelectedAccount(_ metaAccount: MetaAccountModel) { + func selectRestakeDestination() { - return cuckoo_manager.call("didReceiveSelectedAccount(_: MetaAccountModel)", - parameters: (metaAccount), - escapingParameters: (metaAccount), + return cuckoo_manager.call("selectRestakeDestination()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveSelectedAccount(metaAccount)) + defaultCall: __defaultImplStub!.selectRestakeDestination()) } - func didReceiveStakingSettings(_ stakingSettings: StakingAssetSettings) { + func selectPayoutDestination() { - return cuckoo_manager.call("didReceiveStakingSettings(_: StakingAssetSettings)", - parameters: (stakingSettings), - escapingParameters: (stakingSettings), + return cuckoo_manager.call("selectPayoutDestination()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStakingSettings(stakingSettings)) + defaultCall: __defaultImplStub!.selectPayoutDestination()) } - func didReceiveExpansion(_ isExpanded: Bool) { + func selectPayoutAccount() { - return cuckoo_manager.call("didReceiveExpansion(_: Bool)", - parameters: (isExpanded), - escapingParameters: (isExpanded), + return cuckoo_manager.call("selectPayoutAccount()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveExpansion(isExpanded)) + defaultCall: __defaultImplStub!.selectPayoutAccount()) } - func didReceiveError(_ error: Error) { + func displayLearnMore() { - return cuckoo_manager.call("didReceiveError(_: Error)", - parameters: (error), - escapingParameters: (error), + return cuckoo_manager.call("displayLearnMore()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveError(error)) + defaultCall: __defaultImplStub!.displayLearnMore()) + + } + + + + func proceed() { + + return cuckoo_manager.call("proceed()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.proceed()) } - struct __StubbingProxy_StakingMainInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDestSetupPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -43142,34 +42849,39 @@ import SoraFoundation } - func didReceiveAccountInfo(_ accountInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountInfo?)> where M1.OptionalMatchedType == AccountInfo { - let matchers: [Cuckoo.ParameterMatcher<(AccountInfo?)>] = [wrap(matchable: accountInfo) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveAccountInfo(_: AccountInfo?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func didReceiveSelectedAccount(_ metaAccount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaAccountModel)> where M1.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: metaAccount) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveSelectedAccount(_: MetaAccountModel)", parameterMatchers: matchers)) + func selectRestakeDestination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "selectRestakeDestination()", parameterMatchers: matchers)) } - func didReceiveStakingSettings(_ stakingSettings: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingAssetSettings)> where M1.MatchedType == StakingAssetSettings { - let matchers: [Cuckoo.ParameterMatcher<(StakingAssetSettings)>] = [wrap(matchable: stakingSettings) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveStakingSettings(_: StakingAssetSettings)", parameterMatchers: matchers)) + func selectPayoutDestination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "selectPayoutDestination()", parameterMatchers: matchers)) } - func didReceiveExpansion(_ isExpanded: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveExpansion(_: Bool)", parameterMatchers: matchers)) + func selectPayoutAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "selectPayoutAccount()", parameterMatchers: matchers)) } - func didReceiveError(_ error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainInteractorOutputProtocol.self, method: "didReceiveError(_: Error)", parameterMatchers: matchers)) + func displayLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "displayLearnMore()", parameterMatchers: matchers)) + } + + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingMainInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDestSetupPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -43184,39 +42896,45 @@ import SoraFoundation @discardableResult - func didReceiveAccountInfo(_ accountInfo: M1) -> Cuckoo.__DoNotUse<(AccountInfo?), Void> where M1.OptionalMatchedType == AccountInfo { - let matchers: [Cuckoo.ParameterMatcher<(AccountInfo?)>] = [wrap(matchable: accountInfo) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(_: AccountInfo?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveSelectedAccount(_ metaAccount: M1) -> Cuckoo.__DoNotUse<(MetaAccountModel), Void> where M1.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(MetaAccountModel)>] = [wrap(matchable: metaAccount) { $0 }] - return cuckoo_manager.verify("didReceiveSelectedAccount(_: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectRestakeDestination() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectRestakeDestination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStakingSettings(_ stakingSettings: M1) -> Cuckoo.__DoNotUse<(StakingAssetSettings), Void> where M1.MatchedType == StakingAssetSettings { - let matchers: [Cuckoo.ParameterMatcher<(StakingAssetSettings)>] = [wrap(matchable: stakingSettings) { $0 }] - return cuckoo_manager.verify("didReceiveStakingSettings(_: StakingAssetSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectPayoutDestination() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectPayoutDestination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveExpansion(_ isExpanded: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: isExpanded) { $0 }] - return cuckoo_manager.verify("didReceiveExpansion(_: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectPayoutAccount() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectPayoutAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveError(_ error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return cuckoo_manager.verify("didReceiveError(_: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func displayLearnMore() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("displayLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingMainInteractorOutputProtocolStub: StakingMainInteractorOutputProtocol { + class StakingRewardDestSetupPresenterProtocolStub: StakingRewardDestSetupPresenterProtocol { @@ -43224,31 +42942,37 @@ import SoraFoundation - func didReceiveAccountInfo(_ accountInfo: AccountInfo?) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveSelectedAccount(_ metaAccount: MetaAccountModel) { + func selectRestakeDestination() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStakingSettings(_ stakingSettings: StakingAssetSettings) { + func selectPayoutDestination() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveExpansion(_ isExpanded: Bool) { + func selectPayoutAccount() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveError(_ error: Error) { + func displayLearnMore() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func proceed() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -43256,19 +42980,19 @@ import SoraFoundation - class MockStakingMainWireframeProtocol: StakingMainWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDestSetupInteractorInputProtocol: StakingRewardDestSetupInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingMainWireframeProtocol + typealias MocksType = StakingRewardDestSetupInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingMainWireframeProtocol - typealias Verification = __VerificationProxy_StakingMainWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDestSetupInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingRewardDestSetupInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingMainWireframeProtocol? + private var __defaultImplStub: StakingRewardDestSetupInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingMainWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDestSetupInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -43281,66 +43005,51 @@ import SoraFoundation - func showChainAssetSelection(from view: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate) { - - return cuckoo_manager.call("showChainAssetSelection(from: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate)", - parameters: (view, selectedChainAssetId, delegate), - escapingParameters: (view, selectedChainAssetId, delegate), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.showChainAssetSelection(from: view, selectedChainAssetId: selectedChainAssetId, delegate: delegate)) - - } - - - - func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { + func setup() { - return cuckoo_manager.call("showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", - parameters: (view, wallet), - escapingParameters: (view, wallet), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWalletDetails(from: view, wallet: wallet)) + defaultCall: __defaultImplStub!.setup()) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func estimateFee() { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("estimateFee()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.estimateFee()) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func fetchPayoutAccounts() { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("fetchPayoutAccounts()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.fetchPayoutAccounts()) } - struct __StubbingProxy_StakingMainWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDestSetupInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -43348,29 +43057,24 @@ import SoraFoundation } - func showChainAssetSelection(from view: M1, selectedChainAssetId: M2, delegate: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingMainViewProtocol?, ChainAssetId?, AssetSelectionDelegate)> where M1.OptionalMatchedType == StakingMainViewProtocol, M2.OptionalMatchedType == ChainAssetId, M3.MatchedType == AssetSelectionDelegate { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?, ChainAssetId?, AssetSelectionDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: selectedChainAssetId) { $0.1 }, wrap(matchable: delegate) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainWireframeProtocol.self, method: "showChainAssetSelection(from: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate)", parameterMatchers: matchers)) - } - - func showWalletDetails(from view: M1, wallet: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, MetaAccountModel)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaAccountModel)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: wallet) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainWireframeProtocol.self, method: "showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func fetchPayoutAccounts() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorInputProtocol.self, method: "fetchPayoutAccounts()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingMainWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDestSetupInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -43385,33 +43089,27 @@ import SoraFoundation @discardableResult - func showChainAssetSelection(from view: M1, selectedChainAssetId: M2, delegate: M3) -> Cuckoo.__DoNotUse<(StakingMainViewProtocol?, ChainAssetId?, AssetSelectionDelegate), Void> where M1.OptionalMatchedType == StakingMainViewProtocol, M2.OptionalMatchedType == ChainAssetId, M3.MatchedType == AssetSelectionDelegate { - let matchers: [Cuckoo.ParameterMatcher<(StakingMainViewProtocol?, ChainAssetId?, AssetSelectionDelegate)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: selectedChainAssetId) { $0.1 }, wrap(matchable: delegate) { $0.2 }] - return cuckoo_manager.verify("showChainAssetSelection(from: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func showWalletDetails(from view: M1, wallet: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, MetaAccountModel), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaAccountModel { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaAccountModel)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: wallet) { $0.1 }] - return cuckoo_manager.verify("showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func fetchPayoutAccounts() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("fetchPayoutAccounts()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingMainWireframeProtocolStub: StakingMainWireframeProtocol { + class StakingRewardDestSetupInteractorInputProtocolStub: StakingRewardDestSetupInteractorInputProtocol { @@ -43419,25 +43117,19 @@ import SoraFoundation - func showChainAssetSelection(from view: StakingMainViewProtocol?, selectedChainAssetId: ChainAssetId?, delegate: AssetSelectionDelegate) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func estimateFee() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func fetchPayoutAccounts() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -43445,19 +43137,19 @@ import SoraFoundation - class MockStakingMainChildPresenterProtocol: StakingMainChildPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDestSetupInteractorOutputProtocol: StakingRewardDestSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingMainChildPresenterProtocol + typealias MocksType = StakingRewardDestSetupInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingMainChildPresenterProtocol - typealias Verification = __VerificationProxy_StakingMainChildPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDestSetupInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingRewardDestSetupInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingMainChildPresenterProtocol? + private var __defaultImplStub: StakingRewardDestSetupInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingMainChildPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDestSetupInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -43470,156 +43162,186 @@ import SoraFoundation - func setup() { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - func performMainAction() { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("performMainAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performMainAction()) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - func performRewardInfoAction() { + func didReceiveStashItem(result: Result) { - return cuckoo_manager.call("performRewardInfoAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStashItem(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performRewardInfoAction()) + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) } - func performChangeValidatorsAction() { + func didReceiveController(result: Result) { - return cuckoo_manager.call("performChangeValidatorsAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveController(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performChangeValidatorsAction()) + defaultCall: __defaultImplStub!.didReceiveController(result: result)) } - func performSetupValidatorsForBondedAction() { + func didReceiveStash(result: Result) { - return cuckoo_manager.call("performSetupValidatorsForBondedAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStash(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performSetupValidatorsForBondedAction()) + defaultCall: __defaultImplStub!.didReceiveStash(result: result)) } - func performStakeMoreAction() { + func didReceiveStakingLedger(result: Result) { - return cuckoo_manager.call("performStakeMoreAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performStakeMoreAction()) + defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) } - func performRedeemAction() { + func didReceiveRewardDestinationAccount(result: Result?, Error>) { - return cuckoo_manager.call("performRedeemAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveRewardDestinationAccount(result: Result?, Error>)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performRedeemAction()) + defaultCall: __defaultImplStub!.didReceiveRewardDestinationAccount(result: result)) } - func performRebondAction() { + func didReceiveRewardDestinationAddress(result: Result?, Error>) { - return cuckoo_manager.call("performRebondAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveRewardDestinationAddress(result: Result?, Error>)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performRebondAction()) + defaultCall: __defaultImplStub!.didReceiveRewardDestinationAddress(result: result)) } - func performAnalyticsAction() { + func didReceiveCalculator(result: Result) { - return cuckoo_manager.call("performAnalyticsAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveCalculator(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performAnalyticsAction()) + defaultCall: __defaultImplStub!.didReceiveCalculator(result: result)) } - func performManageAction(_ action: StakingManageOption) { + func didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>) { - return cuckoo_manager.call("performManageAction(_: StakingManageOption)", - parameters: (action), - escapingParameters: (action), + return cuckoo_manager.call("didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.performManageAction(action)) + defaultCall: __defaultImplStub!.didReceiveAccounts(result: result)) + + } + + + + func didReceiveNomination(result: Result) { + + return cuckoo_manager.call("didReceiveNomination(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveNomination(result: result)) + + } + + + + func didReceiveAccountInfo(result: Result) { + + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - struct __StubbingProxy_StakingMainChildPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDestSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -43627,59 +43349,69 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func performMainAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performMainAction()", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } - func performRewardInfoAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performRewardInfoAction()", parameterMatchers: matchers)) + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) } - func performChangeValidatorsAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performChangeValidatorsAction()", parameterMatchers: matchers)) + func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) } - func performSetupValidatorsForBondedAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performSetupValidatorsForBondedAction()", parameterMatchers: matchers)) + func didReceiveStash(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveStash(result: Result)", parameterMatchers: matchers)) } - func performStakeMoreAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performStakeMoreAction()", parameterMatchers: matchers)) + func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) } - func performRedeemAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performRedeemAction()", parameterMatchers: matchers)) + func didReceiveRewardDestinationAccount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result?, Error>)> where M1.MatchedType == Result?, Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result?, Error>)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveRewardDestinationAccount(result: Result?, Error>)", parameterMatchers: matchers)) } - func performRebondAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performRebondAction()", parameterMatchers: matchers)) + func didReceiveRewardDestinationAddress(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result?, Error>)> where M1.MatchedType == Result?, Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result?, Error>)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveRewardDestinationAddress(result: Result?, Error>)", parameterMatchers: matchers)) } - func performAnalyticsAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performAnalyticsAction()", parameterMatchers: matchers)) + func didReceiveCalculator(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveCalculator(result: Result)", parameterMatchers: matchers)) } - func performManageAction(_ action: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingManageOption)> where M1.MatchedType == StakingManageOption { - let matchers: [Cuckoo.ParameterMatcher<(StakingManageOption)>] = [wrap(matchable: action) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingMainChildPresenterProtocol.self, method: "performManageAction(_: StakingManageOption)", parameterMatchers: matchers)) + func didReceiveAccounts(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[MetaChainAccountResponse], Error>)> where M1.MatchedType == Result<[MetaChainAccountResponse], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[MetaChainAccountResponse], Error>)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", parameterMatchers: matchers)) + } + + func didReceiveNomination(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveNomination(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingMainChildPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDestSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -43694,69 +43426,81 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performMainAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performMainAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performRewardInfoAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performRewardInfoAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performChangeValidatorsAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performChangeValidatorsAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performSetupValidatorsForBondedAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performSetupValidatorsForBondedAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStash(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStash(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performStakeMoreAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performStakeMoreAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performRedeemAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performRedeemAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveRewardDestinationAccount(result: M1) -> Cuckoo.__DoNotUse<(Result?, Error>), Void> where M1.MatchedType == Result?, Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result?, Error>)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveRewardDestinationAccount(result: Result?, Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performRebondAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performRebondAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveRewardDestinationAddress(result: M1) -> Cuckoo.__DoNotUse<(Result?, Error>), Void> where M1.MatchedType == Result?, Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result?, Error>)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveRewardDestinationAddress(result: Result?, Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performAnalyticsAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("performAnalyticsAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveCalculator(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveCalculator(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func performManageAction(_ action: M1) -> Cuckoo.__DoNotUse<(StakingManageOption), Void> where M1.MatchedType == StakingManageOption { - let matchers: [Cuckoo.ParameterMatcher<(StakingManageOption)>] = [wrap(matchable: action) { $0 }] - return cuckoo_manager.verify("performManageAction(_: StakingManageOption)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccounts(result: M1) -> Cuckoo.__DoNotUse<(Result<[MetaChainAccountResponse], Error>), Void> where M1.MatchedType == Result<[MetaChainAccountResponse], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[MetaChainAccountResponse], Error>)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveNomination(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveNomination(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingMainChildPresenterProtocolStub: StakingMainChildPresenterProtocol { + class StakingRewardDestSetupInteractorOutputProtocolStub: StakingRewardDestSetupInteractorOutputProtocol { @@ -43764,268 +43508,180 @@ import SoraFoundation - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func performMainAction() { + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performRewardInfoAction() { + func didReceivePriceData(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performChangeValidatorsAction() { + func didReceiveStashItem(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performSetupValidatorsForBondedAction() { + func didReceiveController(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performStakeMoreAction() { + func didReceiveStash(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performRedeemAction() { + func didReceiveStakingLedger(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performRebondAction() { + func didReceiveRewardDestinationAccount(result: Result?, Error>) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performAnalyticsAction() { + func didReceiveRewardDestinationAddress(result: Result?, Error>) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func performManageAction(_ action: StakingManageOption) { + func didReceiveCalculator(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - -import Cuckoo -@testable import novawallet - -import SoraFoundation - - - class MockStakingPayoutConfirmationViewProtocol: StakingPayoutConfirmationViewProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingPayoutConfirmationViewProtocol - - typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationViewProtocol - typealias Verification = __VerificationProxy_StakingPayoutConfirmationViewProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: StakingPayoutConfirmationViewProtocol? - - func enableDefaultImplementation(_ stub: StakingPayoutConfirmationViewProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } - - - - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - - } - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } - - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - - } - - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } - + func didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } - + func didReceiveNomination(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - + + func didReceiveAccountInfo(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + class MockStakingRewardDestSetupWireframeProtocol: StakingRewardDestSetupWireframeProtocol, Cuckoo.ProtocolMock { + typealias MocksType = StakingRewardDestSetupWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDestSetupWireframeProtocol + typealias Verification = __VerificationProxy_StakingRewardDestSetupWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func didRecieve(viewModel: LocalizableResource) { - - return cuckoo_manager.call("didRecieve(viewModel: LocalizableResource)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didRecieve(viewModel: viewModel)) - + private var __defaultImplStub: StakingRewardDestSetupWireframeProtocol? + + func enableDefaultImplementation(_ stub: StakingRewardDestSetupWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didRecieve(amountViewModel: LocalizableResource) { + + + + + func proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination) { - return cuckoo_manager.call("didRecieve(amountViewModel: LocalizableResource)", - parameters: (amountViewModel), - escapingParameters: (amountViewModel), + return cuckoo_manager.call("proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination)", + parameters: (view, rewardDestination), + escapingParameters: (view, rewardDestination), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didRecieve(amountViewModel: amountViewModel)) + defaultCall: __defaultImplStub!.proceed(view: view, rewardDestination: rewardDestination)) } - func didReceive(feeViewModel: LocalizableResource?) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { - return cuckoo_manager.call("didReceive(feeViewModel: LocalizableResource?)", - parameters: (feeViewModel), - escapingParameters: (feeViewModel), + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(feeViewModel: feeViewModel)) + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) } - public func applyLocalization() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func didStartLoading() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didStartLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - func didStopLoading() { + func presentAccountSelection(_ accounts: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from view: ControllerBackedProtocol?, context: AnyObject?) { - return cuckoo_manager.call("didStopLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", + parameters: (accounts, selectedAccountItem, title, delegate, view, context), + escapingParameters: (accounts, selectedAccountItem, title, delegate, view, context), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.presentAccountSelection(accounts, selectedAccountItem: selectedAccountItem, title: title, delegate: delegate, from: view, context: context)) } - struct __StubbingProxy_StakingPayoutConfirmationViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDestSetupWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -44033,64 +43689,34 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") - } - - - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") - } - - - func didRecieve(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didRecieve(viewModel: LocalizableResource)", parameterMatchers: matchers)) - } - - func didRecieve(amountViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: amountViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didRecieve(amountViewModel: LocalizableResource)", parameterMatchers: matchers)) + func proceed(view: M1, rewardDestination: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRewardDestSetupViewProtocol?, RewardDestination)> where M1.OptionalMatchedType == StakingRewardDestSetupViewProtocol, M2.MatchedType == RewardDestination { + let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestSetupViewProtocol?, RewardDestination)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: rewardDestination) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination)", parameterMatchers: matchers)) } - func didReceive(feeViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: feeViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didReceive(feeViewModel: LocalizableResource?)", parameterMatchers: matchers)) + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + func presentAccountSelection(_ accounts: M1, selectedAccountItem: M2, title: M3, delegate: M4, from view: M5, context: M6) -> Cuckoo.ProtocolStubNoReturnFunction<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)> where M1.MatchedType == [MetaChainAccountResponse], M2.OptionalMatchedType == MetaChainAccountResponse, M3.MatchedType == LocalizableResource, M4.MatchedType == ModalPickerViewControllerDelegate, M5.OptionalMatchedType == ControllerBackedProtocol, M6.OptionalMatchedType == AnyObject { + let matchers: [Cuckoo.ParameterMatcher<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)>] = [wrap(matchable: accounts) { $0.0 }, wrap(matchable: selectedAccountItem) { $0.1 }, wrap(matchable: title) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: view) { $0.4 }, wrap(matchable: context) { $0.5 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingPayoutConfirmationViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDestSetupWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -44102,120 +43728,42 @@ import SoraFoundation } - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didRecieve(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didRecieve(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didRecieve(amountViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: amountViewModel) { $0 }] - return cuckoo_manager.verify("didRecieve(amountViewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed(view: M1, rewardDestination: M2) -> Cuckoo.__DoNotUse<(StakingRewardDestSetupViewProtocol?, RewardDestination), Void> where M1.OptionalMatchedType == StakingRewardDestSetupViewProtocol, M2.MatchedType == RewardDestination { + let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestSetupViewProtocol?, RewardDestination)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: rewardDestination) { $0.1 }] + return cuckoo_manager.verify("proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(feeViewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: feeViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(feeViewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentAccountSelection(_ accounts: M1, selectedAccountItem: M2, title: M3, delegate: M4, from view: M5, context: M6) -> Cuckoo.__DoNotUse<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?), Void> where M1.MatchedType == [MetaChainAccountResponse], M2.OptionalMatchedType == MetaChainAccountResponse, M3.MatchedType == LocalizableResource, M4.MatchedType == ModalPickerViewControllerDelegate, M5.OptionalMatchedType == ControllerBackedProtocol, M6.OptionalMatchedType == AnyObject { + let matchers: [Cuckoo.ParameterMatcher<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)>] = [wrap(matchable: accounts) { $0.0 }, wrap(matchable: selectedAccountItem) { $0.1 }, wrap(matchable: title) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: view) { $0.4 }, wrap(matchable: context) { $0.5 }] + return cuckoo_manager.verify("presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingPayoutConfirmationViewProtocolStub: StakingPayoutConfirmationViewProtocol { - - - - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - - - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - - } - - - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } + class StakingRewardDestSetupWireframeProtocolStub: StakingRewardDestSetupWireframeProtocol { @@ -44223,114 +43771,156 @@ import SoraFoundation - func didRecieve(viewModel: LocalizableResource) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didRecieve(amountViewModel: LocalizableResource) { + func proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(feeViewModel: LocalizableResource?) { + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartLoading() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStopLoading() { + func presentAccountSelection(_ accounts: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from view: ControllerBackedProtocol?, context: AnyObject?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet + +import SoraFoundation + - class MockStakingPayoutConfirmationPresenterProtocol: StakingPayoutConfirmationPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDetailsViewProtocol: StakingRewardDetailsViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingPayoutConfirmationPresenterProtocol + typealias MocksType = StakingRewardDetailsViewProtocol - typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationPresenterProtocol - typealias Verification = __VerificationProxy_StakingPayoutConfirmationPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDetailsViewProtocol + typealias Verification = __VerificationProxy_StakingRewardDetailsViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingPayoutConfirmationPresenterProtocol? + private var __defaultImplStub: StakingRewardDetailsViewProtocol? - func enableDefaultImplementation(_ stub: StakingPayoutConfirmationPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDetailsViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + + } + - func setup() { + func didReceive(amountViewModel: BalanceViewModelProtocol) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(amountViewModel: BalanceViewModelProtocol)", + parameters: (amountViewModel), + escapingParameters: (amountViewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceive(amountViewModel: amountViewModel)) } - func proceed() { + func didReceive(validatorViewModel: StackCellViewModel) { - return cuckoo_manager.call("proceed()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(validatorViewModel: StackCellViewModel)", + parameters: (validatorViewModel), + escapingParameters: (validatorViewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.didReceive(validatorViewModel: validatorViewModel)) } - func presentAccountOptions() { + func didReceive(eraViewModel: StackCellViewModel) { - return cuckoo_manager.call("presentAccountOptions()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceive(eraViewModel: StackCellViewModel)", + parameters: (eraViewModel), + escapingParameters: (eraViewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentAccountOptions()) + defaultCall: __defaultImplStub!.didReceive(eraViewModel: eraViewModel)) + + } + + + + func didReceive(remainedTime: NSAttributedString) { + + return cuckoo_manager.call("didReceive(remainedTime: NSAttributedString)", + parameters: (remainedTime), + escapingParameters: (remainedTime), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceive(remainedTime: remainedTime)) } - struct __StubbingProxy_StakingPayoutConfirmationPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDetailsViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -44338,24 +43928,39 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func presentAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationPresenterProtocol.self, method: "presentAccountOptions()", parameterMatchers: matchers)) + + func didReceive(amountViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BalanceViewModelProtocol)> where M1.MatchedType == BalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol)>] = [wrap(matchable: amountViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsViewProtocol.self, method: "didReceive(amountViewModel: BalanceViewModelProtocol)", parameterMatchers: matchers)) + } + + func didReceive(validatorViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StackCellViewModel)> where M1.MatchedType == StackCellViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StackCellViewModel)>] = [wrap(matchable: validatorViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsViewProtocol.self, method: "didReceive(validatorViewModel: StackCellViewModel)", parameterMatchers: matchers)) + } + + func didReceive(eraViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StackCellViewModel)> where M1.MatchedType == StackCellViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StackCellViewModel)>] = [wrap(matchable: eraViewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsViewProtocol.self, method: "didReceive(eraViewModel: StackCellViewModel)", parameterMatchers: matchers)) + } + + func didReceive(remainedTime: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(NSAttributedString)> where M1.MatchedType == NSAttributedString { + let matchers: [Cuckoo.ParameterMatcher<(NSAttributedString)>] = [wrap(matchable: remainedTime) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsViewProtocol.self, method: "didReceive(remainedTime: NSAttributedString)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingPayoutConfirmationPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDetailsViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -44367,30 +43972,64 @@ import SoraFoundation } + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(amountViewModel: M1) -> Cuckoo.__DoNotUse<(BalanceViewModelProtocol), Void> where M1.MatchedType == BalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol)>] = [wrap(matchable: amountViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(amountViewModel: BalanceViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(validatorViewModel: M1) -> Cuckoo.__DoNotUse<(StackCellViewModel), Void> where M1.MatchedType == StackCellViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StackCellViewModel)>] = [wrap(matchable: validatorViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(validatorViewModel: StackCellViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(eraViewModel: M1) -> Cuckoo.__DoNotUse<(StackCellViewModel), Void> where M1.MatchedType == StackCellViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StackCellViewModel)>] = [wrap(matchable: eraViewModel) { $0 }] + return cuckoo_manager.verify("didReceive(eraViewModel: StackCellViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(remainedTime: M1) -> Cuckoo.__DoNotUse<(NSAttributedString), Void> where M1.MatchedType == NSAttributedString { + let matchers: [Cuckoo.ParameterMatcher<(NSAttributedString)>] = [wrap(matchable: remainedTime) { $0 }] + return cuckoo_manager.verify("didReceive(remainedTime: NSAttributedString)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingPayoutConfirmationPresenterProtocolStub: StakingPayoutConfirmationPresenterProtocol { + class StakingRewardDetailsViewProtocolStub: StakingRewardDetailsViewProtocol { + + + + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } @@ -44398,19 +44037,25 @@ import SoraFoundation - func setup() { + func didReceive(amountViewModel: BalanceViewModelProtocol) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func proceed() { + func didReceive(validatorViewModel: StackCellViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentAccountOptions() { + func didReceive(eraViewModel: StackCellViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceive(remainedTime: NSAttributedString) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -44418,19 +44063,19 @@ import SoraFoundation - class MockStakingPayoutConfirmationInteractorInputProtocol: StakingPayoutConfirmationInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDetailsPresenterProtocol: StakingRewardDetailsPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingPayoutConfirmationInteractorInputProtocol + typealias MocksType = StakingRewardDetailsPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingPayoutConfirmationInteractorInputProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDetailsPresenterProtocol + typealias Verification = __VerificationProxy_StakingRewardDetailsPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingPayoutConfirmationInteractorInputProtocol? + private var __defaultImplStub: StakingRewardDetailsPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingPayoutConfirmationInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDetailsPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -44458,36 +44103,36 @@ import SoraFoundation - func submitPayout() { + func handlePayoutAction() { - return cuckoo_manager.call("submitPayout()", + return cuckoo_manager.call("handlePayoutAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.submitPayout()) + defaultCall: __defaultImplStub!.handlePayoutAction()) } - func estimateFee() { + func handleValidatorAccountAction() { - return cuckoo_manager.call("estimateFee()", + return cuckoo_manager.call("handleValidatorAccountAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee()) + defaultCall: __defaultImplStub!.handleValidatorAccountAction()) } - struct __StubbingProxy_StakingPayoutConfirmationInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDetailsPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -44497,22 +44142,22 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func submitPayout() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func handlePayoutAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorInputProtocol.self, method: "submitPayout()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsPresenterProtocol.self, method: "handlePayoutAction()", parameterMatchers: matchers)) } - func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func handleValidatorAccountAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsPresenterProtocol.self, method: "handleValidatorAccountAction()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingPayoutConfirmationInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDetailsPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -44533,21 +44178,21 @@ import SoraFoundation } @discardableResult - func submitPayout() -> Cuckoo.__DoNotUse<(), Void> { + func handlePayoutAction() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("submitPayout()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("handlePayoutAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { + func handleValidatorAccountAction() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("handleValidatorAccountAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingPayoutConfirmationInteractorInputProtocolStub: StakingPayoutConfirmationInteractorInputProtocol { + class StakingRewardDetailsPresenterProtocolStub: StakingRewardDetailsPresenterProtocol { @@ -44561,13 +44206,13 @@ import SoraFoundation - func submitPayout() { + func handlePayoutAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func estimateFee() { + func handleValidatorAccountAction() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -44575,19 +44220,19 @@ import SoraFoundation - class MockStakingPayoutConfirmationInteractorOutputProtocol: StakingPayoutConfirmationInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDetailsInteractorInputProtocol: StakingRewardDetailsInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingPayoutConfirmationInteractorOutputProtocol + typealias MocksType = StakingRewardDetailsInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingPayoutConfirmationInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDetailsInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingRewardDetailsInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingPayoutConfirmationInteractorOutputProtocol? + private var __defaultImplStub: StakingRewardDetailsInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingPayoutConfirmationInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDetailsInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -44600,111 +44245,114 @@ import SoraFoundation - func didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal) { + func setup() { - return cuckoo_manager.call("didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal)", - parameters: (account, rewardAmount), - escapingParameters: (account, rewardAmount), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didRecieve(account: account, rewardAmount: rewardAmount)) + defaultCall: __defaultImplStub!.setup()) } + + struct __StubbingProxy_StakingRewardDetailsInteractorInputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_StakingRewardDetailsInteractorInputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class StakingRewardDetailsInteractorInputProtocolStub: StakingRewardDetailsInteractorInputProtocol { + - func didReceivePriceData(result: Result) { - - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) - - } + - func didReceiveAccountInfo(result: Result) { - - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) - + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockStakingRewardDetailsInteractorOutputProtocol: StakingRewardDetailsInteractorOutputProtocol, Cuckoo.ProtocolMock { + typealias MocksType = StakingRewardDetailsInteractorOutputProtocol - func didReceiveFee(result: Result) { - - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) - - } - - + typealias Stubbing = __StubbingProxy_StakingRewardDetailsInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingRewardDetailsInteractorOutputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func didStartPayout() { - - return cuckoo_manager.call("didStartPayout()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didStartPayout()) - + private var __defaultImplStub: StakingRewardDetailsInteractorOutputProtocol? + + func enableDefaultImplementation(_ stub: StakingRewardDetailsInteractorOutputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didCompletePayout(txHashes: [String]) { - - return cuckoo_manager.call("didCompletePayout(txHashes: [String])", - parameters: (txHashes), - escapingParameters: (txHashes), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didCompletePayout(txHashes: txHashes)) - - } + - func didFailPayout(error: Error) { + func didReceive(priceResult: Result) { - return cuckoo_manager.call("didFailPayout(error: Error)", - parameters: (error), - escapingParameters: (error), + return cuckoo_manager.call("didReceive(priceResult: Result)", + parameters: (priceResult), + escapingParameters: (priceResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didFailPayout(error: error)) + defaultCall: __defaultImplStub!.didReceive(priceResult: priceResult)) } - struct __StubbingProxy_StakingPayoutConfirmationInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDetailsInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -44712,44 +44360,14 @@ import SoraFoundation } - func didRecieve(account: M1, rewardAmount: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(MetaChainAccountResponse, Decimal)> where M1.MatchedType == MetaChainAccountResponse, M2.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(MetaChainAccountResponse, Decimal)>] = [wrap(matchable: account) { $0.0 }, wrap(matchable: rewardAmount) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal)", parameterMatchers: matchers)) - } - - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) - } - - func didStartPayout() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didStartPayout()", parameterMatchers: matchers)) - } - - func didCompletePayout(txHashes: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([String])> where M1.MatchedType == [String] { - let matchers: [Cuckoo.ParameterMatcher<([String])>] = [wrap(matchable: txHashes) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didCompletePayout(txHashes: [String])", parameterMatchers: matchers)) - } - - func didFailPayout(error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationInteractorOutputProtocol.self, method: "didFailPayout(error: Error)", parameterMatchers: matchers)) + func didReceive(priceResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsInteractorOutputProtocol.self, method: "didReceive(priceResult: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingPayoutConfirmationInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDetailsInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -44764,51 +44382,15 @@ import SoraFoundation @discardableResult - func didRecieve(account: M1, rewardAmount: M2) -> Cuckoo.__DoNotUse<(MetaChainAccountResponse, Decimal), Void> where M1.MatchedType == MetaChainAccountResponse, M2.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(MetaChainAccountResponse, Decimal)>] = [wrap(matchable: account) { $0.0 }, wrap(matchable: rewardAmount) { $0.1 }] - return cuckoo_manager.verify("didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didStartPayout() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartPayout()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didCompletePayout(txHashes: M1) -> Cuckoo.__DoNotUse<([String]), Void> where M1.MatchedType == [String] { - let matchers: [Cuckoo.ParameterMatcher<([String])>] = [wrap(matchable: txHashes) { $0 }] - return cuckoo_manager.verify("didCompletePayout(txHashes: [String])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didFailPayout(error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { - let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] - return cuckoo_manager.verify("didFailPayout(error: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(priceResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] + return cuckoo_manager.verify("didReceive(priceResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingPayoutConfirmationInteractorOutputProtocolStub: StakingPayoutConfirmationInteractorOutputProtocol { + class StakingRewardDetailsInteractorOutputProtocolStub: StakingRewardDetailsInteractorOutputProtocol { @@ -44816,43 +44398,7 @@ import SoraFoundation - func didRecieve(account: MetaChainAccountResponse, rewardAmount: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceivePriceData(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didStartPayout() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didCompletePayout(txHashes: [String]) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didFailPayout(error: Error) { + func didReceive(priceResult: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -44860,19 +44406,19 @@ import SoraFoundation - class MockStakingPayoutConfirmationWireframeProtocol: StakingPayoutConfirmationWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardDetailsWireframeProtocol: StakingRewardDetailsWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingPayoutConfirmationWireframeProtocol + typealias MocksType = StakingRewardDetailsWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingPayoutConfirmationWireframeProtocol - typealias Verification = __VerificationProxy_StakingPayoutConfirmationWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingRewardDetailsWireframeProtocol + typealias Verification = __VerificationProxy_StakingRewardDetailsWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingPayoutConfirmationWireframeProtocol? + private var __defaultImplStub: StakingRewardDetailsWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingPayoutConfirmationWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardDetailsWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -44885,51 +44431,21 @@ import SoraFoundation - func complete(from view: StakingPayoutConfirmationViewProtocol?) { - - return cuckoo_manager.call("complete(from: StakingPayoutConfirmationViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.complete(from: view)) - - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) - - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func showPayoutConfirmation(from view: ControllerBackedProtocol?, payoutInfo: PayoutInfo) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("showPayoutConfirmation(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo)", + parameters: (view, payoutInfo), + escapingParameters: (view, payoutInfo), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.showPayoutConfirmation(from: view, payoutInfo: payoutInfo)) } - struct __StubbingProxy_StakingPayoutConfirmationWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardDetailsWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -44937,24 +44453,14 @@ import SoraFoundation } - func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingPayoutConfirmationViewProtocol?)> where M1.OptionalMatchedType == StakingPayoutConfirmationViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingPayoutConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationWireframeProtocol.self, method: "complete(from: StakingPayoutConfirmationViewProtocol?)", parameterMatchers: matchers)) - } - - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutConfirmationWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func showPayoutConfirmation(from view: M1, payoutInfo: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, PayoutInfo)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == PayoutInfo { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, PayoutInfo)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: payoutInfo) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsWireframeProtocol.self, method: "showPayoutConfirmation(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingPayoutConfirmationWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardDetailsWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -44969,27 +44475,15 @@ import SoraFoundation @discardableResult - func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingPayoutConfirmationViewProtocol?), Void> where M1.OptionalMatchedType == StakingPayoutConfirmationViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingPayoutConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(from: StakingPayoutConfirmationViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showPayoutConfirmation(from view: M1, payoutInfo: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, PayoutInfo), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == PayoutInfo { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, PayoutInfo)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: payoutInfo) { $0.1 }] + return cuckoo_manager.verify("showPayoutConfirmation(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingPayoutConfirmationWireframeProtocolStub: StakingPayoutConfirmationWireframeProtocol { + class StakingRewardDetailsWireframeProtocolStub: StakingRewardDetailsWireframeProtocol { @@ -44997,19 +44491,7 @@ import SoraFoundation - func complete(from view: StakingPayoutConfirmationViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func showPayoutConfirmation(from view: ControllerBackedProtocol?, payoutInfo: PayoutInfo) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -45019,24 +44501,23 @@ import SoraFoundation import Cuckoo @testable import novawallet -import BigInt -import Foundation import SoraFoundation +import SoraUI - class MockStakingRebondConfirmationViewProtocol: StakingRebondConfirmationViewProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardPayoutsViewProtocol: StakingRewardPayoutsViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRebondConfirmationViewProtocol + typealias MocksType = StakingRewardPayoutsViewProtocol - typealias Stubbing = __StubbingProxy_StakingRebondConfirmationViewProtocol - typealias Verification = __VerificationProxy_StakingRebondConfirmationViewProtocol + typealias Stubbing = __StubbingProxy_StakingRewardPayoutsViewProtocol + typealias Verification = __VerificationProxy_StakingRewardPayoutsViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRebondConfirmationViewProtocol? + private var __defaultImplStub: StakingRewardPayoutsViewProtocol? - func enableDefaultImplementation(_ stub: StakingRebondConfirmationViewProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardPayoutsViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -45090,135 +44571,47 @@ import SoraFoundation Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - - } - - - - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } - - } - - - - - - - - func didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel) { - - return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) - - } - - - - func didReceiveAmount(viewModel: LocalizableResource) { - - return cuckoo_manager.call("didReceiveAmount(viewModel: LocalizableResource)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAmount(viewModel: viewModel)) - - } - - - - func didReceiveFee(viewModel: LocalizableResource?) { - - return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) + defaultCall: __defaultImplStub!.localizationManager = newValue) + } } + - - public func applyLocalization() { - - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.applyLocalization()) - - } + - func didStartLoading() { + func reload(with state: StakingRewardPayoutsViewState) { - return cuckoo_manager.call("didStartLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("reload(with: StakingRewardPayoutsViewState)", + parameters: (state), + escapingParameters: (state), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.reload(with: state)) } - func didStopLoading() { + public func applyLocalization() { - return cuckoo_manager.call("didStopLoading()", + return cuckoo_manager.call("applyLocalization()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_StakingRebondConfirmationViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardPayoutsViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -45226,64 +44619,34 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") - } - - - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRebondConfirmationViewModel)> where M1.MatchedType == StakingRebondConfirmationViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingRebondConfirmationViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel)", parameterMatchers: matchers)) - } - - func didReceiveAmount(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didReceiveAmount(viewModel: LocalizableResource)", parameterMatchers: matchers)) - } - - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + func reload(with state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRewardPayoutsViewState)> where M1.MatchedType == StakingRewardPayoutsViewState { + let matchers: [Cuckoo.ParameterMatcher<(StakingRewardPayoutsViewState)>] = [wrap(matchable: state) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsViewProtocol.self, method: "reload(with: StakingRewardPayoutsViewState)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) - } - - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) - } - - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRebondConfirmationViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardPayoutsViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -45310,34 +44673,12 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingRebondConfirmationViewModel), Void> where M1.MatchedType == StakingRebondConfirmationViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingRebondConfirmationViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAmount(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAmount(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload(with state: M1) -> Cuckoo.__DoNotUse<(StakingRewardPayoutsViewState), Void> where M1.MatchedType == StakingRewardPayoutsViewState { + let matchers: [Cuckoo.ParameterMatcher<(StakingRewardPayoutsViewState)>] = [wrap(matchable: state) { $0 }] + return cuckoo_manager.verify("reload(with: StakingRewardPayoutsViewState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -45346,22 +44687,10 @@ import SoraFoundation return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - } } - class StakingRebondConfirmationViewProtocolStub: StakingRebondConfirmationViewProtocol { + class StakingRewardPayoutsViewProtocolStub: StakingRewardPayoutsViewProtocol { @@ -45391,24 +44720,6 @@ import SoraFoundation set { } } - - - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - - } - - - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } @@ -45416,19 +44727,7 @@ import SoraFoundation - func didReceiveConfirmation(viewModel: StakingRebondConfirmationViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAmount(viewModel: LocalizableResource) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(viewModel: LocalizableResource?) { + func reload(with state: StakingRewardPayoutsViewState) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -45438,35 +44737,23 @@ import SoraFoundation return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - func didStartLoading() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didStopLoading() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - } - class MockStakingRebondConfirmationPresenterProtocol: StakingRebondConfirmationPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardPayoutsPresenterProtocol: StakingRewardPayoutsPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRebondConfirmationPresenterProtocol + typealias MocksType = StakingRewardPayoutsPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingRebondConfirmationPresenterProtocol - typealias Verification = __VerificationProxy_StakingRebondConfirmationPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingRewardPayoutsPresenterProtocol + typealias Verification = __VerificationProxy_StakingRewardPayoutsPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRebondConfirmationPresenterProtocol? + private var __defaultImplStub: StakingRewardPayoutsPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingRebondConfirmationPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardPayoutsPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -45494,36 +44781,66 @@ import SoraFoundation - func confirm() { + func handleSelectedHistory(at index: Int) { - return cuckoo_manager.call("confirm()", + return cuckoo_manager.call("handleSelectedHistory(at: Int)", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.handleSelectedHistory(at: index)) + + } + + + + func handlePayoutAction() { + + return cuckoo_manager.call("handlePayoutAction()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.confirm()) + defaultCall: __defaultImplStub!.handlePayoutAction()) } - func selectAccount() { + func reload() { - return cuckoo_manager.call("selectAccount()", + return cuckoo_manager.call("reload()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectAccount()) + defaultCall: __defaultImplStub!.reload()) + + } + + + + func getTimeLeftString(at index: Int) -> LocalizableResource? { + + return cuckoo_manager.call("getTimeLeftString(at: Int) -> LocalizableResource?", + parameters: (index), + escapingParameters: (index), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.getTimeLeftString(at: index)) } - struct __StubbingProxy_StakingRebondConfirmationPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardPayoutsPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -45533,22 +44850,32 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func handleSelectedHistory(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "handleSelectedHistory(at: Int)", parameterMatchers: matchers)) + } + + func handlePayoutAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "handlePayoutAction()", parameterMatchers: matchers)) } - func selectAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationPresenterProtocol.self, method: "selectAccount()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "reload()", parameterMatchers: matchers)) + } + + func getTimeLeftString(at index: M1) -> Cuckoo.ProtocolStubFunction<(Int), LocalizableResource?> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "getTimeLeftString(at: Int) -> LocalizableResource?", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRebondConfirmationPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardPayoutsPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -45569,21 +44896,33 @@ import SoraFoundation } @discardableResult - func confirm() -> Cuckoo.__DoNotUse<(), Void> { + func handleSelectedHistory(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("handleSelectedHistory(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func handlePayoutAction() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("handlePayoutAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectAccount() -> Cuckoo.__DoNotUse<(), Void> { + func reload() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func getTimeLeftString(at index: M1) -> Cuckoo.__DoNotUse<(Int), LocalizableResource?> where M1.MatchedType == Int { + let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] + return cuckoo_manager.verify("getTimeLeftString(at: Int) -> LocalizableResource?", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRebondConfirmationPresenterProtocolStub: StakingRebondConfirmationPresenterProtocol { + class StakingRewardPayoutsPresenterProtocolStub: StakingRewardPayoutsPresenterProtocol { @@ -45597,33 +44936,45 @@ import SoraFoundation - func confirm() { + func handleSelectedHistory(at index: Int) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectAccount() { + func handlePayoutAction() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func reload() { return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func getTimeLeftString(at index: Int) -> LocalizableResource? { + return DefaultValueRegistry.defaultValue(for: (LocalizableResource?).self) + } + } - class MockStakingRebondConfirmationInteractorInputProtocol: StakingRebondConfirmationInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardPayoutsInteractorInputProtocol: StakingRewardPayoutsInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRebondConfirmationInteractorInputProtocol + typealias MocksType = StakingRewardPayoutsInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingRebondConfirmationInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingRebondConfirmationInteractorInputProtocol + typealias Stubbing = __StubbingProxy_StakingRewardPayoutsInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingRewardPayoutsInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRebondConfirmationInteractorInputProtocol? + private var __defaultImplStub: StakingRewardPayoutsInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingRebondConfirmationInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardPayoutsInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -45651,36 +45002,21 @@ import SoraFoundation - func submit(for amount: Decimal) { - - return cuckoo_manager.call("submit(for: Decimal)", - parameters: (amount), - escapingParameters: (amount), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.submit(for: amount)) - - } - - - - func estimateFee(for amount: Decimal) { + func reload() { - return cuckoo_manager.call("estimateFee(for: Decimal)", - parameters: (amount), - escapingParameters: (amount), + return cuckoo_manager.call("reload()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee(for: amount)) + defaultCall: __defaultImplStub!.reload()) } - struct __StubbingProxy_StakingRebondConfirmationInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardPayoutsInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -45690,22 +45026,17 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func submit(for amount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorInputProtocol.self, method: "submit(for: Decimal)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func estimateFee(for amount: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorInputProtocol.self, method: "estimateFee(for: Decimal)", parameterMatchers: matchers)) + func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorInputProtocol.self, method: "reload()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRebondConfirmationInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardPayoutsInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -45726,21 +45057,15 @@ import SoraFoundation } @discardableResult - func submit(for amount: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] - return cuckoo_manager.verify("submit(for: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func estimateFee(for amount: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: amount) { $0 }] - return cuckoo_manager.verify("estimateFee(for: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRebondConfirmationInteractorInputProtocolStub: StakingRebondConfirmationInteractorInputProtocol { + class StakingRewardPayoutsInteractorInputProtocolStub: StakingRewardPayoutsInteractorInputProtocol { @@ -45754,13 +45079,7 @@ import SoraFoundation - func submit(for amount: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func estimateFee(for amount: Decimal) { + func reload() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -45768,19 +45087,19 @@ import SoraFoundation - class MockStakingRebondConfirmationInteractorOutputProtocol: StakingRebondConfirmationInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingRewardPayoutsInteractorOutputProtocol: StakingRewardPayoutsInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRebondConfirmationInteractorOutputProtocol + typealias MocksType = StakingRewardPayoutsInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingRebondConfirmationInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingRebondConfirmationInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_StakingRewardPayoutsInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingRewardPayoutsInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRebondConfirmationInteractorOutputProtocol? + private var __defaultImplStub: StakingRewardPayoutsInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingRebondConfirmationInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingRewardPayoutsInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -45793,111 +45112,193 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { + func didReceive(result: Result) { - return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", + return cuckoo_manager.call("didReceive(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) + defaultCall: __defaultImplStub!.didReceive(result: result)) } - func didReceiveAccountInfo(result: Result) { + func didReceive(priceResult: Result) { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceive(priceResult: Result)", + parameters: (priceResult), + escapingParameters: (priceResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.didReceive(priceResult: priceResult)) } - func didReceivePriceData(result: Result) { + func didReceive(eraCountdownResult: Result) { - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceive(eraCountdownResult: Result)", + parameters: (eraCountdownResult), + escapingParameters: (eraCountdownResult), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + defaultCall: __defaultImplStub!.didReceive(eraCountdownResult: eraCountdownResult)) } + + struct __StubbingProxy_StakingRewardPayoutsInteractorOutputProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func didReceive(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorOutputProtocol.self, method: "didReceive(result: Result)", parameterMatchers: matchers)) + } + + func didReceive(priceResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorOutputProtocol.self, method: "didReceive(priceResult: Result)", parameterMatchers: matchers)) + } + + func didReceive(eraCountdownResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: eraCountdownResult) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorOutputProtocol.self, method: "didReceive(eraCountdownResult: Result)", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_StakingRewardPayoutsInteractorOutputProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func didReceive(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceive(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(priceResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] + return cuckoo_manager.verify("didReceive(priceResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceive(eraCountdownResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: eraCountdownResult) { $0 }] + return cuckoo_manager.verify("didReceive(eraCountdownResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class StakingRewardPayoutsInteractorOutputProtocolStub: StakingRewardPayoutsInteractorOutputProtocol { + + + + + + + + func didReceive(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + - func didReceiveFee(result: Result) { - - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) - + func didReceive(priceResult: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveController(result: Result) { - - return cuckoo_manager.call("didReceiveController(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveController(result: result)) - + func didReceive(eraCountdownResult: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + +} + + + + class MockStakingRewardPayoutsWireframeProtocol: StakingRewardPayoutsWireframeProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = StakingRewardPayoutsWireframeProtocol + + typealias Stubbing = __StubbingProxy_StakingRewardPayoutsWireframeProtocol + typealias Verification = __VerificationProxy_StakingRewardPayoutsWireframeProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: StakingRewardPayoutsWireframeProtocol? + + func enableDefaultImplementation(_ stub: StakingRewardPayoutsWireframeProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func didReceiveStashItem(result: Result) { + + + + + func showRewardDetails(from view: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown) { - return cuckoo_manager.call("didReceiveStashItem(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("showRewardDetails(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown)", + parameters: (view, payoutInfo, historyDepth, eraCountdown), + escapingParameters: (view, payoutInfo, historyDepth, eraCountdown), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) + defaultCall: __defaultImplStub!.showRewardDetails(from: view, payoutInfo: payoutInfo, historyDepth: historyDepth, eraCountdown: eraCountdown)) } - func didSubmitRebonding(result: Result) { + func showPayoutConfirmation(for payouts: [PayoutInfo], from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didSubmitRebonding(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("showPayoutConfirmation(for: [PayoutInfo], from: ControllerBackedProtocol?)", + parameters: (payouts, view), + escapingParameters: (payouts, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSubmitRebonding(result: result)) + defaultCall: __defaultImplStub!.showPayoutConfirmation(for: payouts, from: view)) } - struct __StubbingProxy_StakingRebondConfirmationInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingRewardPayoutsWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -45905,44 +45306,19 @@ import SoraFoundation } - func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + func showRewardDetails(from view: M1, payoutInfo: M2, historyDepth: M3, eraCountdown: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, PayoutInfo, UInt32, EraCountdown)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == PayoutInfo, M3.MatchedType == UInt32, M4.MatchedType == EraCountdown { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, PayoutInfo, UInt32, EraCountdown)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: payoutInfo) { $0.1 }, wrap(matchable: historyDepth) { $0.2 }, wrap(matchable: eraCountdown) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsWireframeProtocol.self, method: "showRewardDetails(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown)", parameterMatchers: matchers)) } - func didSubmitRebonding(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationInteractorOutputProtocol.self, method: "didSubmitRebonding(result: Result)", parameterMatchers: matchers)) + func showPayoutConfirmation(for payouts: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<([PayoutInfo], ControllerBackedProtocol?)> where M1.MatchedType == [PayoutInfo], M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<([PayoutInfo], ControllerBackedProtocol?)>] = [wrap(matchable: payouts) { $0.0 }, wrap(matchable: view) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsWireframeProtocol.self, method: "showPayoutConfirmation(for: [PayoutInfo], from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRebondConfirmationInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingRewardPayoutsWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -45957,51 +45333,21 @@ import SoraFoundation @discardableResult - func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showRewardDetails(from view: M1, payoutInfo: M2, historyDepth: M3, eraCountdown: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, PayoutInfo, UInt32, EraCountdown), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == PayoutInfo, M3.MatchedType == UInt32, M4.MatchedType == EraCountdown { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, PayoutInfo, UInt32, EraCountdown)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: payoutInfo) { $0.1 }, wrap(matchable: historyDepth) { $0.2 }, wrap(matchable: eraCountdown) { $0.3 }] + return cuckoo_manager.verify("showRewardDetails(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didSubmitRebonding(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didSubmitRebonding(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showPayoutConfirmation(for payouts: M1, from view: M2) -> Cuckoo.__DoNotUse<([PayoutInfo], ControllerBackedProtocol?), Void> where M1.MatchedType == [PayoutInfo], M2.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<([PayoutInfo], ControllerBackedProtocol?)>] = [wrap(matchable: payouts) { $0.0 }, wrap(matchable: view) { $0.1 }] + return cuckoo_manager.verify("showPayoutConfirmation(for: [PayoutInfo], from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRebondConfirmationInteractorOutputProtocolStub: StakingRebondConfirmationInteractorOutputProtocol { + class StakingRewardPayoutsWireframeProtocolStub: StakingRewardPayoutsWireframeProtocol { @@ -46009,43 +45355,13 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceivePriceData(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveController(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveStashItem(result: Result) { + func showRewardDetails(from view: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didSubmitRebonding(result: Result) { + func showPayoutConfirmation(for payouts: [PayoutInfo], from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -46053,19 +45369,19 @@ import SoraFoundation - class MockStakingRebondConfirmationWireframeProtocol: StakingRebondConfirmationWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingPayoutViewModelFactoryProtocol: StakingPayoutViewModelFactoryProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRebondConfirmationWireframeProtocol + typealias MocksType = StakingPayoutViewModelFactoryProtocol - typealias Stubbing = __StubbingProxy_StakingRebondConfirmationWireframeProtocol - typealias Verification = __VerificationProxy_StakingRebondConfirmationWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingPayoutViewModelFactoryProtocol + typealias Verification = __VerificationProxy_StakingPayoutViewModelFactoryProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRebondConfirmationWireframeProtocol? + private var __defaultImplStub: StakingPayoutViewModelFactoryProtocol? - func enableDefaultImplementation(_ stub: StakingRebondConfirmationWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingPayoutViewModelFactoryProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -46078,51 +45394,36 @@ import SoraFoundation - func complete(from view: StakingRebondConfirmationViewProtocol?) { - - return cuckoo_manager.call("complete(from: StakingRebondConfirmationViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.complete(from: view)) - - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource", + parameters: (payoutsInfo, priceData, eraCountdown), + escapingParameters: (payoutsInfo, priceData, eraCountdown), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.createPayoutsViewModel(payoutsInfo: payoutsInfo, priceData: priceData, eraCountdown: eraCountdown)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func timeLeftString(at index: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("timeLeftString(at: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource", + parameters: (index, payoutsInfo, eraCountdown), + escapingParameters: (index, payoutsInfo, eraCountdown), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.timeLeftString(at: index, payoutsInfo: payoutsInfo, eraCountdown: eraCountdown)) } - struct __StubbingProxy_StakingRebondConfirmationWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingPayoutViewModelFactoryProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -46130,24 +45431,19 @@ import SoraFoundation } - func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRebondConfirmationViewProtocol?)> where M1.OptionalMatchedType == StakingRebondConfirmationViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingRebondConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationWireframeProtocol.self, method: "complete(from: StakingRebondConfirmationViewProtocol?)", parameterMatchers: matchers)) - } - - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func createPayoutsViewModel(payoutsInfo: M1, priceData: M2, eraCountdown: M3) -> Cuckoo.ProtocolStubFunction<(PayoutsInfo, PriceData?, EraCountdown?), LocalizableResource> where M1.MatchedType == PayoutsInfo, M2.OptionalMatchedType == PriceData, M3.OptionalMatchedType == EraCountdown { + let matchers: [Cuckoo.ParameterMatcher<(PayoutsInfo, PriceData?, EraCountdown?)>] = [wrap(matchable: payoutsInfo) { $0.0 }, wrap(matchable: priceData) { $0.1 }, wrap(matchable: eraCountdown) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutViewModelFactoryProtocol.self, method: "createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondConfirmationWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func timeLeftString(at index: M1, payoutsInfo: M2, eraCountdown: M3) -> Cuckoo.ProtocolStubFunction<(Int, PayoutsInfo, EraCountdown?), LocalizableResource> where M1.MatchedType == Int, M2.MatchedType == PayoutsInfo, M3.OptionalMatchedType == EraCountdown { + let matchers: [Cuckoo.ParameterMatcher<(Int, PayoutsInfo, EraCountdown?)>] = [wrap(matchable: index) { $0.0 }, wrap(matchable: payoutsInfo) { $0.1 }, wrap(matchable: eraCountdown) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutViewModelFactoryProtocol.self, method: "timeLeftString(at: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRebondConfirmationWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingPayoutViewModelFactoryProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -46162,27 +45458,21 @@ import SoraFoundation @discardableResult - func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingRebondConfirmationViewProtocol?), Void> where M1.OptionalMatchedType == StakingRebondConfirmationViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingRebondConfirmationViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(from: StakingRebondConfirmationViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func createPayoutsViewModel(payoutsInfo: M1, priceData: M2, eraCountdown: M3) -> Cuckoo.__DoNotUse<(PayoutsInfo, PriceData?, EraCountdown?), LocalizableResource> where M1.MatchedType == PayoutsInfo, M2.OptionalMatchedType == PriceData, M3.OptionalMatchedType == EraCountdown { + let matchers: [Cuckoo.ParameterMatcher<(PayoutsInfo, PriceData?, EraCountdown?)>] = [wrap(matchable: payoutsInfo) { $0.0 }, wrap(matchable: priceData) { $0.1 }, wrap(matchable: eraCountdown) { $0.2 }] + return cuckoo_manager.verify("createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func timeLeftString(at index: M1, payoutsInfo: M2, eraCountdown: M3) -> Cuckoo.__DoNotUse<(Int, PayoutsInfo, EraCountdown?), LocalizableResource> where M1.MatchedType == Int, M2.MatchedType == PayoutsInfo, M3.OptionalMatchedType == EraCountdown { + let matchers: [Cuckoo.ParameterMatcher<(Int, PayoutsInfo, EraCountdown?)>] = [wrap(matchable: index) { $0.0 }, wrap(matchable: payoutsInfo) { $0.1 }, wrap(matchable: eraCountdown) { $0.2 }] + return cuckoo_manager.verify("timeLeftString(at: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRebondConfirmationWireframeProtocolStub: StakingRebondConfirmationWireframeProtocol { + class StakingPayoutViewModelFactoryProtocolStub: StakingPayoutViewModelFactoryProtocol { @@ -46190,20 +45480,14 @@ import SoraFoundation - func complete(from view: StakingRebondConfirmationViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource { + return DefaultValueRegistry.defaultValue(for: (LocalizableResource).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func timeLeftString(at index: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource { + return DefaultValueRegistry.defaultValue(for: (LocalizableResource).self) } } @@ -46212,24 +45496,24 @@ import SoraFoundation import Cuckoo @testable import novawallet -import CommonWallet +import BigInt import Foundation import SoraFoundation - class MockStakingRebondSetupViewProtocol: StakingRebondSetupViewProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondConfirmViewProtocol: StakingUnbondConfirmViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRebondSetupViewProtocol + typealias MocksType = StakingUnbondConfirmViewProtocol - typealias Stubbing = __StubbingProxy_StakingRebondSetupViewProtocol - typealias Verification = __VerificationProxy_StakingRebondSetupViewProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondConfirmViewProtocol + typealias Verification = __VerificationProxy_StakingUnbondConfirmViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRebondSetupViewProtocol? + private var __defaultImplStub: StakingUnbondConfirmViewProtocol? - func enableDefaultImplementation(_ stub: StakingRebondSetupViewProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondConfirmViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -46288,367 +45572,160 @@ import SoraFoundation } - - - - - - - func didReceiveAsset(viewModel: LocalizableResource) { - - return cuckoo_manager.call("didReceiveAsset(viewModel: LocalizableResource)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) - - } - - - - func didReceiveFee(viewModel: LocalizableResource?) { - - return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) - - } - - - - func didReceiveInput(viewModel: LocalizableResource) { - - return cuckoo_manager.call("didReceiveInput(viewModel: LocalizableResource)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) - - } - - - - func didReceiveTransferable(viewModel: LocalizableResource?) { - - return cuckoo_manager.call("didReceiveTransferable(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveTransferable(viewModel: viewModel)) - - } - - - - public func applyLocalization() { - - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.applyLocalization()) - - } - - - struct __StubbingProxy_StakingRebondSetupViewProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") - } - - - func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "didReceiveAsset(viewModel: LocalizableResource)", parameterMatchers: matchers)) - } - - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) - } - - func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "didReceiveInput(viewModel: LocalizableResource)", parameterMatchers: matchers)) - } - - func didReceiveTransferable(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "didReceiveTransferable(viewModel: LocalizableResource?)", parameterMatchers: matchers)) - } - - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRebondSetupViewProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - - @discardableResult - func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAsset(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveInput(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveTransferable(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveTransferable(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class StakingRebondSetupViewProtocolStub: StakingRebondSetupViewProtocol { - - var isSetup: Bool { + var loadableContentView: UIView! { get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) } } - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } - - - public var localizationManager: LocalizationManagerProtocol? { + var shouldDisableInteractionWhenLoading: Bool { get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) } - set { } - - } - - - - - - - - func didReceiveAsset(viewModel: LocalizableResource) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(viewModel: LocalizableResource?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveInput(viewModel: LocalizableResource) { - return DefaultValueRegistry.defaultValue(for: (Void).self) } + - - func didReceiveTransferable(viewModel: LocalizableResource?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - public func applyLocalization() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel) { + + return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) + } -} - - - - class MockStakingRebondSetupPresenterProtocol: StakingRebondSetupPresenterProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRebondSetupPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingRebondSetupPresenterProtocol - typealias Verification = __VerificationProxy_StakingRebondSetupPresenterProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: StakingRebondSetupPresenterProtocol? - - func enableDefaultImplementation(_ stub: StakingRebondSetupPresenterProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceiveAmount(viewModel: LocalizableResource) { + + return cuckoo_manager.call("didReceiveAmount(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAmount(viewModel: viewModel)) + } - - - + func didReceiveFee(viewModel: LocalizableResource?) { + + return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) + + } - func setup() { + func didReceiveBonding(duration: LocalizableResource) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveBonding(duration: LocalizableResource)", + parameters: (duration), + escapingParameters: (duration), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceiveBonding(duration: duration)) } - func selectAmountPercentage(_ percentage: Float) { + func didSetShouldResetRewardsDestination(value: Bool) { - return cuckoo_manager.call("selectAmountPercentage(_: Float)", - parameters: (percentage), - escapingParameters: (percentage), + return cuckoo_manager.call("didSetShouldResetRewardsDestination(value: Bool)", + parameters: (value), + escapingParameters: (value), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectAmountPercentage(percentage)) + defaultCall: __defaultImplStub!.didSetShouldResetRewardsDestination(value: value)) } - func updateAmount(_ newValue: Decimal) { + public func applyLocalization() { - return cuckoo_manager.call("updateAmount(_: Decimal)", - parameters: (newValue), - escapingParameters: (newValue), + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.updateAmount(newValue)) + defaultCall: __defaultImplStub!.applyLocalization()) } - func proceed() { + func didStartLoading() { - return cuckoo_manager.call("proceed()", + return cuckoo_manager.call("didStartLoading()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.didStartLoading()) } - func close() { + func didStopLoading() { - return cuckoo_manager.call("close()", + return cuckoo_manager.call("didStopLoading()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close()) + defaultCall: __defaultImplStub!.didStopLoading()) } - struct __StubbingProxy_StakingRebondSetupPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondConfirmViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -46656,34 +45733,74 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func selectAmountPercentage(_ percentage: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Float)> where M1.MatchedType == Float { - let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "selectAmountPercentage(_: Float)", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func updateAmount(_ newValue: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "updateAmount(_: Decimal)", parameterMatchers: matchers)) + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + } + + + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingUnbondConfirmViewModel)> where M1.MatchedType == StakingUnbondConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel)", parameterMatchers: matchers)) + } + + func didReceiveAmount(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didReceiveAmount(viewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + } + + func didReceiveBonding(duration: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: duration) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didReceiveBonding(duration: LocalizableResource)", parameterMatchers: matchers)) + } + + func didSetShouldResetRewardsDestination(value: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: value) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didSetShouldResetRewardsDestination(value: Bool)", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } - func close() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupPresenterProtocol.self, method: "close()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRebondSetupPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondConfirmViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -46695,199 +45812,182 @@ import SoraFoundation } + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingUnbondConfirmViewModel), Void> where M1.MatchedType == StakingUnbondConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectAmountPercentage(_ percentage: M1) -> Cuckoo.__DoNotUse<(Float), Void> where M1.MatchedType == Float { - let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] - return cuckoo_manager.verify("selectAmountPercentage(_: Float)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAmount(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAmount(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func updateAmount(_ newValue: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] - return cuckoo_manager.verify("updateAmount(_: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { + func didReceiveBonding(duration: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: duration) { $0 }] + return cuckoo_manager.verify("didReceiveBonding(duration: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didSetShouldResetRewardsDestination(value: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: value) { $0 }] + return cuckoo_manager.verify("didSetShouldResetRewardsDestination(value: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func close() -> Cuckoo.__DoNotUse<(), Void> { + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("close()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRebondSetupPresenterProtocolStub: StakingRebondSetupPresenterProtocol { - - + class StakingUnbondConfirmViewProtocolStub: StakingUnbondConfirmViewProtocol { + - + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + - - func selectAmountPercentage(_ percentage: Float) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + } + - - func updateAmount(_ newValue: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + } + - - func proceed() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + } + + + + - func close() { + func didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockStakingRebondSetupInteractorInputProtocol: StakingRebondSetupInteractorInputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRebondSetupInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingRebondSetupInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingRebondSetupInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: StakingRebondSetupInteractorInputProtocol? - - func enableDefaultImplementation(_ stub: StakingRebondSetupInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceiveAmount(viewModel: LocalizableResource) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - + func didReceiveFee(viewModel: LocalizableResource?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - + func didReceiveBonding(duration: LocalizableResource) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func estimateFee() { - - return cuckoo_manager.call("estimateFee()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.estimateFee()) - + func didSetShouldResetRewardsDestination(value: Bool) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - struct __StubbingProxy_StakingRebondSetupInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRebondSetupInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class StakingRebondSetupInteractorInputProtocolStub: StakingRebondSetupInteractorInputProtocol { - - + public func applyLocalization() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func setup() { + func didStartLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func estimateFee() { + func didStopLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -46895,19 +45995,19 @@ import SoraFoundation - class MockStakingRebondSetupInteractorOutputProtocol: StakingRebondSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondConfirmPresenterProtocol: StakingUnbondConfirmPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRebondSetupInteractorOutputProtocol + typealias MocksType = StakingUnbondConfirmPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingRebondSetupInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingRebondSetupInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondConfirmPresenterProtocol + typealias Verification = __VerificationProxy_StakingUnbondConfirmPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRebondSetupInteractorOutputProtocol? + private var __defaultImplStub: StakingUnbondConfirmPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingRebondSetupInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondConfirmPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -46920,136 +46020,76 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { - - return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) - - } - - - - func didReceiveFee(result: Result) { - - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) - - } - - - - func didReceivePriceData(result: Result) { - - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) - - } - - - - func didReceiveController(result: Result) { + func setup() { - return cuckoo_manager.call("didReceiveController(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveController(result: result)) + defaultCall: __defaultImplStub!.setup()) } - func didReceiveStashItem(result: Result) { + func confirm() { - return cuckoo_manager.call("didReceiveStashItem(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("confirm()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) + defaultCall: __defaultImplStub!.confirm()) } - func didReceiveAccountInfo(result: Result) { + func selectAccount() { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("selectAccount()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.selectAccount()) } - - struct __StubbingProxy_StakingRebondSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + + struct __StubbingProxy_StakingUnbondConfirmPresenterProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager } - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) - } - func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) } - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) + func selectAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmPresenterProtocol.self, method: "selectAccount()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRebondSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondConfirmPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -47064,45 +46104,27 @@ import SoraFoundation @discardableResult - func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func confirm() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectAccount() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("selectAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRebondSetupInteractorOutputProtocolStub: StakingRebondSetupInteractorOutputProtocol { + class StakingUnbondConfirmPresenterProtocolStub: StakingUnbondConfirmPresenterProtocol { @@ -47110,37 +46132,19 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceivePriceData(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveController(result: Result) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStashItem(result: Result) { + func confirm() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveAccountInfo(result: Result) { + func selectAccount() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -47148,19 +46152,19 @@ import SoraFoundation - class MockStakingRebondSetupWireframeProtocol: StakingRebondSetupWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondConfirmInteractorInputProtocol: StakingUnbondConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRebondSetupWireframeProtocol + typealias MocksType = StakingUnbondConfirmInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingRebondSetupWireframeProtocol - typealias Verification = __VerificationProxy_StakingRebondSetupWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondConfirmInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingUnbondConfirmInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRebondSetupWireframeProtocol? + private var __defaultImplStub: StakingUnbondConfirmInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingRebondSetupWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondConfirmInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -47173,66 +46177,51 @@ import SoraFoundation - func proceed(view parameter0: StakingRebondSetupViewProtocol?, amount parameter1: Decimal) { - - return cuckoo_manager.call("proceed(view: StakingRebondSetupViewProtocol?, amount: Decimal)", - parameters: (parameter0, parameter1), - escapingParameters: (parameter0, parameter1), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.proceed(view: parameter0, amount: parameter1)) - - } - - - - func close(view: StakingRebondSetupViewProtocol?) { + func setup() { - return cuckoo_manager.call("close(view: StakingRebondSetupViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close(view: view)) + defaultCall: __defaultImplStub!.setup()) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func submit(for amount: Decimal, resettingRewardDestination: Bool, chilling: Bool) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("submit(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", + parameters: (amount, resettingRewardDestination, chilling), + escapingParameters: (amount, resettingRewardDestination, chilling), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.submit(for: amount, resettingRewardDestination: resettingRewardDestination, chilling: chilling)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func estimateFee(for amount: Decimal, resettingRewardDestination: Bool, chilling: Bool) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("estimateFee(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", + parameters: (amount, resettingRewardDestination, chilling), + escapingParameters: (amount, resettingRewardDestination, chilling), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.estimateFee(for: amount, resettingRewardDestination: resettingRewardDestination, chilling: chilling)) } - struct __StubbingProxy_StakingRebondSetupWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -47240,29 +46229,24 @@ import SoraFoundation } - func proceed(view parameter0: M1, amount parameter1: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRebondSetupViewProtocol?, Decimal)> where M1.OptionalMatchedType == StakingRebondSetupViewProtocol, M2.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(StakingRebondSetupViewProtocol?, Decimal)>] = [wrap(matchable: parameter0) { $0.0 }, wrap(matchable: parameter1) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupWireframeProtocol.self, method: "proceed(view: StakingRebondSetupViewProtocol?, amount: Decimal)", parameterMatchers: matchers)) - } - - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRebondSetupViewProtocol?)> where M1.OptionalMatchedType == StakingRebondSetupViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingRebondSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupWireframeProtocol.self, method: "close(view: StakingRebondSetupViewProtocol?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func submit(for amount: M1, resettingRewardDestination: M2, chilling: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal, Bool, Bool)> where M1.MatchedType == Decimal, M2.MatchedType == Bool, M3.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Decimal, Bool, Bool)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: resettingRewardDestination) { $0.1 }, wrap(matchable: chilling) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorInputProtocol.self, method: "submit(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRebondSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func estimateFee(for amount: M1, resettingRewardDestination: M2, chilling: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal, Bool, Bool)> where M1.MatchedType == Decimal, M2.MatchedType == Bool, M3.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Decimal, Bool, Bool)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: resettingRewardDestination) { $0.1 }, wrap(matchable: chilling) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorInputProtocol.self, method: "estimateFee(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRebondSetupWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -47277,33 +46261,27 @@ import SoraFoundation @discardableResult - func proceed(view parameter0: M1, amount parameter1: M2) -> Cuckoo.__DoNotUse<(StakingRebondSetupViewProtocol?, Decimal), Void> where M1.OptionalMatchedType == StakingRebondSetupViewProtocol, M2.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(StakingRebondSetupViewProtocol?, Decimal)>] = [wrap(matchable: parameter0) { $0.0 }, wrap(matchable: parameter1) { $0.1 }] - return cuckoo_manager.verify("proceed(view: StakingRebondSetupViewProtocol?, amount: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(StakingRebondSetupViewProtocol?), Void> where M1.OptionalMatchedType == StakingRebondSetupViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingRebondSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: StakingRebondSetupViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func submit(for amount: M1, resettingRewardDestination: M2, chilling: M3) -> Cuckoo.__DoNotUse<(Decimal, Bool, Bool), Void> where M1.MatchedType == Decimal, M2.MatchedType == Bool, M3.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Decimal, Bool, Bool)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: resettingRewardDestination) { $0.1 }, wrap(matchable: chilling) { $0.2 }] + return cuckoo_manager.verify("submit(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee(for amount: M1, resettingRewardDestination: M2, chilling: M3) -> Cuckoo.__DoNotUse<(Decimal, Bool, Bool), Void> where M1.MatchedType == Decimal, M2.MatchedType == Bool, M3.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Decimal, Bool, Bool)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: resettingRewardDestination) { $0.1 }, wrap(matchable: chilling) { $0.2 }] + return cuckoo_manager.verify("estimateFee(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRebondSetupWireframeProtocolStub: StakingRebondSetupWireframeProtocol { + class StakingUnbondConfirmInteractorInputProtocolStub: StakingUnbondConfirmInteractorInputProtocol { @@ -47311,234 +46289,246 @@ import SoraFoundation - func proceed(view parameter0: StakingRebondSetupViewProtocol?, amount parameter1: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func close(view: StakingRebondSetupViewProtocol?) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func submit(for amount: Decimal, resettingRewardDestination: Bool, chilling: Bool) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func estimateFee(for amount: Decimal, resettingRewardDestination: Bool, chilling: Bool) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import BigInt -import Foundation -import SoraFoundation - - class MockStakingRedeemViewProtocol: StakingRedeemViewProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondConfirmInteractorOutputProtocol: StakingUnbondConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRedeemViewProtocol + typealias MocksType = StakingUnbondConfirmInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingRedeemViewProtocol - typealias Verification = __VerificationProxy_StakingRedeemViewProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondConfirmInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingUnbondConfirmInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRedeemViewProtocol? + private var __defaultImplStub: StakingUnbondConfirmInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingRedeemViewProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondConfirmInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + + + func didReceiveStakingLedger(result: Result) { + + return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func didReceiveAccountInfo(result: Result) { + + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } + func didReceivePriceData(result: Result) { - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } + func didReceiveExistentialDeposit(result: Result) { + + return cuckoo_manager.call("didReceiveExistentialDeposit(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveExistentialDeposit(result: result)) } - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } + func didReceiveFee(result: Result) { + + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - - + + func didReceiveController(result: Result) { + + return cuckoo_manager.call("didReceiveController(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveController(result: result)) + + } - func didReceiveConfirmation(viewModel: StakingRedeemViewModel) { + func didReceiveStashItem(result: Result) { - return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingRedeemViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didReceiveStashItem(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) } - func didReceiveAmount(viewModel: LocalizableResource) { + func didReceivePayee(result: Result) { - return cuckoo_manager.call("didReceiveAmount(viewModel: LocalizableResource)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didReceivePayee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAmount(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceivePayee(result: result)) } - func didReceiveFee(viewModel: LocalizableResource?) { + func didReceiveMinBonded(result: Result) { - return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didReceiveMinBonded(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveMinBonded(result: result)) } - public func applyLocalization() { + func didReceiveNomination(result: Result) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveNomination(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.didReceiveNomination(result: result)) } - func didStartLoading() { + func didReceiveBondingDuration(result: Result) { - return cuckoo_manager.call("didStartLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveBondingDuration(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.didReceiveBondingDuration(result: result)) } - func didStopLoading() { + func didReceiveStakingDuration(result: Result) { - return cuckoo_manager.call("didStopLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStakingDuration(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.didReceiveStakingDuration(result: result)) + + } + + + + func didSubmitUnbonding(result: Result) { + + return cuckoo_manager.call("didSubmitUnbonding(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didSubmitUnbonding(result: result)) } - struct __StubbingProxy_StakingRedeemViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -47546,64 +46536,74 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") + func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) } - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } - - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") + func didReceiveExistentialDeposit(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveExistentialDeposit(result: Result)", parameterMatchers: matchers)) } + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + } - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) } + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + } - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRedeemViewModel)> where M1.MatchedType == StakingRedeemViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingRedeemViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingRedeemViewModel)", parameterMatchers: matchers)) + func didReceivePayee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceivePayee(result: Result)", parameterMatchers: matchers)) } - func didReceiveAmount(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didReceiveAmount(viewModel: LocalizableResource)", parameterMatchers: matchers)) + func didReceiveMinBonded(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveMinBonded(result: Result)", parameterMatchers: matchers)) } - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + func didReceiveNomination(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveNomination(result: Result)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func didReceiveBondingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveBondingDuration(result: Result)", parameterMatchers: matchers)) } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + func didReceiveStakingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveStakingDuration(result: Result)", parameterMatchers: matchers)) } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + func didSubmitUnbonding(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didSubmitUnbonding(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRedeemViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -47615,158 +46615,170 @@ import SoraFoundation } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveExistentialDeposit(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveExistentialDeposit(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - + @discardableResult + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } @discardableResult - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingRedeemViewModel), Void> where M1.MatchedType == StakingRedeemViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingRedeemViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingRedeemViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePayee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePayee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveAmount(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAmount(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveMinBonded(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinBonded(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveNomination(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveNomination(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBondingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBondingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStakingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didSubmitUnbonding(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didSubmitUnbonding(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRedeemViewProtocolStub: StakingRedeemViewProtocol { - + class StakingUnbondConfirmInteractorOutputProtocolStub: StakingUnbondConfirmInteractorOutputProtocol { + - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + + + + + func didReceiveStakingLedger(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - + + func didReceiveAccountInfo(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - + + func didReceivePriceData(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - + + func didReceiveExistentialDeposit(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + + func didReceiveFee(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - + + func didReceiveController(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func didReceiveConfirmation(viewModel: StakingRedeemViewModel) { + func didReceiveStashItem(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveAmount(viewModel: LocalizableResource) { + func didReceivePayee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFee(viewModel: LocalizableResource?) { + func didReceiveMinBonded(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func didReceiveNomination(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartLoading() { + func didReceiveBondingDuration(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStopLoading() { + func didReceiveStakingDuration(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didSubmitUnbonding(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -47774,19 +46786,19 @@ import SoraFoundation - class MockStakingRedeemPresenterProtocol: StakingRedeemPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondConfirmWireframeProtocol: StakingUnbondConfirmWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRedeemPresenterProtocol + typealias MocksType = StakingUnbondConfirmWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingRedeemPresenterProtocol - typealias Verification = __VerificationProxy_StakingRedeemPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondConfirmWireframeProtocol + typealias Verification = __VerificationProxy_StakingUnbondConfirmWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRedeemPresenterProtocol? + private var __defaultImplStub: StakingUnbondConfirmWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingRedeemPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondConfirmWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -47799,51 +46811,51 @@ import SoraFoundation - func setup() { + func complete(from view: StakingUnbondConfirmViewProtocol?) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("complete(from: StakingUnbondConfirmViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.complete(from: view)) } - func confirm() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("confirm()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.confirm()) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func selectAccount() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("selectAccount()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectAccount()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_StakingRedeemPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondConfirmWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -47851,24 +46863,24 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingUnbondConfirmViewProtocol?)> where M1.OptionalMatchedType == StakingUnbondConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmWireframeProtocol.self, method: "complete(from: StakingUnbondConfirmViewProtocol?)", parameterMatchers: matchers)) } - func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func selectAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemPresenterProtocol.self, method: "selectAccount()", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRedeemPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondConfirmWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -47883,27 +46895,27 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingUnbondConfirmViewProtocol?), Void> where M1.OptionalMatchedType == StakingUnbondConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(from: StakingUnbondConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func confirm() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectAccount() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRedeemPresenterProtocolStub: StakingRedeemPresenterProtocol { + class StakingUnbondConfirmWireframeProtocolStub: StakingUnbondConfirmWireframeProtocol { @@ -47911,96 +46923,201 @@ import SoraFoundation - func setup() { + func complete(from view: StakingUnbondConfirmViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func confirm() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectAccount() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet - class MockStakingRedeemInteractorInputProtocol: StakingRedeemInteractorInputProtocol, Cuckoo.ProtocolMock { +import BigInt +import CommonWallet +import Foundation +import SoraFoundation + + + class MockStakingUnbondSetupViewProtocol: StakingUnbondSetupViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRedeemInteractorInputProtocol + typealias MocksType = StakingUnbondSetupViewProtocol - typealias Stubbing = __StubbingProxy_StakingRedeemInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingRedeemInteractorInputProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondSetupViewProtocol + typealias Verification = __VerificationProxy_StakingUnbondSetupViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRedeemInteractorInputProtocol? + private var __defaultImplStub: StakingUnbondSetupViewProtocol? - func enableDefaultImplementation(_ stub: StakingRedeemInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondSetupViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + + } + - func setup() { + func didReceiveAsset(viewModel: LocalizableResource) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveAsset(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) } - func submitForStash(_ stashAddress: AccountAddress) { + func didReceiveFee(viewModel: LocalizableResource?) { - return cuckoo_manager.call("submitForStash(_: AccountAddress)", - parameters: (stashAddress), - escapingParameters: (stashAddress), + return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.submitForStash(stashAddress)) + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) } - func estimateFeeForStash(_ stashAddress: AccountAddress) { + func didReceiveInput(viewModel: LocalizableResource) { - return cuckoo_manager.call("estimateFeeForStash(_: AccountAddress)", - parameters: (stashAddress), - escapingParameters: (stashAddress), + return cuckoo_manager.call("didReceiveInput(viewModel: LocalizableResource)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFeeForStash(stashAddress)) + defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) + + } + + + + func didReceiveTransferable(viewModel: LocalizableResource?) { + + return cuckoo_manager.call("didReceiveTransferable(viewModel: LocalizableResource?)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveTransferable(viewModel: viewModel)) + + } + + + + func didReceiveBonding(duration: LocalizableResource) { + + return cuckoo_manager.call("didReceiveBonding(duration: LocalizableResource)", + parameters: (duration), + escapingParameters: (duration), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveBonding(duration: duration)) + + } + + + + public func applyLocalization() { + + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.applyLocalization()) } - struct __StubbingProxy_StakingRedeemInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondSetupViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -48008,24 +47125,54 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func submitForStash(_ stashAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: stashAddress) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorInputProtocol.self, method: "submitForStash(_: AccountAddress)", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func estimateFeeForStash(_ stashAddress: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: stashAddress) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorInputProtocol.self, method: "estimateFeeForStash(_: AccountAddress)", parameterMatchers: matchers)) + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") + } + + + func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveAsset(viewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + } + + func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveInput(viewModel: LocalizableResource)", parameterMatchers: matchers)) + } + + func didReceiveTransferable(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveTransferable(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + } + + func didReceiveBonding(duration: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: duration) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveBonding(duration: LocalizableResource)", parameterMatchers: matchers)) + } + + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRedeemInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondSetupViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -48037,30 +47184,92 @@ import SoraFoundation } + + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAsset(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func submitForStash(_ stashAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: stashAddress) { $0 }] - return cuckoo_manager.verify("submitForStash(_: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func estimateFeeForStash(_ stashAddress: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { - let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: stashAddress) { $0 }] - return cuckoo_manager.verify("estimateFeeForStash(_: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveInput(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveTransferable(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveTransferable(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveBonding(duration: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { + let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: duration) { $0 }] + return cuckoo_manager.verify("didReceiveBonding(duration: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRedeemInteractorInputProtocolStub: StakingRedeemInteractorInputProtocol { + class StakingUnbondSetupViewProtocolStub: StakingUnbondSetupViewProtocol { + + + + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } @@ -48068,19 +47277,37 @@ import SoraFoundation - func setup() { + func didReceiveAsset(viewModel: LocalizableResource) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func submitForStash(_ stashAddress: AccountAddress) { + func didReceiveFee(viewModel: LocalizableResource?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func estimateFeeForStash(_ stashAddress: AccountAddress) { + func didReceiveInput(viewModel: LocalizableResource) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveTransferable(viewModel: LocalizableResource?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveBonding(duration: LocalizableResource) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -48088,19 +47315,19 @@ import SoraFoundation - class MockStakingRedeemInteractorOutputProtocol: StakingRedeemInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondSetupPresenterProtocol: StakingUnbondSetupPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRedeemInteractorOutputProtocol + typealias MocksType = StakingUnbondSetupPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingRedeemInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingRedeemInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondSetupPresenterProtocol + typealias Verification = __VerificationProxy_StakingUnbondSetupPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRedeemInteractorOutputProtocol? + private var __defaultImplStub: StakingUnbondSetupPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingRedeemInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondSetupPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -48113,141 +47340,81 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { - - return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) - - } - - - - func didReceiveAccountInfo(result: Result) { - - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) - - } - - - - func didReceivePriceData(result: Result) { - - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) - - } - - - - func didReceiveExistentialDeposit(result: Result) { - - return cuckoo_manager.call("didReceiveExistentialDeposit(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveExistentialDeposit(result: result)) - - } - - - - func didReceiveFee(result: Result) { + func setup() { - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + defaultCall: __defaultImplStub!.setup()) } - func didReceiveController(result: Result) { + func selectAmountPercentage(_ percentage: Float) { - return cuckoo_manager.call("didReceiveController(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("selectAmountPercentage(_: Float)", + parameters: (percentage), + escapingParameters: (percentage), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveController(result: result)) + defaultCall: __defaultImplStub!.selectAmountPercentage(percentage)) } - func didReceiveStashItem(result: Result) { + func updateAmount(_ newValue: Decimal) { - return cuckoo_manager.call("didReceiveStashItem(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("updateAmount(_: Decimal)", + parameters: (newValue), + escapingParameters: (newValue), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) + defaultCall: __defaultImplStub!.updateAmount(newValue)) } - func didReceiveActiveEra(result: Result) { + func proceed() { - return cuckoo_manager.call("didReceiveActiveEra(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("proceed()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveActiveEra(result: result)) + defaultCall: __defaultImplStub!.proceed()) } - func didSubmitRedeeming(result: Result) { + func close() { - return cuckoo_manager.call("didSubmitRedeeming(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("close()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSubmitRedeeming(result: result)) + defaultCall: __defaultImplStub!.close()) } - struct __StubbingProxy_StakingRedeemInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondSetupPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -48255,54 +47422,34 @@ import SoraFoundation } - func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveExistentialDeposit(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveExistentialDeposit(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) + func selectAmountPercentage(_ percentage: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Float)> where M1.MatchedType == Float { + let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "selectAmountPercentage(_: Float)", parameterMatchers: matchers)) } - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + func updateAmount(_ newValue: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "updateAmount(_: Decimal)", parameterMatchers: matchers)) } - func didReceiveActiveEra(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didReceiveActiveEra(result: Result)", parameterMatchers: matchers)) + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } - func didSubmitRedeeming(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemInteractorOutputProtocol.self, method: "didSubmitRedeeming(result: Result)", parameterMatchers: matchers)) + func close() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "close()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRedeemInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondSetupPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -48317,63 +47464,39 @@ import SoraFoundation @discardableResult - func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveExistentialDeposit(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveExistentialDeposit(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectAmountPercentage(_ percentage: M1) -> Cuckoo.__DoNotUse<(Float), Void> where M1.MatchedType == Float { + let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] + return cuckoo_manager.verify("selectAmountPercentage(_: Float)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func updateAmount(_ newValue: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] + return cuckoo_manager.verify("updateAmount(_: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveActiveEra(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveActiveEra(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didSubmitRedeeming(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didSubmitRedeeming(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("close()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRedeemInteractorOutputProtocolStub: StakingRedeemInteractorOutputProtocol { + class StakingUnbondSetupPresenterProtocolStub: StakingUnbondSetupPresenterProtocol { @@ -48381,55 +47504,31 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceivePriceData(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveExistentialDeposit(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(result: Result) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveController(result: Result) { + func selectAmountPercentage(_ percentage: Float) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStashItem(result: Result) { + func updateAmount(_ newValue: Decimal) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveActiveEra(result: Result) { + func proceed() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didSubmitRedeeming(result: Result) { + func close() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -48437,19 +47536,19 @@ import SoraFoundation - class MockStakingRedeemWireframeProtocol: StakingRedeemWireframeProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondSetupInteractorInputProtocol: StakingUnbondSetupInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRedeemWireframeProtocol + typealias MocksType = StakingUnbondSetupInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingRedeemWireframeProtocol - typealias Verification = __VerificationProxy_StakingRedeemWireframeProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondSetupInteractorInputProtocol + typealias Verification = __VerificationProxy_StakingUnbondSetupInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRedeemWireframeProtocol? + private var __defaultImplStub: StakingUnbondSetupInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingRedeemWireframeProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondSetupInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -48462,51 +47561,36 @@ import SoraFoundation - func complete(from view: StakingRedeemViewProtocol?) { - - return cuckoo_manager.call("complete(from: StakingRedeemViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.complete(from: view)) - - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func setup() { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.setup()) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func estimateFee() { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("estimateFee()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.estimateFee()) } - struct __StubbingProxy_StakingRedeemWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondSetupInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -48514,24 +47598,19 @@ import SoraFoundation } - func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRedeemViewProtocol?)> where M1.OptionalMatchedType == StakingRedeemViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingRedeemViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemWireframeProtocol.self, method: "complete(from: StakingRedeemViewProtocol?)", parameterMatchers: matchers)) - } - - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRedeemWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRedeemWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondSetupInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -48546,27 +47625,21 @@ import SoraFoundation @discardableResult - func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingRedeemViewProtocol?), Void> where M1.OptionalMatchedType == StakingRedeemViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingRedeemViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(from: StakingRedeemViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRedeemWireframeProtocolStub: StakingRedeemWireframeProtocol { + class StakingUnbondSetupInteractorInputProtocolStub: StakingUnbondSetupInteractorInputProtocol { @@ -48574,211 +47647,180 @@ import SoraFoundation - func complete(from view: StakingRedeemViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func estimateFee() { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import SoraFoundation - - class MockStakingRewardDestConfirmViewProtocol: StakingRewardDestConfirmViewProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondSetupInteractorOutputProtocol: StakingUnbondSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDestConfirmViewProtocol + typealias MocksType = StakingUnbondSetupInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmViewProtocol - typealias Verification = __VerificationProxy_StakingRewardDestConfirmViewProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondSetupInteractorOutputProtocol + typealias Verification = __VerificationProxy_StakingUnbondSetupInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDestConfirmViewProtocol? + private var __defaultImplStub: StakingUnbondSetupInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDestConfirmViewProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondSetupInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } + - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func didReceiveStakingLedger(result: Result) { + + return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) } - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } + func didReceiveAccountInfo(result: Result) { - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - var loadableContentView: UIView! { - get { - return cuckoo_manager.getter("loadableContentView", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.loadableContentView) - } + func didReceivePriceData(result: Result) { + + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - var shouldDisableInteractionWhenLoading: Bool { - get { - return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) - } + func didReceiveBondingDuration(result: Result) { + + return cuckoo_manager.call("didReceiveBondingDuration(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveBondingDuration(result: result)) } - - - - - func didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel) { + func didReceiveExistentialDeposit(result: Result) { - return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didReceiveExistentialDeposit(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveExistentialDeposit(result: result)) } - func didReceiveFee(viewModel: LocalizableResource?) { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - public func applyLocalization() { + func didReceiveController(result: Result) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveController(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.didReceiveController(result: result)) } - func didStartLoading() { + func didReceiveStashItem(result: Result) { - return cuckoo_manager.call("didStartLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStashItem(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStartLoading()) + defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) } - func didStopLoading() { + func didReceiveStakingDuration(result: Result) { - return cuckoo_manager.call("didStopLoading()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveStakingDuration(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didStopLoading()) + defaultCall: __defaultImplStub!.didReceiveStakingDuration(result: result)) } - struct __StubbingProxy_StakingRewardDestConfirmViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -48786,59 +47828,54 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) } - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView") + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) } - - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + func didReceiveBondingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveBondingDuration(result: Result)", parameterMatchers: matchers)) } - - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRewardDestConfirmViewModel)> where M1.MatchedType == StakingRewardDestConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel)", parameterMatchers: matchers)) + func didReceiveExistentialDeposit(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveExistentialDeposit(result: Result)", parameterMatchers: matchers)) } - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) } - func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) } - func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + func didReceiveStakingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveStakingDuration(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestConfirmViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -48850,146 +47887,122 @@ import SoraFoundation } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveBondingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBondingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - - @discardableResult - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingRewardDestConfirmViewModel), Void> where M1.MatchedType == StakingRewardDestConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveExistentialDeposit(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveExistentialDeposit(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveStakingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveStakingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDestConfirmViewProtocolStub: StakingRewardDestConfirmViewProtocol { - - + class StakingUnbondSetupInteractorOutputProtocolStub: StakingUnbondSetupInteractorOutputProtocol { - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - - } - + + - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - - } - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - + func didReceiveStakingLedger(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var loadableContentView: UIView! { - get { - return DefaultValueRegistry.defaultValue(for: (UIView?).self) - } - + + func didReceiveAccountInfo(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var shouldDisableInteractionWhenLoading: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + + func didReceivePriceData(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - + + func didReceiveBondingDuration(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func didReceiveConfirmation(viewModel: StakingRewardDestConfirmViewModel) { + func didReceiveExistentialDeposit(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFee(viewModel: LocalizableResource?) { + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func didReceiveController(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStartLoading() { + func didReceiveStashItem(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didStopLoading() { + func didReceiveStakingDuration(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -48997,19 +48010,19 @@ import SoraFoundation - class MockStakingRewardDestConfirmPresenterProtocol: StakingRewardDestConfirmPresenterProtocol, Cuckoo.ProtocolMock { + class MockStakingUnbondSetupWireframeProtocol: StakingUnbondSetupWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDestConfirmPresenterProtocol + typealias MocksType = StakingUnbondSetupWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmPresenterProtocol - typealias Verification = __VerificationProxy_StakingRewardDestConfirmPresenterProtocol + typealias Stubbing = __StubbingProxy_StakingUnbondSetupWireframeProtocol + typealias Verification = __VerificationProxy_StakingUnbondSetupWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDestConfirmPresenterProtocol? + private var __defaultImplStub: StakingUnbondSetupWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDestConfirmPresenterProtocol) { + func enableDefaultImplementation(_ stub: StakingUnbondSetupWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -49022,66 +48035,66 @@ import SoraFoundation - func setup() { + func close(view: StakingUnbondSetupViewProtocol?) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("close(view: StakingUnbondSetupViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.close(view: view)) } - func confirm() { + func proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal) { - return cuckoo_manager.call("confirm()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal)", + parameters: (view, amount), + escapingParameters: (view, amount), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.confirm()) + defaultCall: __defaultImplStub!.proceed(view: view, amount: amount)) } - func presentSenderAccountOptions() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("presentSenderAccountOptions()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentSenderAccountOptions()) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func presentPayoutAccountOptions() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("presentPayoutAccountOptions()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentPayoutAccountOptions()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_StakingRewardDestConfirmPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_StakingUnbondSetupWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -49089,29 +48102,29 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingUnbondSetupViewProtocol?)> where M1.OptionalMatchedType == StakingUnbondSetupViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupWireframeProtocol.self, method: "close(view: StakingUnbondSetupViewProtocol?)", parameterMatchers: matchers)) } - func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + func proceed(view: M1, amount: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingUnbondSetupViewProtocol?, Decimal)> where M1.OptionalMatchedType == StakingUnbondSetupViewProtocol, M2.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondSetupViewProtocol?, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: amount) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupWireframeProtocol.self, method: "proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal)", parameterMatchers: matchers)) } - func presentSenderAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmPresenterProtocol.self, method: "presentSenderAccountOptions()", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func presentPayoutAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmPresenterProtocol.self, method: "presentPayoutAccountOptions()", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestConfirmPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_StakingUnbondSetupWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -49126,33 +48139,33 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func close(view: M1) -> Cuckoo.__DoNotUse<(StakingUnbondSetupViewProtocol?), Void> where M1.OptionalMatchedType == StakingUnbondSetupViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("close(view: StakingUnbondSetupViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func confirm() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed(view: M1, amount: M2) -> Cuckoo.__DoNotUse<(StakingUnbondSetupViewProtocol?, Decimal), Void> where M1.OptionalMatchedType == StakingUnbondSetupViewProtocol, M2.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondSetupViewProtocol?, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: amount) { $0.1 }] + return cuckoo_manager.verify("proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentSenderAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentSenderAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentPayoutAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("presentPayoutAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDestConfirmPresenterProtocolStub: StakingRewardDestConfirmPresenterProtocol { + class StakingUnbondSetupWireframeProtocolStub: StakingUnbondSetupWireframeProtocol { @@ -49160,102 +48173,105 @@ import SoraFoundation - func setup() { + func close(view: StakingUnbondSetupViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func confirm() { + func proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentSenderAccountOptions() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentPayoutAccountOptions() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet - class MockStakingRewardDestConfirmInteractorInputProtocol: StakingRewardDestConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { +import SoraFoundation + + + class MockUsernameSetupViewProtocol: UsernameSetupViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDestConfirmInteractorInputProtocol + typealias MocksType = UsernameSetupViewProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingRewardDestConfirmInteractorInputProtocol + typealias Stubbing = __StubbingProxy_UsernameSetupViewProtocol + typealias Verification = __VerificationProxy_UsernameSetupViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDestConfirmInteractorInputProtocol? + private var __defaultImplStub: UsernameSetupViewProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDestConfirmInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: UsernameSetupViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - - - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } - func estimateFee(for rewardDestination: RewardDestination, stashItem: StashItem) { - - return cuckoo_manager.call("estimateFee(for: RewardDestination, stashItem: StashItem)", - parameters: (rewardDestination, stashItem), - escapingParameters: (rewardDestination, stashItem), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.estimateFee(for: rewardDestination, stashItem: stashItem)) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } + + + - func submit(rewardDestination: RewardDestination, for stashItem: StashItem) { + + func setInput(viewModel: InputViewModelProtocol) { - return cuckoo_manager.call("submit(rewardDestination: RewardDestination, for: StashItem)", - parameters: (rewardDestination, stashItem), - escapingParameters: (rewardDestination, stashItem), + return cuckoo_manager.call("setInput(viewModel: InputViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.submit(rewardDestination: rewardDestination, for: stashItem)) + defaultCall: __defaultImplStub!.setInput(viewModel: viewModel)) } - struct __StubbingProxy_StakingRewardDestConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_UsernameSetupViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -49263,24 +48279,24 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func estimateFee(for rewardDestination: M1, stashItem: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(RewardDestination, StashItem)> where M1.MatchedType == RewardDestination, M2.MatchedType == StashItem { - let matchers: [Cuckoo.ParameterMatcher<(RewardDestination, StashItem)>] = [wrap(matchable: rewardDestination) { $0.0 }, wrap(matchable: stashItem) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorInputProtocol.self, method: "estimateFee(for: RewardDestination, stashItem: StashItem)", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func submit(rewardDestination: M1, for stashItem: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(RewardDestination, StashItem)> where M1.MatchedType == RewardDestination, M2.MatchedType == StashItem { - let matchers: [Cuckoo.ParameterMatcher<(RewardDestination, StashItem)>] = [wrap(matchable: rewardDestination) { $0.0 }, wrap(matchable: stashItem) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorInputProtocol.self, method: "submit(rewardDestination: RewardDestination, for: StashItem)", parameterMatchers: matchers)) + + func setInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(InputViewModelProtocol)> where M1.MatchedType == InputViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupViewProtocol.self, method: "setInput(viewModel: InputViewModelProtocol)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_UsernameSetupViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -49292,50 +48308,54 @@ import SoraFoundation } - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func estimateFee(for rewardDestination: M1, stashItem: M2) -> Cuckoo.__DoNotUse<(RewardDestination, StashItem), Void> where M1.MatchedType == RewardDestination, M2.MatchedType == StashItem { - let matchers: [Cuckoo.ParameterMatcher<(RewardDestination, StashItem)>] = [wrap(matchable: rewardDestination) { $0.0 }, wrap(matchable: stashItem) { $0.1 }] - return cuckoo_manager.verify("estimateFee(for: RewardDestination, stashItem: StashItem)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + @discardableResult - func submit(rewardDestination: M1, for stashItem: M2) -> Cuckoo.__DoNotUse<(RewardDestination, StashItem), Void> where M1.MatchedType == RewardDestination, M2.MatchedType == StashItem { - let matchers: [Cuckoo.ParameterMatcher<(RewardDestination, StashItem)>] = [wrap(matchable: rewardDestination) { $0.0 }, wrap(matchable: stashItem) { $0.1 }] - return cuckoo_manager.verify("submit(rewardDestination: RewardDestination, for: StashItem)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setInput(viewModel: M1) -> Cuckoo.__DoNotUse<(InputViewModelProtocol), Void> where M1.MatchedType == InputViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("setInput(viewModel: InputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDestConfirmInteractorInputProtocolStub: StakingRewardDestConfirmInteractorInputProtocol { - - + class UsernameSetupViewProtocolStub: UsernameSetupViewProtocol { + - + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + } + - - func estimateFee(for rewardDestination: RewardDestination, stashItem: StashItem) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } + - func submit(rewardDestination: RewardDestination, for stashItem: StashItem) { + func setInput(viewModel: InputViewModelProtocol) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -49343,19 +48363,19 @@ import SoraFoundation - class MockStakingRewardDestConfirmInteractorOutputProtocol: StakingRewardDestConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockUsernameSetupPresenterProtocol: UsernameSetupPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDestConfirmInteractorOutputProtocol + typealias MocksType = UsernameSetupPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingRewardDestConfirmInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_UsernameSetupPresenterProtocol + typealias Verification = __VerificationProxy_UsernameSetupPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDestConfirmInteractorOutputProtocol? + private var __defaultImplStub: UsernameSetupPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDestConfirmInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: UsernameSetupPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -49368,96 +48388,36 @@ import SoraFoundation - func didReceiveFee(result: Result) { - - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) - - } - - - - func didReceivePriceData(result: Result) { - - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) - - } - - - - func didReceiveStashItem(result: Result) { - - return cuckoo_manager.call("didReceiveStashItem(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) - - } - - - - func didReceiveController(result: Result) { - - return cuckoo_manager.call("didReceiveController(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveController(result: result)) - - } - - - - func didReceiveAccountInfo(result: Result) { + func setup() { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.setup()) } - func didSubmitRewardDest(result: Result) { + func proceed() { - return cuckoo_manager.call("didSubmitRewardDest(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("proceed()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSubmitRewardDest(result: result)) + defaultCall: __defaultImplStub!.proceed()) } - struct __StubbingProxy_StakingRewardDestConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_UsernameSetupPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -49465,39 +48425,19 @@ import SoraFoundation } - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) - } - - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func didSubmitRewardDest(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmInteractorOutputProtocol.self, method: "didSubmitRewardDest(result: Result)", parameterMatchers: matchers)) + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_UsernameSetupPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -49512,45 +48452,21 @@ import SoraFoundation @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didSubmitRewardDest(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didSubmitRewardDest(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDestConfirmInteractorOutputProtocolStub: StakingRewardDestConfirmInteractorOutputProtocol { + class UsernameSetupPresenterProtocolStub: UsernameSetupPresenterProtocol { @@ -49558,37 +48474,13 @@ import SoraFoundation - func didReceiveFee(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceivePriceData(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveStashItem(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveController(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didSubmitRewardDest(result: Result) { + func proceed() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -49596,19 +48488,19 @@ import SoraFoundation - class MockStakingRewardDestConfirmWireframeProtocol: StakingRewardDestConfirmWireframeProtocol, Cuckoo.ProtocolMock { + class MockUsernameSetupWireframeProtocol: UsernameSetupWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDestConfirmWireframeProtocol + typealias MocksType = UsernameSetupWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestConfirmWireframeProtocol - typealias Verification = __VerificationProxy_StakingRewardDestConfirmWireframeProtocol + typealias Stubbing = __StubbingProxy_UsernameSetupWireframeProtocol + typealias Verification = __VerificationProxy_UsernameSetupWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDestConfirmWireframeProtocol? + private var __defaultImplStub: UsernameSetupWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDestConfirmWireframeProtocol) { + func enableDefaultImplementation(_ stub: UsernameSetupWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -49621,16 +48513,16 @@ import SoraFoundation - func complete(from view: StakingRewardDestConfirmViewProtocol?) { + func proceed(from view: UsernameSetupViewProtocol?, walletName: String) { - return cuckoo_manager.call("complete(from: StakingRewardDestConfirmViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("proceed(from: UsernameSetupViewProtocol?, walletName: String)", + parameters: (view, walletName), + escapingParameters: (view, walletName), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.complete(from: view)) + defaultCall: __defaultImplStub!.proceed(from: view, walletName: walletName)) } @@ -49665,7 +48557,7 @@ import SoraFoundation } - struct __StubbingProxy_StakingRewardDestConfirmWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_UsernameSetupWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -49673,24 +48565,24 @@ import SoraFoundation } - func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRewardDestConfirmViewProtocol?)> where M1.OptionalMatchedType == StakingRewardDestConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmWireframeProtocol.self, method: "complete(from: StakingRewardDestConfirmViewProtocol?)", parameterMatchers: matchers)) + func proceed(from view: M1, walletName: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(UsernameSetupViewProtocol?, String)> where M1.OptionalMatchedType == UsernameSetupViewProtocol, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(UsernameSetupViewProtocol?, String)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: walletName) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupWireframeProtocol.self, method: "proceed(from: UsernameSetupViewProtocol?, walletName: String)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestConfirmWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_UsernameSetupWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -49705,9 +48597,9 @@ import SoraFoundation @discardableResult - func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingRewardDestConfirmViewProtocol?), Void> where M1.OptionalMatchedType == StakingRewardDestConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(from: StakingRewardDestConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func proceed(from view: M1, walletName: M2) -> Cuckoo.__DoNotUse<(UsernameSetupViewProtocol?, String), Void> where M1.OptionalMatchedType == UsernameSetupViewProtocol, M2.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(UsernameSetupViewProtocol?, String)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: walletName) { $0.1 }] + return cuckoo_manager.verify("proceed(from: UsernameSetupViewProtocol?, walletName: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -49725,7 +48617,7 @@ import SoraFoundation } } - class StakingRewardDestConfirmWireframeProtocolStub: StakingRewardDestConfirmWireframeProtocol { + class UsernameSetupWireframeProtocolStub: UsernameSetupWireframeProtocol { @@ -49733,7 +48625,7 @@ import SoraFoundation - func complete(from view: StakingRewardDestConfirmViewProtocol?) { + func proceed(from view: UsernameSetupViewProtocol?, walletName: String) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -49755,147 +48647,65 @@ import SoraFoundation import Cuckoo @testable import novawallet +import BigInt import Foundation -import SoraFoundation - class MockStakingRewardDestSetupViewProtocol: StakingRewardDestSetupViewProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionInteractorInputProtocol: CrowdloanContributionInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDestSetupViewProtocol + typealias MocksType = CrowdloanContributionInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestSetupViewProtocol - typealias Verification = __VerificationProxy_StakingRewardDestSetupViewProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionInteractorInputProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDestSetupViewProtocol? + private var __defaultImplStub: CrowdloanContributionInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDestSetupViewProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - - } - - - - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - - } - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } - - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - - } - - func didReceiveFee(viewModel: LocalizableResource?) { - - return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) - - } - - - - func didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?) { - - return cuckoo_manager.call("didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveRewardDestination(viewModel: viewModel)) - - } - - - - func didCompletionAccountSelection() { + func setup() { - return cuckoo_manager.call("didCompletionAccountSelection()", + return cuckoo_manager.call("setup()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didCompletionAccountSelection()) + defaultCall: __defaultImplStub!.setup()) } - public func applyLocalization() { + func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", + parameters: (amount, bonusService), + escapingParameters: (amount, bonusService), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.estimateFee(for: amount, bonusService: bonusService)) } - struct __StubbingProxy_StakingRewardDestSetupViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -49903,44 +48713,19 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") - } - - - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") - } - - - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") - } - - - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) - } - - func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChangeRewardDestinationViewModel?)> where M1.OptionalMatchedType == ChangeRewardDestinationViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ChangeRewardDestinationViewModel?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupViewProtocol.self, method: "didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?)", parameterMatchers: matchers)) - } - - func didCompletionAccountSelection() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupViewProtocol.self, method: "didCompletionAccountSelection()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt, CrowdloanBonusServiceProtocol?)> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorInputProtocol.self, method: "estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestSetupViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -49952,228 +48737,235 @@ import SoraFoundation } - - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.__DoNotUse<(ChangeRewardDestinationViewModel?), Void> where M1.OptionalMatchedType == ChangeRewardDestinationViewModel { - let matchers: [Cuckoo.ParameterMatcher<(ChangeRewardDestinationViewModel?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didCompletionAccountSelection() -> Cuckoo.__DoNotUse<(), Void> { + func setup() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("didCompletionAccountSelection()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.__DoNotUse<(BigUInt, CrowdloanBonusServiceProtocol?), Void> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] + return cuckoo_manager.verify("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDestSetupViewProtocolStub: StakingRewardDestSetupViewProtocol { - + class CrowdloanContributionInteractorInputProtocolStub: CrowdloanContributionInteractorInputProtocol { + - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + + + + + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - + + func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - +} + + + + class MockCrowdloanContributionInteractorOutputProtocol: CrowdloanContributionInteractorOutputProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = CrowdloanContributionInteractorOutputProtocol - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - + typealias Stubbing = __StubbingProxy_CrowdloanContributionInteractorOutputProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionInteractorOutputProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: CrowdloanContributionInteractorOutputProtocol? + + func enableDefaultImplementation(_ stub: CrowdloanContributionInteractorOutputProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + - func didReceiveFee(viewModel: LocalizableResource?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + + func didReceiveCrowdloan(result: Result) { + + return cuckoo_manager.call("didReceiveCrowdloan(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveCrowdloan(result: result)) + } - func didReceiveRewardDestination(viewModel: ChangeRewardDestinationViewModel?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveDisplayInfo(result: Result) { + + return cuckoo_manager.call("didReceiveDisplayInfo(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveDisplayInfo(result: result)) + } - func didCompletionAccountSelection() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveAccountInfo(result: Result) { + + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + } - public func applyLocalization() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveBlockNumber(result: Result) { + + return cuckoo_manager.call("didReceiveBlockNumber(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveBlockNumber(result: result)) + } -} - - - - class MockStakingRewardDestSetupPresenterProtocol: StakingRewardDestSetupPresenterProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRewardDestSetupPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestSetupPresenterProtocol - typealias Verification = __VerificationProxy_StakingRewardDestSetupPresenterProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: StakingRewardDestSetupPresenterProtocol? - - func enableDefaultImplementation(_ stub: StakingRewardDestSetupPresenterProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceiveBlockDuration(result: Result) { + + return cuckoo_manager.call("didReceiveBlockDuration(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveBlockDuration(result: result)) + } - - - - - - - func setup() { + func didReceiveLeasingPeriod(result: Result) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveLeasingPeriod(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(result: result)) } - func selectRestakeDestination() { + func didReceiveLeasingOffset(result: Result) { - return cuckoo_manager.call("selectRestakeDestination()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveLeasingOffset(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectRestakeDestination()) + defaultCall: __defaultImplStub!.didReceiveLeasingOffset(result: result)) } - func selectPayoutDestination() { + func didReceiveMinimumBalance(result: Result) { - return cuckoo_manager.call("selectPayoutDestination()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveMinimumBalance(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectPayoutDestination()) + defaultCall: __defaultImplStub!.didReceiveMinimumBalance(result: result)) } - func selectPayoutAccount() { + func didReceiveMinimumContribution(result: Result) { - return cuckoo_manager.call("selectPayoutAccount()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveMinimumContribution(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectPayoutAccount()) + defaultCall: __defaultImplStub!.didReceiveMinimumContribution(result: result)) } - func displayLearnMore() { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("displayLearnMore()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.displayLearnMore()) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - func proceed() { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("proceed()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - struct __StubbingProxy_StakingRewardDestSetupPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -50181,39 +48973,64 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + func didReceiveCrowdloan(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveCrowdloan(result: Result)", parameterMatchers: matchers)) } - func selectRestakeDestination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "selectRestakeDestination()", parameterMatchers: matchers)) + func didReceiveDisplayInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveDisplayInfo(result: Result)", parameterMatchers: matchers)) } - func selectPayoutDestination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "selectPayoutDestination()", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func selectPayoutAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "selectPayoutAccount()", parameterMatchers: matchers)) + func didReceiveBlockNumber(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveBlockNumber(result: Result)", parameterMatchers: matchers)) } - func displayLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "displayLearnMore()", parameterMatchers: matchers)) + func didReceiveBlockDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveBlockDuration(result: Result)", parameterMatchers: matchers)) } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + func didReceiveLeasingPeriod(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveLeasingOffset(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveMinimumBalance(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveMinimumBalance(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveMinimumContribution(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveMinimumContribution(result: Result)", parameterMatchers: matchers)) + } + + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestSetupPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -50228,45 +49045,75 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveCrowdloan(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveCrowdloan(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectRestakeDestination() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectRestakeDestination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveDisplayInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveDisplayInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectPayoutDestination() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectPayoutDestination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectPayoutAccount() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectPayoutAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBlockNumber(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBlockNumber(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func displayLearnMore() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("displayLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBlockDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBlockDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveLeasingPeriod(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingPeriod(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveLeasingOffset(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingOffset(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveMinimumBalance(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinimumBalance(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveMinimumContribution(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinimumContribution(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDestSetupPresenterProtocolStub: StakingRewardDestSetupPresenterProtocol { + class CrowdloanContributionInteractorOutputProtocolStub: CrowdloanContributionInteractorOutputProtocol { @@ -50274,406 +49121,320 @@ import SoraFoundation - func setup() { + func didReceiveCrowdloan(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectRestakeDestination() { + func didReceiveDisplayInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectPayoutDestination() { + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectPayoutAccount() { + func didReceiveBlockNumber(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func displayLearnMore() { + func didReceiveBlockDuration(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func proceed() { + func didReceiveLeasingPeriod(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - - - class MockStakingRewardDestSetupInteractorInputProtocol: StakingRewardDestSetupInteractorInputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRewardDestSetupInteractorInputProtocol - - typealias Stubbing = __StubbingProxy_StakingRewardDestSetupInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingRewardDestSetupInteractorInputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: StakingRewardDestSetupInteractorInputProtocol? - - func enableDefaultImplementation(_ stub: StakingRewardDestSetupInteractorInputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) - - } - - func estimateFee() { - - return cuckoo_manager.call("estimateFee()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.estimateFee()) - + func didReceiveLeasingOffset(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func fetchPayoutAccounts() { - - return cuckoo_manager.call("fetchPayoutAccounts()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.fetchPayoutAccounts()) - + func didReceiveMinimumBalance(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - struct __StubbingProxy_StakingRewardDestSetupInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) - } - - func fetchPayoutAccounts() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorInputProtocol.self, method: "fetchPayoutAccounts()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRewardDestSetupInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func fetchPayoutAccounts() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("fetchPayoutAccounts()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class StakingRewardDestSetupInteractorInputProtocolStub: StakingRewardDestSetupInteractorInputProtocol { - - - - - - func setup() { + func didReceiveMinimumContribution(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func estimateFee() { + func didReceivePriceData(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func fetchPayoutAccounts() { + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet + +import BigInt +import SoraFoundation - class MockStakingRewardDestSetupInteractorOutputProtocol: StakingRewardDestSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { + + class MockCrowdloanContributionConfirmViewProtocol: CrowdloanContributionConfirmViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDestSetupInteractorOutputProtocol + typealias MocksType = CrowdloanContributionConfirmViewProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestSetupInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingRewardDestSetupInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmViewProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionConfirmViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDestSetupInteractorOutputProtocol? + private var __defaultImplStub: CrowdloanContributionConfirmViewProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDestSetupInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } - func didReceiveFee(result: Result) { - - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } - func didReceivePriceData(result: Result) { + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } } - func didReceiveStashItem(result: Result) { - - return cuckoo_manager.call("didReceiveStashItem(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } } - func didReceiveController(result: Result) { + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } - return cuckoo_manager.call("didReceiveController(result: Result)", - parameters: (result), - escapingParameters: (result), + } + + + + + + + + func didReceiveAsset(viewModel: AssetBalanceViewModelProtocol) { + + return cuckoo_manager.call("didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveController(result: result)) + defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) } - func didReceiveStash(result: Result) { + func didReceiveFee(viewModel: BalanceViewModelProtocol?) { - return cuckoo_manager.call("didReceiveStash(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveFee(viewModel: BalanceViewModelProtocol?)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStash(result: result)) + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) } - func didReceiveStakingLedger(result: Result) { + func didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel) { - return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) + defaultCall: __defaultImplStub!.didReceiveCrowdloan(viewModel: viewModel)) } - func didReceiveRewardDestinationAccount(result: Result?, Error>) { + func didReceiveEstimatedReward(viewModel: String?) { - return cuckoo_manager.call("didReceiveRewardDestinationAccount(result: Result?, Error>)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveEstimatedReward(viewModel: String?)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveRewardDestinationAccount(result: result)) + defaultCall: __defaultImplStub!.didReceiveEstimatedReward(viewModel: viewModel)) } - func didReceiveRewardDestinationAddress(result: Result?, Error>) { + func didReceiveBonus(viewModel: String?) { - return cuckoo_manager.call("didReceiveRewardDestinationAddress(result: Result?, Error>)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveBonus(viewModel: String?)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveRewardDestinationAddress(result: result)) + defaultCall: __defaultImplStub!.didReceiveBonus(viewModel: viewModel)) } - func didReceiveCalculator(result: Result) { + func didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM) { - return cuckoo_manager.call("didReceiveCalculator(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveCalculator(result: result)) + defaultCall: __defaultImplStub!.didReceiveRewardDestination(viewModel: viewModel)) } - func didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>) { + public func applyLocalization() { - return cuckoo_manager.call("didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("applyLocalization()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccounts(result: result)) + defaultCall: __defaultImplStub!.applyLocalization()) } - func didReceiveNomination(result: Result) { + func didStartLoading() { - return cuckoo_manager.call("didReceiveNomination(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveNomination(result: result)) + defaultCall: __defaultImplStub!.didStartLoading()) } - func didReceiveAccountInfo(result: Result) { + func didStopLoading() { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didStopLoading()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.didStopLoading()) } - struct __StubbingProxy_StakingRewardDestSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionConfirmViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -50681,69 +49442,79 @@ import SoraFoundation } - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager") } - func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) + + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") } - func didReceiveStash(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveStash(result: Result)", parameterMatchers: matchers)) + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") } - func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) + + func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AssetBalanceViewModelProtocol)> where M1.MatchedType == AssetBalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AssetBalanceViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", parameterMatchers: matchers)) } - func didReceiveRewardDestinationAccount(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result?, Error>)> where M1.MatchedType == Result?, Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result?, Error>)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveRewardDestinationAccount(result: Result?, Error>)", parameterMatchers: matchers)) + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BalanceViewModelProtocol?)> where M1.OptionalMatchedType == BalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveFee(viewModel: BalanceViewModelProtocol?)", parameterMatchers: matchers)) } - func didReceiveRewardDestinationAddress(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result?, Error>)> where M1.MatchedType == Result?, Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result?, Error>)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveRewardDestinationAddress(result: Result?, Error>)", parameterMatchers: matchers)) + func didReceiveCrowdloan(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributeConfirmViewModel)> where M1.MatchedType == CrowdloanContributeConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributeConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel)", parameterMatchers: matchers)) } - func didReceiveCalculator(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveCalculator(result: Result)", parameterMatchers: matchers)) + func didReceiveEstimatedReward(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveEstimatedReward(viewModel: String?)", parameterMatchers: matchers)) } - func didReceiveAccounts(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[MetaChainAccountResponse], Error>)> where M1.MatchedType == Result<[MetaChainAccountResponse], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[MetaChainAccountResponse], Error>)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", parameterMatchers: matchers)) + func didReceiveBonus(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveBonus(viewModel: String?)", parameterMatchers: matchers)) } - func didReceiveNomination(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveNomination(result: Result)", parameterMatchers: matchers)) + func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanRewardDestinationVM)> where M1.MatchedType == CrowdloanRewardDestinationVM { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanRewardDestinationVM)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", parameterMatchers: matchers)) } - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) + func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + } + + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionConfirmViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -50755,84 +49526,138 @@ import SoraFoundation } - - @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + var isSetup: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var controller: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + + var localizationManager: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + @discardableResult - func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(AssetBalanceViewModelProtocol), Void> where M1.MatchedType == AssetBalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AssetBalanceViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStash(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStash(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(BalanceViewModelProtocol?), Void> where M1.OptionalMatchedType == BalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: BalanceViewModelProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveCrowdloan(viewModel: M1) -> Cuckoo.__DoNotUse<(CrowdloanContributeConfirmViewModel), Void> where M1.MatchedType == CrowdloanContributeConfirmViewModel { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributeConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveRewardDestinationAccount(result: M1) -> Cuckoo.__DoNotUse<(Result?, Error>), Void> where M1.MatchedType == Result?, Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result?, Error>)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveRewardDestinationAccount(result: Result?, Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveEstimatedReward(viewModel: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveEstimatedReward(viewModel: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveRewardDestinationAddress(result: M1) -> Cuckoo.__DoNotUse<(Result?, Error>), Void> where M1.MatchedType == Result?, Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result?, Error>)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveRewardDestinationAddress(result: Result?, Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBonus(viewModel: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveBonus(viewModel: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveCalculator(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveCalculator(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.__DoNotUse<(CrowdloanRewardDestinationVM), Void> where M1.MatchedType == CrowdloanRewardDestinationVM { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanRewardDestinationVM)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveAccounts(result: M1) -> Cuckoo.__DoNotUse<(Result<[MetaChainAccountResponse], Error>), Void> where M1.MatchedType == Result<[MetaChainAccountResponse], Error> { - let matchers: [Cuckoo.ParameterMatcher<(Result<[MetaChainAccountResponse], Error>)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveNomination(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveNomination(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDestSetupInteractorOutputProtocolStub: StakingRewardDestSetupInteractorOutputProtocol { + class CrowdloanContributionConfirmViewProtocolStub: CrowdloanContributionConfirmViewProtocol { + + + + var isSetup: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } + + + + var controller: UIViewController { + get { + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + } + + } + + + + public var localizationManager: LocalizationManagerProtocol? { + get { + return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + } + + set { } + + } + + + + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } @@ -50840,73 +49665,244 @@ import SoraFoundation - func didReceiveFee(result: Result) { + func didReceiveAsset(viewModel: AssetBalanceViewModelProtocol) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceivePriceData(result: Result) { + func didReceiveFee(viewModel: BalanceViewModelProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStashItem(result: Result) { + func didReceiveCrowdloan(viewModel: CrowdloanContributeConfirmViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveController(result: Result) { + func didReceiveEstimatedReward(viewModel: String?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStash(result: Result) { + func didReceiveBonus(viewModel: String?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStakingLedger(result: Result) { + func didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveRewardDestinationAccount(result: Result?, Error>) { + public func applyLocalization() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveRewardDestinationAddress(result: Result?, Error>) { + func didStartLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveCalculator(result: Result) { + func didStopLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockCrowdloanContributionConfirmPresenterProtocol: CrowdloanContributionConfirmPresenterProtocol, Cuckoo.ProtocolMock { + typealias MocksType = CrowdloanContributionConfirmPresenterProtocol - func didReceiveAccounts(result: Result<[MetaChainAccountResponse], Error>) { + typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmPresenterProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionConfirmPresenterProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: CrowdloanContributionConfirmPresenterProtocol? + + func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmPresenterProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + + + + + func setup() { + + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setup()) + + } + + + + func confirm() { + + return cuckoo_manager.call("confirm()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.confirm()) + + } + + + + func presentAccountOptions() { + + return cuckoo_manager.call("presentAccountOptions()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentAccountOptions()) + + } + + + + func presentRewardDestination() { + + return cuckoo_manager.call("presentRewardDestination()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentRewardDestination()) + + } + + + struct __StubbingProxy_CrowdloanContributionConfirmPresenterProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + } + + func presentAccountOptions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmPresenterProtocol.self, method: "presentAccountOptions()", parameterMatchers: matchers)) + } + + func presentRewardDestination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmPresenterProtocol.self, method: "presentRewardDestination()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_CrowdloanContributionConfirmPresenterProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func confirm() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentAccountOptions() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentAccountOptions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentRewardDestination() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentRewardDestination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class CrowdloanContributionConfirmPresenterProtocolStub: CrowdloanContributionConfirmPresenterProtocol { + + + + + + + + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveNomination(result: Result) { + func confirm() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveAccountInfo(result: Result) { + func presentAccountOptions() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentRewardDestination() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -50914,19 +49910,19 @@ import SoraFoundation - class MockStakingRewardDestSetupWireframeProtocol: StakingRewardDestSetupWireframeProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionConfirmInteractorInputProtocol: CrowdloanContributionConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDestSetupWireframeProtocol + typealias MocksType = CrowdloanContributionConfirmInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDestSetupWireframeProtocol - typealias Verification = __VerificationProxy_StakingRewardDestSetupWireframeProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmInteractorInputProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionConfirmInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDestSetupWireframeProtocol? + private var __defaultImplStub: CrowdloanContributionConfirmInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDestSetupWireframeProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -50939,81 +49935,66 @@ import SoraFoundation - func proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination) { - - return cuckoo_manager.call("proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination)", - parameters: (view, rewardDestination), - escapingParameters: (view, rewardDestination), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.proceed(view: view, rewardDestination: rewardDestination)) - - } - - - - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func estimateFee(for contribution: BigUInt) { - return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", - parameters: (url, view, style), - escapingParameters: (url, view, style), + return cuckoo_manager.call("estimateFee(for: BigUInt)", + parameters: (contribution), + escapingParameters: (contribution), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) + defaultCall: __defaultImplStub!.estimateFee(for: contribution)) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func submit(contribution: BigUInt) { - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), + return cuckoo_manager.call("submit(contribution: BigUInt)", + parameters: (contribution), + escapingParameters: (contribution), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + defaultCall: __defaultImplStub!.submit(contribution: contribution)) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func setup() { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("setup()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.setup()) } - func presentAccountSelection(_ accounts: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from view: ControllerBackedProtocol?, context: AnyObject?) { + func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { - return cuckoo_manager.call("presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", - parameters: (accounts, selectedAccountItem, title, delegate, view, context), - escapingParameters: (accounts, selectedAccountItem, title, delegate, view, context), + return cuckoo_manager.call("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", + parameters: (amount, bonusService), + escapingParameters: (amount, bonusService), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.presentAccountSelection(accounts, selectedAccountItem: selectedAccountItem, title: title, delegate: delegate, from: view, context: context)) + defaultCall: __defaultImplStub!.estimateFee(for: amount, bonusService: bonusService)) } - struct __StubbingProxy_StakingRewardDestSetupWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -51021,34 +50002,29 @@ import SoraFoundation } - func proceed(view: M1, rewardDestination: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRewardDestSetupViewProtocol?, RewardDestination)> where M1.OptionalMatchedType == StakingRewardDestSetupViewProtocol, M2.MatchedType == RewardDestination { - let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestSetupViewProtocol?, RewardDestination)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: rewardDestination) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination)", parameterMatchers: matchers)) - } - - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) + func estimateFee(for contribution: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt)> where M1.MatchedType == BigUInt { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt)>] = [wrap(matchable: contribution) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorInputProtocol.self, method: "estimateFee(for: BigUInt)", parameterMatchers: matchers)) } - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func submit(contribution: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt)> where M1.MatchedType == BigUInt { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt)>] = [wrap(matchable: contribution) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorInputProtocol.self, method: "submit(contribution: BigUInt)", parameterMatchers: matchers)) } - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func presentAccountSelection(_ accounts: M1, selectedAccountItem: M2, title: M3, delegate: M4, from view: M5, context: M6) -> Cuckoo.ProtocolStubNoReturnFunction<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)> where M1.MatchedType == [MetaChainAccountResponse], M2.OptionalMatchedType == MetaChainAccountResponse, M3.MatchedType == LocalizableResource, M4.MatchedType == ModalPickerViewControllerDelegate, M5.OptionalMatchedType == ControllerBackedProtocol, M6.OptionalMatchedType == AnyObject { - let matchers: [Cuckoo.ParameterMatcher<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)>] = [wrap(matchable: accounts) { $0.0 }, wrap(matchable: selectedAccountItem) { $0.1 }, wrap(matchable: title) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: view) { $0.4 }, wrap(matchable: context) { $0.5 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDestSetupWireframeProtocol.self, method: "presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", parameterMatchers: matchers)) + func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt, CrowdloanBonusServiceProtocol?)> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorInputProtocol.self, method: "estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDestSetupWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -51063,39 +50039,33 @@ import SoraFoundation @discardableResult - func proceed(view: M1, rewardDestination: M2) -> Cuckoo.__DoNotUse<(StakingRewardDestSetupViewProtocol?, RewardDestination), Void> where M1.OptionalMatchedType == StakingRewardDestSetupViewProtocol, M2.MatchedType == RewardDestination { - let matchers: [Cuckoo.ParameterMatcher<(StakingRewardDestSetupViewProtocol?, RewardDestination)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: rewardDestination) { $0.1 }] - return cuckoo_manager.verify("proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { - let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] - return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee(for contribution: M1) -> Cuckoo.__DoNotUse<(BigUInt), Void> where M1.MatchedType == BigUInt { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt)>] = [wrap(matchable: contribution) { $0 }] + return cuckoo_manager.verify("estimateFee(for: BigUInt)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func submit(contribution: M1) -> Cuckoo.__DoNotUse<(BigUInt), Void> where M1.MatchedType == BigUInt { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt)>] = [wrap(matchable: contribution) { $0 }] + return cuckoo_manager.verify("submit(contribution: BigUInt)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func presentAccountSelection(_ accounts: M1, selectedAccountItem: M2, title: M3, delegate: M4, from view: M5, context: M6) -> Cuckoo.__DoNotUse<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?), Void> where M1.MatchedType == [MetaChainAccountResponse], M2.OptionalMatchedType == MetaChainAccountResponse, M3.MatchedType == LocalizableResource, M4.MatchedType == ModalPickerViewControllerDelegate, M5.OptionalMatchedType == ControllerBackedProtocol, M6.OptionalMatchedType == AnyObject { - let matchers: [Cuckoo.ParameterMatcher<([MetaChainAccountResponse], MetaChainAccountResponse?, LocalizableResource, ModalPickerViewControllerDelegate, ControllerBackedProtocol?, AnyObject?)>] = [wrap(matchable: accounts) { $0.0 }, wrap(matchable: selectedAccountItem) { $0.1 }, wrap(matchable: title) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: view) { $0.4 }, wrap(matchable: context) { $0.5 }] - return cuckoo_manager.verify("presentAccountSelection(_: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from: ControllerBackedProtocol?, context: AnyObject?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.__DoNotUse<(BigUInt, CrowdloanBonusServiceProtocol?), Void> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] + return cuckoo_manager.verify("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDestSetupWireframeProtocolStub: StakingRewardDestSetupWireframeProtocol { + class CrowdloanContributionConfirmInteractorInputProtocolStub: CrowdloanContributionConfirmInteractorInputProtocol { @@ -51103,156 +50073,267 @@ import SoraFoundation - func proceed(view: StakingRewardDestSetupViewProtocol?, rewardDestination: RewardDestination) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + func estimateFee(for contribution: BigUInt) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func submit(contribution: BigUInt) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func setup() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func presentAccountSelection(_ accounts: [MetaChainAccountResponse], selectedAccountItem: MetaChainAccountResponse?, title: LocalizableResource, delegate: ModalPickerViewControllerDelegate, from view: ControllerBackedProtocol?, context: AnyObject?) { + func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } -import Cuckoo -@testable import novawallet - -import SoraFoundation - - class MockStakingRewardDetailsViewProtocol: StakingRewardDetailsViewProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionConfirmInteractorOutputProtocol: CrowdloanContributionConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDetailsViewProtocol + typealias MocksType = CrowdloanContributionConfirmInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDetailsViewProtocol - typealias Verification = __VerificationProxy_StakingRewardDetailsViewProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmInteractorOutputProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionConfirmInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDetailsViewProtocol? + private var __defaultImplStub: CrowdloanContributionConfirmInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDetailsViewProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } + + - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + + + func didSubmitContribution(result: Result) { + + return cuckoo_manager.call("didSubmitContribution(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didSubmitContribution(result: result)) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func didReceiveDisplayAddress(result: Result) { + + return cuckoo_manager.call("didReceiveDisplayAddress(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveDisplayAddress(result: result)) } - - + + func didReceiveRewardDestinationAddress(_ address: AccountAddress) { + + return cuckoo_manager.call("didReceiveRewardDestinationAddress(_: AccountAddress)", + parameters: (address), + escapingParameters: (address), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveRewardDestinationAddress(address)) + + } - func didReceive(amountViewModel: BalanceViewModelProtocol) { + func didReceiveCrowdloan(result: Result) { - return cuckoo_manager.call("didReceive(amountViewModel: BalanceViewModelProtocol)", - parameters: (amountViewModel), - escapingParameters: (amountViewModel), + return cuckoo_manager.call("didReceiveCrowdloan(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(amountViewModel: amountViewModel)) + defaultCall: __defaultImplStub!.didReceiveCrowdloan(result: result)) } - func didReceive(validatorViewModel: StackCellViewModel) { + func didReceiveDisplayInfo(result: Result) { - return cuckoo_manager.call("didReceive(validatorViewModel: StackCellViewModel)", - parameters: (validatorViewModel), - escapingParameters: (validatorViewModel), + return cuckoo_manager.call("didReceiveDisplayInfo(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(validatorViewModel: validatorViewModel)) + defaultCall: __defaultImplStub!.didReceiveDisplayInfo(result: result)) } - func didReceive(eraViewModel: StackCellViewModel) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("didReceive(eraViewModel: StackCellViewModel)", - parameters: (eraViewModel), - escapingParameters: (eraViewModel), + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(eraViewModel: eraViewModel)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - func didReceive(remainedTime: NSAttributedString) { + func didReceiveBlockNumber(result: Result) { - return cuckoo_manager.call("didReceive(remainedTime: NSAttributedString)", - parameters: (remainedTime), - escapingParameters: (remainedTime), + return cuckoo_manager.call("didReceiveBlockNumber(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(remainedTime: remainedTime)) + defaultCall: __defaultImplStub!.didReceiveBlockNumber(result: result)) + + } + + + + func didReceiveBlockDuration(result: Result) { + + return cuckoo_manager.call("didReceiveBlockDuration(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveBlockDuration(result: result)) + + } + + + + func didReceiveLeasingPeriod(result: Result) { + + return cuckoo_manager.call("didReceiveLeasingPeriod(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(result: result)) + + } + + + + func didReceiveLeasingOffset(result: Result) { + + return cuckoo_manager.call("didReceiveLeasingOffset(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveLeasingOffset(result: result)) + + } + + + + func didReceiveMinimumBalance(result: Result) { + + return cuckoo_manager.call("didReceiveMinimumBalance(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMinimumBalance(result: result)) + + } + + + + func didReceiveMinimumContribution(result: Result) { + + return cuckoo_manager.call("didReceiveMinimumContribution(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMinimumContribution(result: result)) + + } + + + + func didReceivePriceData(result: Result) { + + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + + } + + + + func didReceiveFee(result: Result) { + + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - struct __StubbingProxy_StakingRewardDetailsViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -51260,39 +50341,79 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") + func didSubmitContribution(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didSubmitContribution(result: Result)", parameterMatchers: matchers)) } + func didReceiveDisplayAddress(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveDisplayAddress(result: Result)", parameterMatchers: matchers)) + } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + func didReceiveRewardDestinationAddress(_ address: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AccountAddress)> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: address) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveRewardDestinationAddress(_: AccountAddress)", parameterMatchers: matchers)) } + func didReceiveCrowdloan(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveCrowdloan(result: Result)", parameterMatchers: matchers)) + } - func didReceive(amountViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BalanceViewModelProtocol)> where M1.MatchedType == BalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol)>] = [wrap(matchable: amountViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsViewProtocol.self, method: "didReceive(amountViewModel: BalanceViewModelProtocol)", parameterMatchers: matchers)) + func didReceiveDisplayInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveDisplayInfo(result: Result)", parameterMatchers: matchers)) } - func didReceive(validatorViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StackCellViewModel)> where M1.MatchedType == StackCellViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StackCellViewModel)>] = [wrap(matchable: validatorViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsViewProtocol.self, method: "didReceive(validatorViewModel: StackCellViewModel)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func didReceive(eraViewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StackCellViewModel)> where M1.MatchedType == StackCellViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StackCellViewModel)>] = [wrap(matchable: eraViewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsViewProtocol.self, method: "didReceive(eraViewModel: StackCellViewModel)", parameterMatchers: matchers)) + func didReceiveBlockNumber(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveBlockNumber(result: Result)", parameterMatchers: matchers)) } - func didReceive(remainedTime: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(NSAttributedString)> where M1.MatchedType == NSAttributedString { - let matchers: [Cuckoo.ParameterMatcher<(NSAttributedString)>] = [wrap(matchable: remainedTime) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsViewProtocol.self, method: "didReceive(remainedTime: NSAttributedString)", parameterMatchers: matchers)) + func didReceiveBlockDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveBlockDuration(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveLeasingPeriod(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveLeasingOffset(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveMinimumBalance(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveMinimumBalance(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveMinimumContribution(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveMinimumContribution(result: Result)", parameterMatchers: matchers)) + } + + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDetailsViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -51304,90 +50425,182 @@ import SoraFoundation } + - var isSetup: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didSubmitContribution(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didSubmitContribution(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didReceiveDisplayAddress(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveDisplayAddress(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } - var controller: Cuckoo.VerifyReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) + @discardableResult + func didReceiveRewardDestinationAddress(_ address: M1) -> Cuckoo.__DoNotUse<(AccountAddress), Void> where M1.MatchedType == AccountAddress { + let matchers: [Cuckoo.ParameterMatcher<(AccountAddress)>] = [wrap(matchable: address) { $0 }] + return cuckoo_manager.verify("didReceiveRewardDestinationAddress(_: AccountAddress)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - + @discardableResult + func didReceiveCrowdloan(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveCrowdloan(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } @discardableResult - func didReceive(amountViewModel: M1) -> Cuckoo.__DoNotUse<(BalanceViewModelProtocol), Void> where M1.MatchedType == BalanceViewModelProtocol { - let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol)>] = [wrap(matchable: amountViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(amountViewModel: BalanceViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveDisplayInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveDisplayInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(validatorViewModel: M1) -> Cuckoo.__DoNotUse<(StackCellViewModel), Void> where M1.MatchedType == StackCellViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StackCellViewModel)>] = [wrap(matchable: validatorViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(validatorViewModel: StackCellViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(eraViewModel: M1) -> Cuckoo.__DoNotUse<(StackCellViewModel), Void> where M1.MatchedType == StackCellViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StackCellViewModel)>] = [wrap(matchable: eraViewModel) { $0 }] - return cuckoo_manager.verify("didReceive(eraViewModel: StackCellViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBlockNumber(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBlockNumber(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceive(remainedTime: M1) -> Cuckoo.__DoNotUse<(NSAttributedString), Void> where M1.MatchedType == NSAttributedString { - let matchers: [Cuckoo.ParameterMatcher<(NSAttributedString)>] = [wrap(matchable: remainedTime) { $0 }] - return cuckoo_manager.verify("didReceive(remainedTime: NSAttributedString)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBlockDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBlockDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveLeasingPeriod(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingPeriod(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveLeasingOffset(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingOffset(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveMinimumBalance(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinimumBalance(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveMinimumContribution(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinimumContribution(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDetailsViewProtocolStub: StakingRewardDetailsViewProtocol { - + class CrowdloanContributionConfirmInteractorOutputProtocolStub: CrowdloanContributionConfirmInteractorOutputProtocol { + - var isSetup: Bool { - get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) - } - + + + + + func didSubmitContribution(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - var controller: UIViewController { - get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) - } - + + func didReceiveDisplayAddress(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - - + + func didReceiveRewardDestinationAddress(_ address: AccountAddress) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } - func didReceive(amountViewModel: BalanceViewModelProtocol) { + func didReceiveCrowdloan(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(validatorViewModel: StackCellViewModel) { + func didReceiveDisplayInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(eraViewModel: StackCellViewModel) { + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceive(remainedTime: NSAttributedString) { + func didReceiveBlockNumber(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveBlockDuration(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveLeasingPeriod(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveLeasingOffset(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveMinimumBalance(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveMinimumContribution(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceivePriceData(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -51395,19 +50608,19 @@ import SoraFoundation - class MockStakingRewardDetailsPresenterProtocol: StakingRewardDetailsPresenterProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionConfirmWireframeProtocol: CrowdloanContributionConfirmWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDetailsPresenterProtocol + typealias MocksType = CrowdloanContributionConfirmWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDetailsPresenterProtocol - typealias Verification = __VerificationProxy_StakingRewardDetailsPresenterProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionConfirmWireframeProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionConfirmWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDetailsPresenterProtocol? + private var __defaultImplStub: CrowdloanContributionConfirmWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDetailsPresenterProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionConfirmWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -51420,51 +50633,51 @@ import SoraFoundation - func setup() { + func complete(on view: CrowdloanContributionConfirmViewProtocol?) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("complete(on: CrowdloanContributionConfirmViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.complete(on: view)) } - func handlePayoutAction() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("handlePayoutAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handlePayoutAction()) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - func handleValidatorAccountAction() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("handleValidatorAccountAction()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handleValidatorAccountAction()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } - struct __StubbingProxy_StakingRewardDetailsPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionConfirmWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -51472,24 +50685,24 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + func complete(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributionConfirmViewProtocol?)> where M1.OptionalMatchedType == CrowdloanContributionConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmWireframeProtocol.self, method: "complete(on: CrowdloanContributionConfirmViewProtocol?)", parameterMatchers: matchers)) } - func handlePayoutAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsPresenterProtocol.self, method: "handlePayoutAction()", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func handleValidatorAccountAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsPresenterProtocol.self, method: "handleValidatorAccountAction()", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardDetailsPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionConfirmWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -51504,27 +50717,27 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func complete(on view: M1) -> Cuckoo.__DoNotUse<(CrowdloanContributionConfirmViewProtocol?), Void> where M1.OptionalMatchedType == CrowdloanContributionConfirmViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(on: CrowdloanContributionConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func handlePayoutAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handlePayoutAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func handleValidatorAccountAction() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handleValidatorAccountAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardDetailsPresenterProtocolStub: StakingRewardDetailsPresenterProtocol { + class CrowdloanContributionConfirmWireframeProtocolStub: CrowdloanContributionConfirmWireframeProtocol { @@ -51532,398 +50745,239 @@ import SoraFoundation - func setup() { + func complete(on view: CrowdloanContributionConfirmViewProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func handlePayoutAction() { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func handleValidatorAccountAction() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } } +import Cuckoo +@testable import novawallet + +import BigInt +import CommonWallet +import Foundation +import SoraFoundation + - class MockStakingRewardDetailsInteractorInputProtocol: StakingRewardDetailsInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionSetupViewProtocol: CrowdloanContributionSetupViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardDetailsInteractorInputProtocol + typealias MocksType = CrowdloanContributionSetupViewProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDetailsInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingRewardDetailsInteractorInputProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupViewProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionSetupViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardDetailsInteractorInputProtocol? + private var __defaultImplStub: CrowdloanContributionSetupViewProtocol? - func enableDefaultImplementation(_ stub: StakingRewardDetailsInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionSetupViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - - + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } - func setup() { - - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.setup()) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } - - struct __StubbingProxy_StakingRewardDetailsInteractorInputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRewardDetailsInteractorInputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class StakingRewardDetailsInteractorInputProtocolStub: StakingRewardDetailsInteractorInputProtocol { - - + public var localizationManager: LocalizationManagerProtocol? { + get { + return cuckoo_manager.getter("localizationManager", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager) + } + + set { + cuckoo_manager.setter("localizationManager", + value: newValue, + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.localizationManager = newValue) + } + + } - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } + } -} - - - - class MockStakingRewardDetailsInteractorOutputProtocol: StakingRewardDetailsInteractorOutputProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRewardDetailsInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingRewardDetailsInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingRewardDetailsInteractorOutputProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: StakingRewardDetailsInteractorOutputProtocol? - - func enableDefaultImplementation(_ stub: StakingRewardDetailsInteractorOutputProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } + } - - - func didReceive(priceResult: Result) { + func didReceiveAsset(viewModel: AssetBalanceViewModelProtocol) { - return cuckoo_manager.call("didReceive(priceResult: Result)", - parameters: (priceResult), - escapingParameters: (priceResult), + return cuckoo_manager.call("didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(priceResult: priceResult)) + defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) } - - struct __StubbingProxy_StakingRewardDetailsInteractorOutputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didReceive(priceResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsInteractorOutputProtocol.self, method: "didReceive(priceResult: Result)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRewardDetailsInteractorOutputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func didReceive(priceResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] - return cuckoo_manager.verify("didReceive(priceResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class StakingRewardDetailsInteractorOutputProtocolStub: StakingRewardDetailsInteractorOutputProtocol { - - - - - - - - func didReceive(priceResult: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - - - class MockStakingRewardDetailsWireframeProtocol: StakingRewardDetailsWireframeProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRewardDetailsWireframeProtocol - - typealias Stubbing = __StubbingProxy_StakingRewardDetailsWireframeProtocol - typealias Verification = __VerificationProxy_StakingRewardDetailsWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: StakingRewardDetailsWireframeProtocol? - - func enableDefaultImplementation(_ stub: StakingRewardDetailsWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - func showPayoutConfirmation(from view: ControllerBackedProtocol?, payoutInfo: PayoutInfo) { + func didReceiveFee(viewModel: BalanceViewModelProtocol?) { - return cuckoo_manager.call("showPayoutConfirmation(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo)", - parameters: (view, payoutInfo), - escapingParameters: (view, payoutInfo), + return cuckoo_manager.call("didReceiveFee(viewModel: BalanceViewModelProtocol?)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showPayoutConfirmation(from: view, payoutInfo: payoutInfo)) + defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) } - - struct __StubbingProxy_StakingRewardDetailsWireframeProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func showPayoutConfirmation(from view: M1, payoutInfo: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, PayoutInfo)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == PayoutInfo { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, PayoutInfo)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: payoutInfo) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardDetailsWireframeProtocol.self, method: "showPayoutConfirmation(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRewardDetailsWireframeProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func showPayoutConfirmation(from view: M1, payoutInfo: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, PayoutInfo), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == PayoutInfo { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, PayoutInfo)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: payoutInfo) { $0.1 }] - return cuckoo_manager.verify("showPayoutConfirmation(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class StakingRewardDetailsWireframeProtocolStub: StakingRewardDetailsWireframeProtocol { - - - - - - - - func showPayoutConfirmation(from view: ControllerBackedProtocol?, payoutInfo: PayoutInfo) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - -} - - -import Cuckoo -@testable import novawallet - -import SoraFoundation -import SoraUI - - - class MockStakingRewardPayoutsViewProtocol: StakingRewardPayoutsViewProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRewardPayoutsViewProtocol - typealias Stubbing = __StubbingProxy_StakingRewardPayoutsViewProtocol - typealias Verification = __VerificationProxy_StakingRewardPayoutsViewProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: StakingRewardPayoutsViewProtocol? - - func enableDefaultImplementation(_ stub: StakingRewardPayoutsViewProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceiveInput(viewModel: AmountInputViewModelProtocol) { + + return cuckoo_manager.call("didReceiveInput(viewModel: AmountInputViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) + } - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + func didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel) { + + return cuckoo_manager.call("didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveCrowdloan(viewModel: viewModel)) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func didReceiveEstimatedReward(viewModel: String?) { + + return cuckoo_manager.call("didReceiveEstimatedReward(viewModel: String?)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveEstimatedReward(viewModel: viewModel)) } - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } + func didReceiveBonus(viewModel: String?) { - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } + return cuckoo_manager.call("didReceiveBonus(viewModel: String?)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveBonus(viewModel: viewModel)) } - - - - - func reload(with state: StakingRewardPayoutsViewState) { + func didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM) { - return cuckoo_manager.call("reload(with: StakingRewardPayoutsViewState)", - parameters: (state), - escapingParameters: (state), + return cuckoo_manager.call("didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", + parameters: (viewModel), + escapingParameters: (viewModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload(with: state)) + defaultCall: __defaultImplStub!.didReceiveRewardDestination(viewModel: viewModel)) } @@ -51942,8 +50996,38 @@ import SoraUI } + + + func didStartLoading() { + + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStartLoading()) + + } + + + + func didStopLoading() { + + return cuckoo_manager.call("didStopLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStopLoading()) + + } + - struct __StubbingProxy_StakingRewardPayoutsViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionSetupViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -51951,34 +51035,84 @@ import SoraUI } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { + var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { return .init(manager: cuckoo_manager, name: "localizationManager") } - func reload(with state: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingRewardPayoutsViewState)> where M1.MatchedType == StakingRewardPayoutsViewState { - let matchers: [Cuckoo.ParameterMatcher<(StakingRewardPayoutsViewState)>] = [wrap(matchable: state) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsViewProtocol.self, method: "reload(with: StakingRewardPayoutsViewState)", parameterMatchers: matchers)) + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + } + + + func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AssetBalanceViewModelProtocol)> where M1.MatchedType == AssetBalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AssetBalanceViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", parameterMatchers: matchers)) + } + + func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BalanceViewModelProtocol?)> where M1.OptionalMatchedType == BalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveFee(viewModel: BalanceViewModelProtocol?)", parameterMatchers: matchers)) + } + + func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(AmountInputViewModelProtocol)> where M1.MatchedType == AmountInputViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AmountInputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveInput(viewModel: AmountInputViewModelProtocol)", parameterMatchers: matchers)) + } + + func didReceiveCrowdloan(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributionSetupViewModel)> where M1.MatchedType == CrowdloanContributionSetupViewModel { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel)", parameterMatchers: matchers)) + } + + func didReceiveEstimatedReward(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveEstimatedReward(viewModel: String?)", parameterMatchers: matchers)) + } + + func didReceiveBonus(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String?)> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveBonus(viewModel: String?)", parameterMatchers: matchers)) + } + + func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanRewardDestinationVM)> where M1.MatchedType == CrowdloanRewardDestinationVM { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanRewardDestinationVM)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", parameterMatchers: matchers)) } func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + } + + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardPayoutsViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionSetupViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -52005,12 +51139,58 @@ import SoraUI return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func reload(with state: M1) -> Cuckoo.__DoNotUse<(StakingRewardPayoutsViewState), Void> where M1.MatchedType == StakingRewardPayoutsViewState { - let matchers: [Cuckoo.ParameterMatcher<(StakingRewardPayoutsViewState)>] = [wrap(matchable: state) { $0 }] - return cuckoo_manager.verify("reload(with: StakingRewardPayoutsViewState)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(AssetBalanceViewModelProtocol), Void> where M1.MatchedType == AssetBalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AssetBalanceViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveAsset(viewModel: AssetBalanceViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(BalanceViewModelProtocol?), Void> where M1.OptionalMatchedType == BalanceViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BalanceViewModelProtocol?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveFee(viewModel: BalanceViewModelProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(AmountInputViewModelProtocol), Void> where M1.MatchedType == AmountInputViewModelProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AmountInputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveInput(viewModel: AmountInputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveCrowdloan(viewModel: M1) -> Cuckoo.__DoNotUse<(CrowdloanContributionSetupViewModel), Void> where M1.MatchedType == CrowdloanContributionSetupViewModel { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveEstimatedReward(viewModel: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveEstimatedReward(viewModel: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveBonus(viewModel: M1) -> Cuckoo.__DoNotUse<(String?), Void> where M1.OptionalMatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String?)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveBonus(viewModel: String?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveRewardDestination(viewModel: M1) -> Cuckoo.__DoNotUse<(CrowdloanRewardDestinationVM), Void> where M1.MatchedType == CrowdloanRewardDestinationVM { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanRewardDestinationVM)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -52019,10 +51199,22 @@ import SoraUI return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } - class StakingRewardPayoutsViewProtocolStub: StakingRewardPayoutsViewProtocol { + class CrowdloanContributionSetupViewProtocolStub: CrowdloanContributionSetupViewProtocol { @@ -52052,6 +51244,24 @@ import SoraUI set { } } + + + + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } @@ -52059,7 +51269,43 @@ import SoraUI - func reload(with state: StakingRewardPayoutsViewState) { + func didReceiveAsset(viewModel: AssetBalanceViewModelProtocol) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveFee(viewModel: BalanceViewModelProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveInput(viewModel: AmountInputViewModelProtocol) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveCrowdloan(viewModel: CrowdloanContributionSetupViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveEstimatedReward(viewModel: String?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveBonus(viewModel: String?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveRewardDestination(viewModel: CrowdloanRewardDestinationVM) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -52069,23 +51315,35 @@ import SoraUI return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func didStartLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStopLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + } - class MockStakingRewardPayoutsPresenterProtocol: StakingRewardPayoutsPresenterProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionSetupPresenterProtocol: CrowdloanContributionSetupPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardPayoutsPresenterProtocol + typealias MocksType = CrowdloanContributionSetupPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingRewardPayoutsPresenterProtocol - typealias Verification = __VerificationProxy_StakingRewardPayoutsPresenterProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupPresenterProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionSetupPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardPayoutsPresenterProtocol? + private var __defaultImplStub: CrowdloanContributionSetupPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingRewardPayoutsPresenterProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionSetupPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -52113,66 +51371,96 @@ import SoraUI - func handleSelectedHistory(at index: Int) { + func selectAmountPercentage(_ percentage: Float) { - return cuckoo_manager.call("handleSelectedHistory(at: Int)", - parameters: (index), - escapingParameters: (index), + return cuckoo_manager.call("selectAmountPercentage(_: Float)", + parameters: (percentage), + escapingParameters: (percentage), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handleSelectedHistory(at: index)) + defaultCall: __defaultImplStub!.selectAmountPercentage(percentage)) } - func handlePayoutAction() { + func updateAmount(_ newValue: Decimal) { - return cuckoo_manager.call("handlePayoutAction()", + return cuckoo_manager.call("updateAmount(_: Decimal)", + parameters: (newValue), + escapingParameters: (newValue), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.updateAmount(newValue)) + + } + + + + func proceed() { + + return cuckoo_manager.call("proceed()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.handlePayoutAction()) + defaultCall: __defaultImplStub!.proceed()) } - func reload() { + func presentLearnMore() { - return cuckoo_manager.call("reload()", + return cuckoo_manager.call("presentLearnMore()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload()) + defaultCall: __defaultImplStub!.presentLearnMore()) } - func getTimeLeftString(at index: Int) -> LocalizableResource? { + func presentAdditionalBonuses() { - return cuckoo_manager.call("getTimeLeftString(at: Int) -> LocalizableResource?", - parameters: (index), - escapingParameters: (index), + return cuckoo_manager.call("presentAdditionalBonuses()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.getTimeLeftString(at: index)) + defaultCall: __defaultImplStub!.presentAdditionalBonuses()) + + } + + + + func presentRewardDestination() { + + return cuckoo_manager.call("presentRewardDestination()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentRewardDestination()) } - struct __StubbingProxy_StakingRewardPayoutsPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionSetupPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -52182,32 +51470,42 @@ import SoraUI func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func handleSelectedHistory(at index: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Int)> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "handleSelectedHistory(at: Int)", parameterMatchers: matchers)) + func selectAmountPercentage(_ percentage: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Float)> where M1.MatchedType == Float { + let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "selectAmountPercentage(_: Float)", parameterMatchers: matchers)) } - func handlePayoutAction() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func updateAmount(_ newValue: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "updateAmount(_: Decimal)", parameterMatchers: matchers)) + } + + func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "handlePayoutAction()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) } - func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func presentLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "reload()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "presentLearnMore()", parameterMatchers: matchers)) } - func getTimeLeftString(at index: M1) -> Cuckoo.ProtocolStubFunction<(Int), LocalizableResource?> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsPresenterProtocol.self, method: "getTimeLeftString(at: Int) -> LocalizableResource?", parameterMatchers: matchers)) + func presentAdditionalBonuses() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "presentAdditionalBonuses()", parameterMatchers: matchers)) + } + + func presentRewardDestination() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupPresenterProtocol.self, method: "presentRewardDestination()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardPayoutsPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionSetupPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -52228,33 +51526,45 @@ import SoraUI } @discardableResult - func handleSelectedHistory(at index: M1) -> Cuckoo.__DoNotUse<(Int), Void> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("handleSelectedHistory(at: Int)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectAmountPercentage(_ percentage: M1) -> Cuckoo.__DoNotUse<(Float), Void> where M1.MatchedType == Float { + let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] + return cuckoo_manager.verify("selectAmountPercentage(_: Float)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func handlePayoutAction() -> Cuckoo.__DoNotUse<(), Void> { + func updateAmount(_ newValue: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { + let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] + return cuckoo_manager.verify("updateAmount(_: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func proceed() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("handlePayoutAction()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func reload() -> Cuckoo.__DoNotUse<(), Void> { + func presentLearnMore() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("presentLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func getTimeLeftString(at index: M1) -> Cuckoo.__DoNotUse<(Int), LocalizableResource?> where M1.MatchedType == Int { - let matchers: [Cuckoo.ParameterMatcher<(Int)>] = [wrap(matchable: index) { $0 }] - return cuckoo_manager.verify("getTimeLeftString(at: Int) -> LocalizableResource?", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentAdditionalBonuses() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentAdditionalBonuses()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentRewardDestination() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentRewardDestination()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardPayoutsPresenterProtocolStub: StakingRewardPayoutsPresenterProtocol { + class CrowdloanContributionSetupPresenterProtocolStub: CrowdloanContributionSetupPresenterProtocol { @@ -52268,45 +51578,57 @@ import SoraUI - func handleSelectedHistory(at index: Int) { + func selectAmountPercentage(_ percentage: Float) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func handlePayoutAction() { + func updateAmount(_ newValue: Decimal) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func reload() { + func proceed() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func getTimeLeftString(at index: Int) -> LocalizableResource? { - return DefaultValueRegistry.defaultValue(for: (LocalizableResource?).self) + func presentLearnMore() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentAdditionalBonuses() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentRewardDestination() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } } - class MockStakingRewardPayoutsInteractorInputProtocol: StakingRewardPayoutsInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionSetupInteractorInputProtocol: CrowdloanContributionSetupInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardPayoutsInteractorInputProtocol + typealias MocksType = CrowdloanContributionSetupInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingRewardPayoutsInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingRewardPayoutsInteractorInputProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupInteractorInputProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionSetupInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardPayoutsInteractorInputProtocol? + private var __defaultImplStub: CrowdloanContributionSetupInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingRewardPayoutsInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionSetupInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -52334,21 +51656,21 @@ import SoraUI - func reload() { + func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { - return cuckoo_manager.call("reload()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", + parameters: (amount, bonusService), + escapingParameters: (amount, bonusService), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.reload()) + defaultCall: __defaultImplStub!.estimateFee(for: amount, bonusService: bonusService)) } - struct __StubbingProxy_StakingRewardPayoutsInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionSetupInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -52358,17 +51680,17 @@ import SoraUI func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - - func reload() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorInputProtocol.self, method: "reload()", parameterMatchers: matchers)) + + func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(BigUInt, CrowdloanBonusServiceProtocol?)> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorInputProtocol.self, method: "estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardPayoutsInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionSetupInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -52389,15 +51711,15 @@ import SoraUI } @discardableResult - func reload() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("reload()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func estimateFee(for amount: M1, bonusService: M2) -> Cuckoo.__DoNotUse<(BigUInt, CrowdloanBonusServiceProtocol?), Void> where M1.MatchedType == BigUInt, M2.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(BigUInt, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: bonusService) { $0.1 }] + return cuckoo_manager.verify("estimateFee(for: BigUInt, bonusService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardPayoutsInteractorInputProtocolStub: StakingRewardPayoutsInteractorInputProtocol { + class CrowdloanContributionSetupInteractorInputProtocolStub: CrowdloanContributionSetupInteractorInputProtocol { @@ -52411,7 +51733,7 @@ import SoraUI - func reload() { + func estimateFee(for amount: BigUInt, bonusService: CrowdloanBonusServiceProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -52419,19 +51741,19 @@ import SoraUI - class MockStakingRewardPayoutsInteractorOutputProtocol: StakingRewardPayoutsInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionSetupInteractorOutputProtocol: CrowdloanContributionSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingRewardPayoutsInteractorOutputProtocol + typealias MocksType = CrowdloanContributionSetupInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingRewardPayoutsInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingRewardPayoutsInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupInteractorOutputProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionSetupInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingRewardPayoutsInteractorOutputProtocol? + private var __defaultImplStub: CrowdloanContributionSetupInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingRewardPayoutsInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionSetupInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -52444,193 +51766,171 @@ import SoraUI - func didReceive(result: Result) { + func didReceiveCrowdloan(result: Result) { - return cuckoo_manager.call("didReceive(result: Result)", + return cuckoo_manager.call("didReceiveCrowdloan(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(result: result)) + defaultCall: __defaultImplStub!.didReceiveCrowdloan(result: result)) } - func didReceive(priceResult: Result) { + func didReceiveDisplayInfo(result: Result) { - return cuckoo_manager.call("didReceive(priceResult: Result)", - parameters: (priceResult), - escapingParameters: (priceResult), + return cuckoo_manager.call("didReceiveDisplayInfo(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(priceResult: priceResult)) + defaultCall: __defaultImplStub!.didReceiveDisplayInfo(result: result)) } - func didReceive(eraCountdownResult: Result) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("didReceive(eraCountdownResult: Result)", - parameters: (eraCountdownResult), - escapingParameters: (eraCountdownResult), + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceive(eraCountdownResult: eraCountdownResult)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - - struct __StubbingProxy_StakingRewardPayoutsInteractorOutputProtocol: Cuckoo.StubbingProxy { - private let cuckoo_manager: Cuckoo.MockManager - - init(manager: Cuckoo.MockManager) { - self.cuckoo_manager = manager - } - - - func didReceive(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorOutputProtocol.self, method: "didReceive(result: Result)", parameterMatchers: matchers)) - } - - func didReceive(priceResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorOutputProtocol.self, method: "didReceive(priceResult: Result)", parameterMatchers: matchers)) - } - - func didReceive(eraCountdownResult: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: eraCountdownResult) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsInteractorOutputProtocol.self, method: "didReceive(eraCountdownResult: Result)", parameterMatchers: matchers)) - } - - } - - struct __VerificationProxy_StakingRewardPayoutsInteractorOutputProtocol: Cuckoo.VerificationProxy { - private let cuckoo_manager: Cuckoo.MockManager - private let callMatcher: Cuckoo.CallMatcher - private let sourceLocation: Cuckoo.SourceLocation - - init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { - self.cuckoo_manager = manager - self.callMatcher = callMatcher - self.sourceLocation = sourceLocation - } - - - - - @discardableResult - func didReceive(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceive(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(priceResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: priceResult) { $0 }] - return cuckoo_manager.verify("didReceive(priceResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceive(eraCountdownResult: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: eraCountdownResult) { $0 }] - return cuckoo_manager.verify("didReceive(eraCountdownResult: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - } -} - - class StakingRewardPayoutsInteractorOutputProtocolStub: StakingRewardPayoutsInteractorOutputProtocol { - - + func didReceiveBlockNumber(result: Result) { + + return cuckoo_manager.call("didReceiveBlockNumber(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveBlockNumber(result: result)) + + } - func didReceive(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveBlockDuration(result: Result) { + + return cuckoo_manager.call("didReceiveBlockDuration(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveBlockDuration(result: result)) + } - func didReceive(priceResult: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveLeasingPeriod(result: Result) { + + return cuckoo_manager.call("didReceiveLeasingPeriod(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(result: result)) + } - func didReceive(eraCountdownResult: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func didReceiveLeasingOffset(result: Result) { + + return cuckoo_manager.call("didReceiveLeasingOffset(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveLeasingOffset(result: result)) + } -} - - - - class MockStakingRewardPayoutsWireframeProtocol: StakingRewardPayoutsWireframeProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingRewardPayoutsWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingRewardPayoutsWireframeProtocol - typealias Verification = __VerificationProxy_StakingRewardPayoutsWireframeProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - private var __defaultImplStub: StakingRewardPayoutsWireframeProtocol? - - func enableDefaultImplementation(_ stub: StakingRewardPayoutsWireframeProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() + func didReceiveMinimumBalance(result: Result) { + + return cuckoo_manager.call("didReceiveMinimumBalance(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMinimumBalance(result: result)) + } - - - + func didReceiveMinimumContribution(result: Result) { + + return cuckoo_manager.call("didReceiveMinimumContribution(result: Result)", + parameters: (result), + escapingParameters: (result), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveMinimumContribution(result: result)) + + } - func showRewardDetails(from view: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown) { + func didReceivePriceData(result: Result) { - return cuckoo_manager.call("showRewardDetails(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown)", - parameters: (view, payoutInfo, historyDepth, eraCountdown), - escapingParameters: (view, payoutInfo, historyDepth, eraCountdown), + return cuckoo_manager.call("didReceivePriceData(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showRewardDetails(from: view, payoutInfo: payoutInfo, historyDepth: historyDepth, eraCountdown: eraCountdown)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - func showPayoutConfirmation(for payouts: [PayoutInfo], from view: ControllerBackedProtocol?) { + func didReceiveFee(result: Result) { - return cuckoo_manager.call("showPayoutConfirmation(for: [PayoutInfo], from: ControllerBackedProtocol?)", - parameters: (payouts, view), - escapingParameters: (payouts, view), + return cuckoo_manager.call("didReceiveFee(result: Result)", + parameters: (result), + escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.showPayoutConfirmation(for: payouts, from: view)) + defaultCall: __defaultImplStub!.didReceiveFee(result: result)) } - struct __StubbingProxy_StakingRewardPayoutsWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -52638,19 +51938,64 @@ import SoraUI } - func showRewardDetails(from view: M1, payoutInfo: M2, historyDepth: M3, eraCountdown: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, PayoutInfo, UInt32, EraCountdown)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == PayoutInfo, M3.MatchedType == UInt32, M4.MatchedType == EraCountdown { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, PayoutInfo, UInt32, EraCountdown)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: payoutInfo) { $0.1 }, wrap(matchable: historyDepth) { $0.2 }, wrap(matchable: eraCountdown) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsWireframeProtocol.self, method: "showRewardDetails(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown)", parameterMatchers: matchers)) + func didReceiveCrowdloan(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveCrowdloan(result: Result)", parameterMatchers: matchers)) } - func showPayoutConfirmation(for payouts: M1, from view: M2) -> Cuckoo.ProtocolStubNoReturnFunction<([PayoutInfo], ControllerBackedProtocol?)> where M1.MatchedType == [PayoutInfo], M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<([PayoutInfo], ControllerBackedProtocol?)>] = [wrap(matchable: payouts) { $0.0 }, wrap(matchable: view) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingRewardPayoutsWireframeProtocol.self, method: "showPayoutConfirmation(for: [PayoutInfo], from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceiveDisplayInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveDisplayInfo(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveBlockNumber(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveBlockNumber(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveBlockDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveBlockDuration(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveLeasingPeriod(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveLeasingOffset(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveMinimumBalance(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveMinimumBalance(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveMinimumContribution(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveMinimumContribution(result: Result)", parameterMatchers: matchers)) + } + + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + } + + func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingRewardPayoutsWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -52665,21 +52010,75 @@ import SoraUI @discardableResult - func showRewardDetails(from view: M1, payoutInfo: M2, historyDepth: M3, eraCountdown: M4) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, PayoutInfo, UInt32, EraCountdown), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == PayoutInfo, M3.MatchedType == UInt32, M4.MatchedType == EraCountdown { - let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, PayoutInfo, UInt32, EraCountdown)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: payoutInfo) { $0.1 }, wrap(matchable: historyDepth) { $0.2 }, wrap(matchable: eraCountdown) { $0.3 }] - return cuckoo_manager.verify("showRewardDetails(from: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveCrowdloan(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveCrowdloan(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func showPayoutConfirmation(for payouts: M1, from view: M2) -> Cuckoo.__DoNotUse<([PayoutInfo], ControllerBackedProtocol?), Void> where M1.MatchedType == [PayoutInfo], M2.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<([PayoutInfo], ControllerBackedProtocol?)>] = [wrap(matchable: payouts) { $0.0 }, wrap(matchable: view) { $0.1 }] - return cuckoo_manager.verify("showPayoutConfirmation(for: [PayoutInfo], from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveDisplayInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveDisplayInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveBlockNumber(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBlockNumber(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveBlockDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBlockDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveLeasingPeriod(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingPeriod(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveLeasingOffset(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingOffset(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveMinimumBalance(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinimumBalance(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveMinimumContribution(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveMinimumContribution(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingRewardPayoutsWireframeProtocolStub: StakingRewardPayoutsWireframeProtocol { + class CrowdloanContributionSetupInteractorOutputProtocolStub: CrowdloanContributionSetupInteractorOutputProtocol { @@ -52687,13 +52086,67 @@ import SoraUI - func showRewardDetails(from view: ControllerBackedProtocol?, payoutInfo: PayoutInfo, historyDepth: UInt32, eraCountdown: EraCountdown) { + func didReceiveCrowdloan(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func showPayoutConfirmation(for payouts: [PayoutInfo], from view: ControllerBackedProtocol?) { + func didReceiveDisplayInfo(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveAccountInfo(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveBlockNumber(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveBlockDuration(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveLeasingPeriod(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveLeasingOffset(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveMinimumBalance(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveMinimumContribution(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceivePriceData(result: Result) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveFee(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -52701,19 +52154,19 @@ import SoraUI - class MockStakingPayoutViewModelFactoryProtocol: StakingPayoutViewModelFactoryProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanContributionSetupWireframeProtocol: CrowdloanContributionSetupWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingPayoutViewModelFactoryProtocol + typealias MocksType = CrowdloanContributionSetupWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingPayoutViewModelFactoryProtocol - typealias Verification = __VerificationProxy_StakingPayoutViewModelFactoryProtocol + typealias Stubbing = __StubbingProxy_CrowdloanContributionSetupWireframeProtocol + typealias Verification = __VerificationProxy_CrowdloanContributionSetupWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingPayoutViewModelFactoryProtocol? + private var __defaultImplStub: CrowdloanContributionSetupWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingPayoutViewModelFactoryProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanContributionSetupWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -52726,56 +52179,116 @@ import SoraUI - func createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource { + func showConfirmation(from view: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?) { - return cuckoo_manager.call("createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource", - parameters: (payoutsInfo, priceData, eraCountdown), - escapingParameters: (payoutsInfo, priceData, eraCountdown), + return cuckoo_manager.call("showConfirmation(from: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?)", + parameters: (view, paraId, inputAmount, bonusService), + escapingParameters: (view, paraId, inputAmount, bonusService), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.createPayoutsViewModel(payoutsInfo: payoutsInfo, priceData: priceData, eraCountdown: eraCountdown)) + defaultCall: __defaultImplStub!.showConfirmation(from: view, paraId: paraId, inputAmount: inputAmount, bonusService: bonusService)) } - func timeLeftString(at index: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource { + func showAdditionalBonus(from view: CrowdloanContributionSetupViewProtocol?, for displayInfo: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?) { - return cuckoo_manager.call("timeLeftString(at: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource", - parameters: (index, payoutsInfo, eraCountdown), - escapingParameters: (index, payoutsInfo, eraCountdown), + return cuckoo_manager.call("showAdditionalBonus(from: CrowdloanContributionSetupViewProtocol?, for: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?)", + parameters: (view, displayInfo, inputAmount, delegate, existingService), + escapingParameters: (view, displayInfo, inputAmount, delegate, existingService), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.timeLeftString(at: index, payoutsInfo: payoutsInfo, eraCountdown: eraCountdown)) + defaultCall: __defaultImplStub!.showAdditionalBonus(from: view, for: displayInfo, inputAmount: inputAmount, delegate: delegate, existingService: existingService)) + + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) + + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + + } + + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) } - struct __StubbingProxy_StakingPayoutViewModelFactoryProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanContributionSetupWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { self.cuckoo_manager = manager } - - func createPayoutsViewModel(payoutsInfo: M1, priceData: M2, eraCountdown: M3) -> Cuckoo.ProtocolStubFunction<(PayoutsInfo, PriceData?, EraCountdown?), LocalizableResource> where M1.MatchedType == PayoutsInfo, M2.OptionalMatchedType == PriceData, M3.OptionalMatchedType == EraCountdown { - let matchers: [Cuckoo.ParameterMatcher<(PayoutsInfo, PriceData?, EraCountdown?)>] = [wrap(matchable: payoutsInfo) { $0.0 }, wrap(matchable: priceData) { $0.1 }, wrap(matchable: eraCountdown) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutViewModelFactoryProtocol.self, method: "createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource", parameterMatchers: matchers)) + + func showConfirmation(from view: M1, paraId: M2, inputAmount: M3, bonusService: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributionSetupViewProtocol?, ParaId, Decimal, CrowdloanBonusServiceProtocol?)> where M1.OptionalMatchedType == CrowdloanContributionSetupViewProtocol, M2.MatchedType == ParaId, M3.MatchedType == Decimal, M4.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewProtocol?, ParaId, Decimal, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: paraId) { $0.1 }, wrap(matchable: inputAmount) { $0.2 }, wrap(matchable: bonusService) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "showConfirmation(from: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) + } + + func showAdditionalBonus(from view: M1, for displayInfo: M2, inputAmount: M3, delegate: M4, existingService: M5) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanContributionSetupViewProtocol?, CrowdloanDisplayInfo, Decimal, CustomCrowdloanDelegate, CrowdloanBonusServiceProtocol?)> where M1.OptionalMatchedType == CrowdloanContributionSetupViewProtocol, M2.MatchedType == CrowdloanDisplayInfo, M3.MatchedType == Decimal, M4.MatchedType == CustomCrowdloanDelegate, M5.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewProtocol?, CrowdloanDisplayInfo, Decimal, CustomCrowdloanDelegate, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: displayInfo) { $0.1 }, wrap(matchable: inputAmount) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: existingService) { $0.4 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "showAdditionalBonus(from: CrowdloanContributionSetupViewProtocol?, for: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?)", parameterMatchers: matchers)) + } + + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func timeLeftString(at index: M1, payoutsInfo: M2, eraCountdown: M3) -> Cuckoo.ProtocolStubFunction<(Int, PayoutsInfo, EraCountdown?), LocalizableResource> where M1.MatchedType == Int, M2.MatchedType == PayoutsInfo, M3.OptionalMatchedType == EraCountdown { - let matchers: [Cuckoo.ParameterMatcher<(Int, PayoutsInfo, EraCountdown?)>] = [wrap(matchable: index) { $0.0 }, wrap(matchable: payoutsInfo) { $0.1 }, wrap(matchable: eraCountdown) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingPayoutViewModelFactoryProtocol.self, method: "timeLeftString(at: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource", parameterMatchers: matchers)) + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanContributionSetupWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingPayoutViewModelFactoryProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanContributionSetupWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -52790,21 +52303,39 @@ import SoraUI @discardableResult - func createPayoutsViewModel(payoutsInfo: M1, priceData: M2, eraCountdown: M3) -> Cuckoo.__DoNotUse<(PayoutsInfo, PriceData?, EraCountdown?), LocalizableResource> where M1.MatchedType == PayoutsInfo, M2.OptionalMatchedType == PriceData, M3.OptionalMatchedType == EraCountdown { - let matchers: [Cuckoo.ParameterMatcher<(PayoutsInfo, PriceData?, EraCountdown?)>] = [wrap(matchable: payoutsInfo) { $0.0 }, wrap(matchable: priceData) { $0.1 }, wrap(matchable: eraCountdown) { $0.2 }] - return cuckoo_manager.verify("createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showConfirmation(from view: M1, paraId: M2, inputAmount: M3, bonusService: M4) -> Cuckoo.__DoNotUse<(CrowdloanContributionSetupViewProtocol?, ParaId, Decimal, CrowdloanBonusServiceProtocol?), Void> where M1.OptionalMatchedType == CrowdloanContributionSetupViewProtocol, M2.MatchedType == ParaId, M3.MatchedType == Decimal, M4.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewProtocol?, ParaId, Decimal, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: paraId) { $0.1 }, wrap(matchable: inputAmount) { $0.2 }, wrap(matchable: bonusService) { $0.3 }] + return cuckoo_manager.verify("showConfirmation(from: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func timeLeftString(at index: M1, payoutsInfo: M2, eraCountdown: M3) -> Cuckoo.__DoNotUse<(Int, PayoutsInfo, EraCountdown?), LocalizableResource> where M1.MatchedType == Int, M2.MatchedType == PayoutsInfo, M3.OptionalMatchedType == EraCountdown { - let matchers: [Cuckoo.ParameterMatcher<(Int, PayoutsInfo, EraCountdown?)>] = [wrap(matchable: index) { $0.0 }, wrap(matchable: payoutsInfo) { $0.1 }, wrap(matchable: eraCountdown) { $0.2 }] - return cuckoo_manager.verify("timeLeftString(at: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func showAdditionalBonus(from view: M1, for displayInfo: M2, inputAmount: M3, delegate: M4, existingService: M5) -> Cuckoo.__DoNotUse<(CrowdloanContributionSetupViewProtocol?, CrowdloanDisplayInfo, Decimal, CustomCrowdloanDelegate, CrowdloanBonusServiceProtocol?), Void> where M1.OptionalMatchedType == CrowdloanContributionSetupViewProtocol, M2.MatchedType == CrowdloanDisplayInfo, M3.MatchedType == Decimal, M4.MatchedType == CustomCrowdloanDelegate, M5.OptionalMatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanContributionSetupViewProtocol?, CrowdloanDisplayInfo, Decimal, CustomCrowdloanDelegate, CrowdloanBonusServiceProtocol?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: displayInfo) { $0.1 }, wrap(matchable: inputAmount) { $0.2 }, wrap(matchable: delegate) { $0.3 }, wrap(matchable: existingService) { $0.4 }] + return cuckoo_manager.verify("showAdditionalBonus(from: CrowdloanContributionSetupViewProtocol?, for: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingPayoutViewModelFactoryProtocolStub: StakingPayoutViewModelFactoryProtocol { + class CrowdloanContributionSetupWireframeProtocolStub: CrowdloanContributionSetupWireframeProtocol { @@ -52812,14 +52343,32 @@ import SoraUI - func createPayoutsViewModel(payoutsInfo: PayoutsInfo, priceData: PriceData?, eraCountdown: EraCountdown?) -> LocalizableResource { - return DefaultValueRegistry.defaultValue(for: (LocalizableResource).self) + func showConfirmation(from view: CrowdloanContributionSetupViewProtocol?, paraId: ParaId, inputAmount: Decimal, bonusService: CrowdloanBonusServiceProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - func timeLeftString(at index: Int, payoutsInfo: PayoutsInfo, eraCountdown: EraCountdown?) -> LocalizableResource { - return DefaultValueRegistry.defaultValue(for: (LocalizableResource).self) + func showAdditionalBonus(from view: CrowdloanContributionSetupViewProtocol?, for displayInfo: CrowdloanDisplayInfo, inputAmount: Decimal, delegate: CustomCrowdloanDelegate, existingService: CrowdloanBonusServiceProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } } @@ -52828,24 +52377,22 @@ import SoraUI import Cuckoo @testable import novawallet -import BigInt -import Foundation import SoraFoundation - class MockStakingUnbondConfirmViewProtocol: StakingUnbondConfirmViewProtocol, Cuckoo.ProtocolMock { + class MockCrowdloansViewProtocol: CrowdloansViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondConfirmViewProtocol + typealias MocksType = CrowdloansViewProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondConfirmViewProtocol - typealias Verification = __VerificationProxy_StakingUnbondConfirmViewProtocol + typealias Stubbing = __StubbingProxy_CrowdloansViewProtocol + typealias Verification = __VerificationProxy_CrowdloansViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondConfirmViewProtocol? + private var __defaultImplStub: CrowdloansViewProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondConfirmViewProtocol) { + func enableDefaultImplementation(_ stub: CrowdloansViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -52854,52 +52401,52 @@ import SoraFoundation - var isSetup: Bool { + var presenter: CrowdloanListPresenterProtocol? { get { - return cuckoo_manager.getter("isSetup", + return cuckoo_manager.getter("presenter", superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.isSetup) + defaultCall: __defaultImplStub!.presenter) } - } - - - - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", + set { + cuckoo_manager.setter("presenter", + value: newValue, superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.controller) + defaultCall: __defaultImplStub!.presenter = newValue) } } - public var localizationManager: LocalizationManagerProtocol? { + var isSetup: Bool { get { - return cuckoo_manager.getter("localizationManager", + return cuckoo_manager.getter("isSetup", superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.localizationManager) + defaultCall: __defaultImplStub!.isSetup) } - set { - cuckoo_manager.setter("localizationManager", - value: newValue, + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.localizationManager = newValue) + defaultCall: __defaultImplStub!.controller) } } @@ -52938,91 +52485,61 @@ import SoraFoundation - func didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel) { - - return cuckoo_manager.call("didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveConfirmation(viewModel: viewModel)) - - } - - - - func didReceiveAmount(viewModel: LocalizableResource) { - - return cuckoo_manager.call("didReceiveAmount(viewModel: LocalizableResource)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAmount(viewModel: viewModel)) - - } - - - - func didReceiveFee(viewModel: LocalizableResource?) { + func didReceive(chainInfo: ChainBalanceViewModel) { - return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didReceive(chainInfo: ChainBalanceViewModel)", + parameters: (chainInfo), + escapingParameters: (chainInfo), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didReceive(chainInfo: chainInfo)) } - func didReceiveBonding(duration: LocalizableResource) { + func didReceive(listState: CrowdloansViewModel) { - return cuckoo_manager.call("didReceiveBonding(duration: LocalizableResource)", - parameters: (duration), - escapingParameters: (duration), + return cuckoo_manager.call("didReceive(listState: CrowdloansViewModel)", + parameters: (listState), + escapingParameters: (listState), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveBonding(duration: duration)) + defaultCall: __defaultImplStub!.didReceive(listState: listState)) } - func didSetShouldResetRewardsDestination(value: Bool) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("didSetShouldResetRewardsDestination(value: Bool)", - parameters: (value), - escapingParameters: (value), + return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", + parameters: (message, title, closeAction, view), + escapingParameters: (message, title, closeAction, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSetShouldResetRewardsDestination(value: value)) + defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) } - public func applyLocalization() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", + parameters: (viewModel, style, view), + escapingParameters: (viewModel, style, view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) } @@ -53057,7 +52574,7 @@ import SoraFoundation } - struct __StubbingProxy_StakingUnbondConfirmViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloansViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -53065,74 +52582,64 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "isSetup") + var presenter: Cuckoo.ProtocolToBeStubbedOptionalProperty { + return .init(manager: cuckoo_manager, name: "presenter") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { - return .init(manager: cuckoo_manager, name: "controller") + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "isSetup") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "controller") } - var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "loadableContentView") } - var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") } - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingUnbondConfirmViewModel)> where M1.MatchedType == StakingUnbondConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel)", parameterMatchers: matchers)) - } - - func didReceiveAmount(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didReceiveAmount(viewModel: LocalizableResource)", parameterMatchers: matchers)) - } - - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) + func didReceive(chainInfo: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainBalanceViewModel)> where M1.MatchedType == ChainBalanceViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ChainBalanceViewModel)>] = [wrap(matchable: chainInfo) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloansViewProtocol.self, method: "didReceive(chainInfo: ChainBalanceViewModel)", parameterMatchers: matchers)) } - func didReceiveBonding(duration: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: duration) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didReceiveBonding(duration: LocalizableResource)", parameterMatchers: matchers)) + func didReceive(listState: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloansViewModel)> where M1.MatchedType == CrowdloansViewModel { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloansViewModel)>] = [wrap(matchable: listState) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloansViewProtocol.self, method: "didReceive(listState: CrowdloansViewModel)", parameterMatchers: matchers)) } - func didSetShouldResetRewardsDestination(value: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: value) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didSetShouldResetRewardsDestination(value: Bool)", parameterMatchers: matchers)) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloansViewProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloansViewProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloansViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) } func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloansViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondConfirmViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloansViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -53145,6 +52652,11 @@ import SoraFoundation + var presenter: Cuckoo.VerifyOptionalProperty { + return .init(manager: cuckoo_manager, name: "presenter", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + var isSetup: Cuckoo.VerifyReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup", callMatcher: callMatcher, sourceLocation: sourceLocation) } @@ -53155,11 +52667,6 @@ import SoraFoundation } - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - - var loadableContentView: Cuckoo.VerifyReadOnlyProperty { return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) } @@ -53172,39 +52679,27 @@ import SoraFoundation @discardableResult - func didReceiveConfirmation(viewModel: M1) -> Cuckoo.__DoNotUse<(StakingUnbondConfirmViewModel), Void> where M1.MatchedType == StakingUnbondConfirmViewModel { - let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondConfirmViewModel)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAmount(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAmount(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(chainInfo: M1) -> Cuckoo.__DoNotUse<(ChainBalanceViewModel), Void> where M1.MatchedType == ChainBalanceViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ChainBalanceViewModel)>] = [wrap(matchable: chainInfo) { $0 }] + return cuckoo_manager.verify("didReceive(chainInfo: ChainBalanceViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveBonding(duration: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: duration) { $0 }] - return cuckoo_manager.verify("didReceiveBonding(duration: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(listState: M1) -> Cuckoo.__DoNotUse<(CrowdloansViewModel), Void> where M1.MatchedType == CrowdloansViewModel { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloansViewModel)>] = [wrap(matchable: listState) { $0 }] + return cuckoo_manager.verify("didReceive(listState: CrowdloansViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didSetShouldResetRewardsDestination(value: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: value) { $0 }] - return cuckoo_manager.verify("didSetShouldResetRewardsDestination(value: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] + return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -53222,35 +52717,35 @@ import SoraFoundation } } - class StakingUnbondConfirmViewProtocolStub: StakingUnbondConfirmViewProtocol { + class CrowdloansViewProtocolStub: CrowdloansViewProtocol { - var isSetup: Bool { + var presenter: CrowdloanListPresenterProtocol? { get { - return DefaultValueRegistry.defaultValue(for: (Bool).self) + return DefaultValueRegistry.defaultValue(for: (CrowdloanListPresenterProtocol?).self) } + set { } + } - var controller: UIViewController { + var isSetup: Bool { get { - return DefaultValueRegistry.defaultValue(for: (UIViewController).self) + return DefaultValueRegistry.defaultValue(for: (Bool).self) } } - public var localizationManager: LocalizationManagerProtocol? { + var controller: UIViewController { get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) + return DefaultValueRegistry.defaultValue(for: (UIViewController).self) } - set { } - } @@ -53277,37 +52772,25 @@ import SoraFoundation - func didReceiveConfirmation(viewModel: StakingUnbondConfirmViewModel) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAmount(viewModel: LocalizableResource) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(viewModel: LocalizableResource?) { + func didReceive(chainInfo: ChainBalanceViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveBonding(duration: LocalizableResource) { + func didReceive(listState: CrowdloansViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didSetShouldResetRewardsDestination(value: Bool) { + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -53327,19 +52810,19 @@ import SoraFoundation - class MockStakingUnbondConfirmPresenterProtocol: StakingUnbondConfirmPresenterProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanListPresenterProtocol: CrowdloanListPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondConfirmPresenterProtocol + typealias MocksType = CrowdloanListPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondConfirmPresenterProtocol - typealias Verification = __VerificationProxy_StakingUnbondConfirmPresenterProtocol + typealias Stubbing = __StubbingProxy_CrowdloanListPresenterProtocol + typealias Verification = __VerificationProxy_CrowdloanListPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondConfirmPresenterProtocol? + private var __defaultImplStub: CrowdloanListPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondConfirmPresenterProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanListPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -53352,51 +52835,51 @@ import SoraFoundation - func setup() { + func refresh(shouldReset: Bool) { - return cuckoo_manager.call("setup()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("refresh(shouldReset: Bool)", + parameters: (shouldReset), + escapingParameters: (shouldReset), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setup()) + defaultCall: __defaultImplStub!.refresh(shouldReset: shouldReset)) } - func confirm() { + func selectCrowdloan(_ paraId: ParaId) { - return cuckoo_manager.call("confirm()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("selectCrowdloan(_: ParaId)", + parameters: (paraId), + escapingParameters: (paraId), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.confirm()) + defaultCall: __defaultImplStub!.selectCrowdloan(paraId)) } - func selectAccount() { + func handleYourContributions() { - return cuckoo_manager.call("selectAccount()", + return cuckoo_manager.call("handleYourContributions()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.selectAccount()) + defaultCall: __defaultImplStub!.handleYourContributions()) } - struct __StubbingProxy_StakingUnbondConfirmPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanListPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -53404,24 +52887,24 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + func refresh(shouldReset: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: shouldReset) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "refresh(shouldReset: Bool)", parameterMatchers: matchers)) } - func confirm() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmPresenterProtocol.self, method: "confirm()", parameterMatchers: matchers)) + func selectCrowdloan(_ paraId: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ParaId)> where M1.MatchedType == ParaId { + let matchers: [Cuckoo.ParameterMatcher<(ParaId)>] = [wrap(matchable: paraId) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "selectCrowdloan(_: ParaId)", parameterMatchers: matchers)) } - func selectAccount() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func handleYourContributions() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmPresenterProtocol.self, method: "selectAccount()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListPresenterProtocol.self, method: "handleYourContributions()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondConfirmPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanListPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -53436,27 +52919,27 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func refresh(shouldReset: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: shouldReset) { $0 }] + return cuckoo_manager.verify("refresh(shouldReset: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func confirm() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("confirm()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func selectCrowdloan(_ paraId: M1) -> Cuckoo.__DoNotUse<(ParaId), Void> where M1.MatchedType == ParaId { + let matchers: [Cuckoo.ParameterMatcher<(ParaId)>] = [wrap(matchable: paraId) { $0 }] + return cuckoo_manager.verify("selectCrowdloan(_: ParaId)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func selectAccount() -> Cuckoo.__DoNotUse<(), Void> { + func handleYourContributions() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("selectAccount()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("handleYourContributions()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingUnbondConfirmPresenterProtocolStub: StakingUnbondConfirmPresenterProtocol { + class CrowdloanListPresenterProtocolStub: CrowdloanListPresenterProtocol { @@ -53464,19 +52947,19 @@ import SoraFoundation - func setup() { + func refresh(shouldReset: Bool) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func confirm() { + func selectCrowdloan(_ paraId: ParaId) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func selectAccount() { + func handleYourContributions() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -53484,19 +52967,19 @@ import SoraFoundation - class MockStakingUnbondConfirmInteractorInputProtocol: StakingUnbondConfirmInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanListInteractorInputProtocol: CrowdloanListInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondConfirmInteractorInputProtocol + typealias MocksType = CrowdloanListInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondConfirmInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingUnbondConfirmInteractorInputProtocol + typealias Stubbing = __StubbingProxy_CrowdloanListInteractorInputProtocol + typealias Verification = __VerificationProxy_CrowdloanListInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondConfirmInteractorInputProtocol? + private var __defaultImplStub: CrowdloanListInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondConfirmInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanListInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -53524,36 +53007,66 @@ import SoraFoundation - func submit(for amount: Decimal, resettingRewardDestination: Bool, chilling: Bool) { + func refresh() { - return cuckoo_manager.call("submit(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", - parameters: (amount, resettingRewardDestination, chilling), - escapingParameters: (amount, resettingRewardDestination, chilling), + return cuckoo_manager.call("refresh()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.submit(for: amount, resettingRewardDestination: resettingRewardDestination, chilling: chilling)) + defaultCall: __defaultImplStub!.refresh()) } - func estimateFee(for amount: Decimal, resettingRewardDestination: Bool, chilling: Bool) { + func saveSelected(chainModel: ChainModel) { - return cuckoo_manager.call("estimateFee(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", - parameters: (amount, resettingRewardDestination, chilling), - escapingParameters: (amount, resettingRewardDestination, chilling), + return cuckoo_manager.call("saveSelected(chainModel: ChainModel)", + parameters: (chainModel), + escapingParameters: (chainModel), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.estimateFee(for: amount, resettingRewardDestination: resettingRewardDestination, chilling: chilling)) + defaultCall: __defaultImplStub!.saveSelected(chainModel: chainModel)) + + } + + + + func becomeOnline() { + + return cuckoo_manager.call("becomeOnline()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.becomeOnline()) + + } + + + + func putOffline() { + + return cuckoo_manager.call("putOffline()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.putOffline()) } - struct __StubbingProxy_StakingUnbondConfirmInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanListInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -53563,22 +53076,32 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func submit(for amount: M1, resettingRewardDestination: M2, chilling: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal, Bool, Bool)> where M1.MatchedType == Decimal, M2.MatchedType == Bool, M3.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Decimal, Bool, Bool)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: resettingRewardDestination) { $0.1 }, wrap(matchable: chilling) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorInputProtocol.self, method: "submit(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", parameterMatchers: matchers)) + func refresh() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "refresh()", parameterMatchers: matchers)) } - func estimateFee(for amount: M1, resettingRewardDestination: M2, chilling: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal, Bool, Bool)> where M1.MatchedType == Decimal, M2.MatchedType == Bool, M3.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Decimal, Bool, Bool)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: resettingRewardDestination) { $0.1 }, wrap(matchable: chilling) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorInputProtocol.self, method: "estimateFee(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", parameterMatchers: matchers)) + func saveSelected(chainModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ChainModel)> where M1.MatchedType == ChainModel { + let matchers: [Cuckoo.ParameterMatcher<(ChainModel)>] = [wrap(matchable: chainModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "saveSelected(chainModel: ChainModel)", parameterMatchers: matchers)) + } + + func becomeOnline() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "becomeOnline()", parameterMatchers: matchers)) + } + + func putOffline() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorInputProtocol.self, method: "putOffline()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondConfirmInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanListInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -53599,21 +53122,33 @@ import SoraFoundation } @discardableResult - func submit(for amount: M1, resettingRewardDestination: M2, chilling: M3) -> Cuckoo.__DoNotUse<(Decimal, Bool, Bool), Void> where M1.MatchedType == Decimal, M2.MatchedType == Bool, M3.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Decimal, Bool, Bool)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: resettingRewardDestination) { $0.1 }, wrap(matchable: chilling) { $0.2 }] - return cuckoo_manager.verify("submit(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func refresh() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("refresh()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func estimateFee(for amount: M1, resettingRewardDestination: M2, chilling: M3) -> Cuckoo.__DoNotUse<(Decimal, Bool, Bool), Void> where M1.MatchedType == Decimal, M2.MatchedType == Bool, M3.MatchedType == Bool { - let matchers: [Cuckoo.ParameterMatcher<(Decimal, Bool, Bool)>] = [wrap(matchable: amount) { $0.0 }, wrap(matchable: resettingRewardDestination) { $0.1 }, wrap(matchable: chilling) { $0.2 }] - return cuckoo_manager.verify("estimateFee(for: Decimal, resettingRewardDestination: Bool, chilling: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func saveSelected(chainModel: M1) -> Cuckoo.__DoNotUse<(ChainModel), Void> where M1.MatchedType == ChainModel { + let matchers: [Cuckoo.ParameterMatcher<(ChainModel)>] = [wrap(matchable: chainModel) { $0 }] + return cuckoo_manager.verify("saveSelected(chainModel: ChainModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func becomeOnline() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("becomeOnline()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func putOffline() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("putOffline()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingUnbondConfirmInteractorInputProtocolStub: StakingUnbondConfirmInteractorInputProtocol { + class CrowdloanListInteractorInputProtocolStub: CrowdloanListInteractorInputProtocol { @@ -53627,13 +53162,25 @@ import SoraFoundation - func submit(for amount: Decimal, resettingRewardDestination: Bool, chilling: Bool) { + func refresh() { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func estimateFee(for amount: Decimal, resettingRewardDestination: Bool, chilling: Bool) { + func saveSelected(chainModel: ChainModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func becomeOnline() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func putOffline() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -53641,19 +53188,19 @@ import SoraFoundation - class MockStakingUnbondConfirmInteractorOutputProtocol: StakingUnbondConfirmInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanListInteractorOutputProtocol: CrowdloanListInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondConfirmInteractorOutputProtocol + typealias MocksType = CrowdloanListInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondConfirmInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingUnbondConfirmInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_CrowdloanListInteractorOutputProtocol + typealias Verification = __VerificationProxy_CrowdloanListInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondConfirmInteractorOutputProtocol? + private var __defaultImplStub: CrowdloanListInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondConfirmInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanListInteractorOutputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -53666,201 +53213,186 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { - - return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) - - } - - - - func didReceiveAccountInfo(result: Result) { + func didReceiveCrowdloans(result: Result<[Crowdloan], Error>) { - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", + return cuckoo_manager.call("didReceiveCrowdloans(result: Result<[Crowdloan], Error>)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) + defaultCall: __defaultImplStub!.didReceiveCrowdloans(result: result)) } - func didReceivePriceData(result: Result) { + func didReceiveDisplayInfo(result: Result) { - return cuckoo_manager.call("didReceivePriceData(result: Result)", + return cuckoo_manager.call("didReceiveDisplayInfo(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + defaultCall: __defaultImplStub!.didReceiveDisplayInfo(result: result)) } - func didReceiveExistentialDeposit(result: Result) { + func didReceiveBlockNumber(result: Result) { - return cuckoo_manager.call("didReceiveExistentialDeposit(result: Result)", + return cuckoo_manager.call("didReceiveBlockNumber(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveExistentialDeposit(result: result)) + defaultCall: __defaultImplStub!.didReceiveBlockNumber(result: result)) } - func didReceiveFee(result: Result) { + func didReceiveBlockDuration(result: Result) { - return cuckoo_manager.call("didReceiveFee(result: Result)", + return cuckoo_manager.call("didReceiveBlockDuration(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + defaultCall: __defaultImplStub!.didReceiveBlockDuration(result: result)) } - func didReceiveController(result: Result) { + func didReceiveLeasingPeriod(result: Result) { - return cuckoo_manager.call("didReceiveController(result: Result)", + return cuckoo_manager.call("didReceiveLeasingPeriod(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveController(result: result)) + defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(result: result)) } - func didReceiveStashItem(result: Result) { + func didReceiveLeasingOffset(result: Result) { - return cuckoo_manager.call("didReceiveStashItem(result: Result)", + return cuckoo_manager.call("didReceiveLeasingOffset(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) + defaultCall: __defaultImplStub!.didReceiveLeasingOffset(result: result)) } - func didReceivePayee(result: Result) { + func didReceiveContributions(result: Result) { - return cuckoo_manager.call("didReceivePayee(result: Result)", + return cuckoo_manager.call("didReceiveContributions(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePayee(result: result)) + defaultCall: __defaultImplStub!.didReceiveContributions(result: result)) } - func didReceiveMinBonded(result: Result) { + func didReceiveExternalContributions(result: Result<[ExternalContribution], Error>) { - return cuckoo_manager.call("didReceiveMinBonded(result: Result)", + return cuckoo_manager.call("didReceiveExternalContributions(result: Result<[ExternalContribution], Error>)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveMinBonded(result: result)) + defaultCall: __defaultImplStub!.didReceiveExternalContributions(result: result)) } - func didReceiveNomination(result: Result) { + func didReceiveLeaseInfo(result: Result) { - return cuckoo_manager.call("didReceiveNomination(result: Result)", + return cuckoo_manager.call("didReceiveLeaseInfo(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveNomination(result: result)) + defaultCall: __defaultImplStub!.didReceiveLeaseInfo(result: result)) } - func didReceiveBondingDuration(result: Result) { + func didReceiveSelectedChain(result: Result) { - return cuckoo_manager.call("didReceiveBondingDuration(result: Result)", + return cuckoo_manager.call("didReceiveSelectedChain(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveBondingDuration(result: result)) + defaultCall: __defaultImplStub!.didReceiveSelectedChain(result: result)) } - func didReceiveStakingDuration(result: Result) { + func didReceiveAccountInfo(result: Result) { - return cuckoo_manager.call("didReceiveStakingDuration(result: Result)", + return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStakingDuration(result: result)) + defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) } - func didSubmitUnbonding(result: Result) { + func didReceivePriceData(result: Result?) { - return cuckoo_manager.call("didSubmitUnbonding(result: Result)", + return cuckoo_manager.call("didReceivePriceData(result: Result?)", parameters: (result), escapingParameters: (result), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didSubmitUnbonding(result: result)) + defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) } - struct __StubbingProxy_StakingUnbondConfirmInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanListInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -53868,74 +53400,69 @@ import SoraFoundation } - func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) + func didReceiveCrowdloans(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[Crowdloan], Error>)> where M1.MatchedType == Result<[Crowdloan], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[Crowdloan], Error>)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveCrowdloans(result: Result<[Crowdloan], Error>)", parameterMatchers: matchers)) } - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + func didReceiveDisplayInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveDisplayInfo(result: Result)", parameterMatchers: matchers)) } - func didReceiveExistentialDeposit(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveExistentialDeposit(result: Result)", parameterMatchers: matchers)) + func didReceiveBlockNumber(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveBlockNumber(result: Result)", parameterMatchers: matchers)) } - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + func didReceiveBlockDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveBlockDuration(result: Result)", parameterMatchers: matchers)) } - func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) + func didReceiveLeasingPeriod(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(result: Result)", parameterMatchers: matchers)) } - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + func didReceiveLeasingOffset(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(result: Result)", parameterMatchers: matchers)) } - func didReceivePayee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceivePayee(result: Result)", parameterMatchers: matchers)) + func didReceiveContributions(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveContributions(result: Result)", parameterMatchers: matchers)) } - func didReceiveMinBonded(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveMinBonded(result: Result)", parameterMatchers: matchers)) + func didReceiveExternalContributions(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result<[ExternalContribution], Error>)> where M1.MatchedType == Result<[ExternalContribution], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[ExternalContribution], Error>)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveExternalContributions(result: Result<[ExternalContribution], Error>)", parameterMatchers: matchers)) } - func didReceiveNomination(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveNomination(result: Result)", parameterMatchers: matchers)) + func didReceiveLeaseInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveLeaseInfo(result: Result)", parameterMatchers: matchers)) } - func didReceiveBondingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveBondingDuration(result: Result)", parameterMatchers: matchers)) + func didReceiveSelectedChain(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveSelectedChain(result: Result)", parameterMatchers: matchers)) } - func didReceiveStakingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didReceiveStakingDuration(result: Result)", parameterMatchers: matchers)) + func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) } - func didSubmitUnbonding(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmInteractorOutputProtocol.self, method: "didSubmitUnbonding(result: Result)", parameterMatchers: matchers)) + func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result?)> where M1.OptionalMatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result?)>] = [wrap(matchable: result) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondConfirmInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanListInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -53950,87 +53477,81 @@ import SoraFoundation @discardableResult - func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveCrowdloans(result: M1) -> Cuckoo.__DoNotUse<(Result<[Crowdloan], Error>), Void> where M1.MatchedType == Result<[Crowdloan], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[Crowdloan], Error>)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveCrowdloans(result: Result<[Crowdloan], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveDisplayInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveDisplayInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveExistentialDeposit(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveExistentialDeposit(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBlockNumber(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBlockNumber(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBlockDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveBlockDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveLeasingPeriod(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingPeriod(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveLeasingOffset(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingOffset(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceivePayee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePayee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveContributions(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveContributions(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveMinBonded(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveMinBonded(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveExternalContributions(result: M1) -> Cuckoo.__DoNotUse<(Result<[ExternalContribution], Error>), Void> where M1.MatchedType == Result<[ExternalContribution], Error> { + let matchers: [Cuckoo.ParameterMatcher<(Result<[ExternalContribution], Error>)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveExternalContributions(result: Result<[ExternalContribution], Error>)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveNomination(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveNomination(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveLeaseInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveLeaseInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveBondingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBondingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveSelectedChain(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveSelectedChain(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStakingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didSubmitUnbonding(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didSubmitUnbonding(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result?), Void> where M1.OptionalMatchedType == Result { + let matchers: [Cuckoo.ParameterMatcher<(Result?)>] = [wrap(matchable: result) { $0 }] + return cuckoo_manager.verify("didReceivePriceData(result: Result?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingUnbondConfirmInteractorOutputProtocolStub: StakingUnbondConfirmInteractorOutputProtocol { + class CrowdloanListInteractorOutputProtocolStub: CrowdloanListInteractorOutputProtocol { @@ -54038,79 +53559,73 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { + func didReceiveCrowdloans(result: Result<[Crowdloan], Error>) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceivePriceData(result: Result) { + func didReceiveDisplayInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveExistentialDeposit(result: Result) { + func didReceiveBlockNumber(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFee(result: Result) { + func didReceiveBlockDuration(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveController(result: Result) { + func didReceiveLeasingPeriod(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStashItem(result: Result) { + func didReceiveLeasingOffset(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceivePayee(result: Result) { + func didReceiveContributions(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveMinBonded(result: Result) { + func didReceiveExternalContributions(result: Result<[ExternalContribution], Error>) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveNomination(result: Result) { + func didReceiveLeaseInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveBondingDuration(result: Result) { + func didReceiveSelectedChain(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStakingDuration(result: Result) { + func didReceiveAccountInfo(result: Result) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didSubmitUnbonding(result: Result) { + func didReceivePriceData(result: Result?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -54118,19 +53633,19 @@ import SoraFoundation - class MockStakingUnbondConfirmWireframeProtocol: StakingUnbondConfirmWireframeProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanListWireframeProtocol: CrowdloanListWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondConfirmWireframeProtocol + typealias MocksType = CrowdloanListWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondConfirmWireframeProtocol - typealias Verification = __VerificationProxy_StakingUnbondConfirmWireframeProtocol + typealias Stubbing = __StubbingProxy_CrowdloanListWireframeProtocol + typealias Verification = __VerificationProxy_CrowdloanListWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondConfirmWireframeProtocol? + private var __defaultImplStub: CrowdloanListWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondConfirmWireframeProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanListWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -54143,16 +53658,61 @@ import SoraFoundation - func complete(from view: StakingUnbondConfirmViewProtocol?) { + func presentContributionSetup(from view: (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?) { - return cuckoo_manager.call("complete(from: StakingUnbondConfirmViewProtocol?)", - parameters: (view), - escapingParameters: (view), + return cuckoo_manager.call("presentContributionSetup(from: (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?)", + parameters: (view, crowdloan, displayInfo), + escapingParameters: (view, crowdloan, displayInfo), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.complete(from: view)) + defaultCall: __defaultImplStub!.presentContributionSetup(from: view, crowdloan: crowdloan, displayInfo: displayInfo)) + + } + + + + func showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from view: ControllerBackedProtocol?) { + + return cuckoo_manager.call("showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from: ControllerBackedProtocol?)", + parameters: (crowdloans, viewInfo, chainAsset, view), + escapingParameters: (crowdloans, viewInfo, chainAsset, view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showYourContributions(crowdloans: crowdloans, viewInfo: viewInfo, chainAsset: chainAsset, from: view)) + + } + + + + func selectChain(from view: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?) { + + return cuckoo_manager.call("selectChain(from: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?)", + parameters: (view, delegate, selectedChainAssetId), + escapingParameters: (view, delegate, selectedChainAssetId), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.selectChain(from: view, delegate: delegate, selectedChainAssetId: selectedChainAssetId)) + + } + + + + func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { + + return cuckoo_manager.call("showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", + parameters: (view, wallet), + escapingParameters: (view, wallet), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showWalletDetails(from: view, wallet: wallet)) } @@ -54187,7 +53747,7 @@ import SoraFoundation } - struct __StubbingProxy_StakingUnbondConfirmWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanListWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -54195,24 +53755,39 @@ import SoraFoundation } - func complete(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingUnbondConfirmViewProtocol?)> where M1.OptionalMatchedType == StakingUnbondConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmWireframeProtocol.self, method: "complete(from: StakingUnbondConfirmViewProtocol?)", parameterMatchers: matchers)) + func presentContributionSetup(from view: M1, crowdloan: M2, displayInfo: M3) -> Cuckoo.ProtocolStubNoReturnFunction<((ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, Crowdloan, CrowdloanDisplayInfo?)> where M1.OptionalMatchedType == (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol), M2.MatchedType == Crowdloan, M3.OptionalMatchedType == CrowdloanDisplayInfo { + let matchers: [Cuckoo.ParameterMatcher<((ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, Crowdloan, CrowdloanDisplayInfo?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: crowdloan) { $0.1 }, wrap(matchable: displayInfo) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "presentContributionSetup(from: (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?)", parameterMatchers: matchers)) + } + + func showYourContributions(crowdloans: M1, viewInfo: M2, chainAsset: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<([Crowdloan], CrowdloansViewInfo, ChainAssetDisplayInfo, ControllerBackedProtocol?)> where M1.MatchedType == [Crowdloan], M2.MatchedType == CrowdloansViewInfo, M3.MatchedType == ChainAssetDisplayInfo, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<([Crowdloan], CrowdloansViewInfo, ChainAssetDisplayInfo, ControllerBackedProtocol?)>] = [wrap(matchable: crowdloans) { $0.0 }, wrap(matchable: viewInfo) { $0.1 }, wrap(matchable: chainAsset) { $0.2 }, wrap(matchable: view) { $0.3 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + } + + func selectChain(from view: M1, delegate: M2, selectedChainAssetId: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, AssetSelectionDelegate, ChainAssetId?)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AssetSelectionDelegate, M3.OptionalMatchedType == ChainAssetId { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AssetSelectionDelegate, ChainAssetId?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }, wrap(matchable: selectedChainAssetId) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "selectChain(from: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?)", parameterMatchers: matchers)) + } + + func showWalletDetails(from view: M1, wallet: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(ControllerBackedProtocol?, MetaAccountModel)> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaAccountModel)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: wallet) { $0.1 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondConfirmWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanListWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondConfirmWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanListWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -54227,9 +53802,27 @@ import SoraFoundation @discardableResult - func complete(from view: M1) -> Cuckoo.__DoNotUse<(StakingUnbondConfirmViewProtocol?), Void> where M1.OptionalMatchedType == StakingUnbondConfirmViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondConfirmViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("complete(from: StakingUnbondConfirmViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func presentContributionSetup(from view: M1, crowdloan: M2, displayInfo: M3) -> Cuckoo.__DoNotUse<((ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, Crowdloan, CrowdloanDisplayInfo?), Void> where M1.OptionalMatchedType == (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol), M2.MatchedType == Crowdloan, M3.OptionalMatchedType == CrowdloanDisplayInfo { + let matchers: [Cuckoo.ParameterMatcher<((ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, Crowdloan, CrowdloanDisplayInfo?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: crowdloan) { $0.1 }, wrap(matchable: displayInfo) { $0.2 }] + return cuckoo_manager.verify("presentContributionSetup(from: (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showYourContributions(crowdloans: M1, viewInfo: M2, chainAsset: M3, from view: M4) -> Cuckoo.__DoNotUse<([Crowdloan], CrowdloansViewInfo, ChainAssetDisplayInfo, ControllerBackedProtocol?), Void> where M1.MatchedType == [Crowdloan], M2.MatchedType == CrowdloansViewInfo, M3.MatchedType == ChainAssetDisplayInfo, M4.OptionalMatchedType == ControllerBackedProtocol { + let matchers: [Cuckoo.ParameterMatcher<([Crowdloan], CrowdloansViewInfo, ChainAssetDisplayInfo, ControllerBackedProtocol?)>] = [wrap(matchable: crowdloans) { $0.0 }, wrap(matchable: viewInfo) { $0.1 }, wrap(matchable: chainAsset) { $0.2 }, wrap(matchable: view) { $0.3 }] + return cuckoo_manager.verify("showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func selectChain(from view: M1, delegate: M2, selectedChainAssetId: M3) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, AssetSelectionDelegate, ChainAssetId?), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == AssetSelectionDelegate, M3.OptionalMatchedType == ChainAssetId { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, AssetSelectionDelegate, ChainAssetId?)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: delegate) { $0.1 }, wrap(matchable: selectedChainAssetId) { $0.2 }] + return cuckoo_manager.verify("selectChain(from: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showWalletDetails(from view: M1, wallet: M2) -> Cuckoo.__DoNotUse<(ControllerBackedProtocol?, MetaAccountModel), Void> where M1.OptionalMatchedType == ControllerBackedProtocol, M2.MatchedType == MetaAccountModel { + let matchers: [Cuckoo.ParameterMatcher<(ControllerBackedProtocol?, MetaAccountModel)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: wallet) { $0.1 }] + return cuckoo_manager.verify("showWalletDetails(from: ControllerBackedProtocol?, wallet: MetaAccountModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -54247,7 +53840,7 @@ import SoraFoundation } } - class StakingUnbondConfirmWireframeProtocolStub: StakingUnbondConfirmWireframeProtocol { + class CrowdloanListWireframeProtocolStub: CrowdloanListWireframeProtocol { @@ -54255,201 +53848,133 @@ import SoraFoundation - func complete(from view: StakingUnbondConfirmViewProtocol?) { + func presentContributionSetup(from view: (ControllerBackedProtocol & AlertPresentable & LoadableViewProtocol)?, crowdloan: Crowdloan, displayInfo: CrowdloanDisplayInfo?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + func showYourContributions(crowdloans: [Crowdloan], viewInfo: CrowdloansViewInfo, chainAsset: ChainAssetDisplayInfo, from view: ControllerBackedProtocol?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func selectChain(from view: ControllerBackedProtocol?, delegate: AssetSelectionDelegate, selectedChainAssetId: ChainAssetId?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } -} - - -import Cuckoo -@testable import novawallet - -import BigInt -import CommonWallet -import Foundation -import SoraFoundation - - - class MockStakingUnbondSetupViewProtocol: StakingUnbondSetupViewProtocol, Cuckoo.ProtocolMock { - - typealias MocksType = StakingUnbondSetupViewProtocol - - typealias Stubbing = __StubbingProxy_StakingUnbondSetupViewProtocol - typealias Verification = __VerificationProxy_StakingUnbondSetupViewProtocol - - let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - - - private var __defaultImplStub: StakingUnbondSetupViewProtocol? - - func enableDefaultImplementation(_ stub: StakingUnbondSetupViewProtocol) { - __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } - + func showWalletDetails(from view: ControllerBackedProtocol?, wallet: MetaAccountModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } - + func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } - public var localizationManager: LocalizationManagerProtocol? { - get { - return cuckoo_manager.getter("localizationManager", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager) - } - - set { - cuckoo_manager.setter("localizationManager", - value: newValue, - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.localizationManager = newValue) - } - + func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} - +import Cuckoo +@testable import novawallet + +import Foundation +import SoraFoundation + + + class MockCrowdloanYourContributionsViewProtocol: CrowdloanYourContributionsViewProtocol, Cuckoo.ProtocolMock { + typealias MocksType = CrowdloanYourContributionsViewProtocol + typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsViewProtocol + typealias Verification = __VerificationProxy_CrowdloanYourContributionsViewProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func didReceiveAsset(viewModel: LocalizableResource) { - - return cuckoo_manager.call("didReceiveAsset(viewModel: LocalizableResource)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAsset(viewModel: viewModel)) - - } - - - - func didReceiveFee(viewModel: LocalizableResource?) { - - return cuckoo_manager.call("didReceiveFee(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveFee(viewModel: viewModel)) - + private var __defaultImplStub: CrowdloanYourContributionsViewProtocol? + + func enableDefaultImplementation(_ stub: CrowdloanYourContributionsViewProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + - func didReceiveInput(viewModel: LocalizableResource) { - - return cuckoo_manager.call("didReceiveInput(viewModel: LocalizableResource)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } } - func didReceiveTransferable(viewModel: LocalizableResource?) { - - return cuckoo_manager.call("didReceiveTransferable(viewModel: LocalizableResource?)", - parameters: (viewModel), - escapingParameters: (viewModel), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveTransferable(viewModel: viewModel)) + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } } + + + - func didReceiveBonding(duration: LocalizableResource) { + + func reload(model: CrowdloanYourContributionsViewModel) { - return cuckoo_manager.call("didReceiveBonding(duration: LocalizableResource)", - parameters: (duration), - escapingParameters: (duration), + return cuckoo_manager.call("reload(model: CrowdloanYourContributionsViewModel)", + parameters: (model), + escapingParameters: (model), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveBonding(duration: duration)) + defaultCall: __defaultImplStub!.reload(model: model)) } - public func applyLocalization() { + func reload(returnInIntervals: [FormattedReturnInIntervalsViewModel]) { - return cuckoo_manager.call("applyLocalization()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("reload(returnInIntervals: [FormattedReturnInIntervalsViewModel])", + parameters: (returnInIntervals), + escapingParameters: (returnInIntervals), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.applyLocalization()) + defaultCall: __defaultImplStub!.reload(returnInIntervals: returnInIntervals)) } - struct __StubbingProxy_StakingUnbondSetupViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanYourContributionsViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -54457,54 +53982,29 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - var localizationManager: Cuckoo.ProtocolToBeStubbedOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager") - } - - - func didReceiveAsset(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveAsset(viewModel: LocalizableResource)", parameterMatchers: matchers)) - } - - func didReceiveFee(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveFee(viewModel: LocalizableResource?)", parameterMatchers: matchers)) - } - - func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveInput(viewModel: LocalizableResource)", parameterMatchers: matchers)) - } - - func didReceiveTransferable(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource?)> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveTransferable(viewModel: LocalizableResource?)", parameterMatchers: matchers)) - } - - func didReceiveBonding(duration: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LocalizableResource)> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: duration) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "didReceiveBonding(duration: LocalizableResource)", parameterMatchers: matchers)) + func reload(model: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanYourContributionsViewModel)> where M1.MatchedType == CrowdloanYourContributionsViewModel { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewModel)>] = [wrap(matchable: model) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsViewProtocol.self, method: "reload(model: CrowdloanYourContributionsViewModel)", parameterMatchers: matchers)) } - func applyLocalization() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupViewProtocol.self, method: "applyLocalization()", parameterMatchers: matchers)) + func reload(returnInIntervals: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([FormattedReturnInIntervalsViewModel])> where M1.MatchedType == [FormattedReturnInIntervalsViewModel] { + let matchers: [Cuckoo.ParameterMatcher<([FormattedReturnInIntervalsViewModel])>] = [wrap(matchable: returnInIntervals) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsViewProtocol.self, method: "reload(returnInIntervals: [FormattedReturnInIntervalsViewModel])", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondSetupViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanYourContributionsViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -54526,53 +54026,24 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } - - var localizationManager: Cuckoo.VerifyOptionalProperty { - return .init(manager: cuckoo_manager, name: "localizationManager", callMatcher: callMatcher, sourceLocation: sourceLocation) - } - @discardableResult - func didReceiveAsset(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveAsset(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveFee(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveFee(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveInput(viewModel: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveTransferable(viewModel: M1) -> Cuckoo.__DoNotUse<(LocalizableResource?), Void> where M1.OptionalMatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource?)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("didReceiveTransferable(viewModel: LocalizableResource?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveBonding(duration: M1) -> Cuckoo.__DoNotUse<(LocalizableResource), Void> where M1.MatchedType == LocalizableResource { - let matchers: [Cuckoo.ParameterMatcher<(LocalizableResource)>] = [wrap(matchable: duration) { $0 }] - return cuckoo_manager.verify("didReceiveBonding(duration: LocalizableResource)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload(model: M1) -> Cuckoo.__DoNotUse<(CrowdloanYourContributionsViewModel), Void> where M1.MatchedType == CrowdloanYourContributionsViewModel { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewModel)>] = [wrap(matchable: model) { $0 }] + return cuckoo_manager.verify("reload(model: CrowdloanYourContributionsViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func applyLocalization() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("applyLocalization()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func reload(returnInIntervals: M1) -> Cuckoo.__DoNotUse<([FormattedReturnInIntervalsViewModel]), Void> where M1.MatchedType == [FormattedReturnInIntervalsViewModel] { + let matchers: [Cuckoo.ParameterMatcher<([FormattedReturnInIntervalsViewModel])>] = [wrap(matchable: returnInIntervals) { $0 }] + return cuckoo_manager.verify("reload(returnInIntervals: [FormattedReturnInIntervalsViewModel])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingUnbondSetupViewProtocolStub: StakingUnbondSetupViewProtocol { + class CrowdloanYourContributionsViewProtocolStub: CrowdloanYourContributionsViewProtocol { @@ -54591,17 +54062,6 @@ import SoraFoundation } } - - - - public var localizationManager: LocalizationManagerProtocol? { - get { - return DefaultValueRegistry.defaultValue(for: (LocalizationManagerProtocol?).self) - } - - set { } - - } @@ -54609,37 +54069,13 @@ import SoraFoundation - func didReceiveAsset(viewModel: LocalizableResource) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveFee(viewModel: LocalizableResource?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveInput(viewModel: LocalizableResource) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveTransferable(viewModel: LocalizableResource?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveBonding(duration: LocalizableResource) { + func reload(model: CrowdloanYourContributionsViewModel) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - public func applyLocalization() { + func reload(returnInIntervals: [FormattedReturnInIntervalsViewModel]) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -54647,19 +54083,19 @@ import SoraFoundation - class MockStakingUnbondSetupPresenterProtocol: StakingUnbondSetupPresenterProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanYourContributionsPresenterProtocol: CrowdloanYourContributionsPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondSetupPresenterProtocol + typealias MocksType = CrowdloanYourContributionsPresenterProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondSetupPresenterProtocol - typealias Verification = __VerificationProxy_StakingUnbondSetupPresenterProtocol + typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsPresenterProtocol + typealias Verification = __VerificationProxy_CrowdloanYourContributionsPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondSetupPresenterProtocol? + private var __defaultImplStub: CrowdloanYourContributionsPresenterProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondSetupPresenterProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanYourContributionsPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -54685,68 +54121,116 @@ import SoraFoundation } + + struct __StubbingProxy_CrowdloanYourContributionsPresenterProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_CrowdloanYourContributionsPresenterProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func setup() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class CrowdloanYourContributionsPresenterProtocolStub: CrowdloanYourContributionsPresenterProtocol { + + + - func selectAmountPercentage(_ percentage: Float) { - - return cuckoo_manager.call("selectAmountPercentage(_: Float)", - parameters: (percentage), - escapingParameters: (percentage), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.selectAmountPercentage(percentage)) - + + + func setup() { + return DefaultValueRegistry.defaultValue(for: (Void).self) } +} + + + + class MockCrowdloanYourContributionsVMFactoryProtocol: CrowdloanYourContributionsVMFactoryProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = CrowdloanYourContributionsVMFactoryProtocol + typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsVMFactoryProtocol + typealias Verification = __VerificationProxy_CrowdloanYourContributionsVMFactoryProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func updateAmount(_ newValue: Decimal) { - - return cuckoo_manager.call("updateAmount(_: Decimal)", - parameters: (newValue), - escapingParameters: (newValue), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.updateAmount(newValue)) - + private var __defaultImplStub: CrowdloanYourContributionsVMFactoryProtocol? + + func enableDefaultImplementation(_ stub: CrowdloanYourContributionsVMFactoryProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + + + - func proceed() { + + + func createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel { - return cuckoo_manager.call("proceed()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel", + parameters: (input, externalContributions, amount, price, locale), + escapingParameters: (input, externalContributions, amount, price, locale), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.createViewModel(input: input, externalContributions: externalContributions, amount: amount, price: price, locale: locale)) } - func close() { + func createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel] { - return cuckoo_manager.call("close()", - parameters: (), - escapingParameters: (), + return cuckoo_manager.call("createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel]", + parameters: (input, externalContributions, metadata), + escapingParameters: (input, externalContributions, metadata), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.close()) + defaultCall: __defaultImplStub!.createReturnInIntervals(input: input, externalContributions: externalContributions, metadata: metadata)) } - struct __StubbingProxy_StakingUnbondSetupPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanYourContributionsVMFactoryProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -54754,34 +54238,19 @@ import SoraFoundation } - func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func selectAmountPercentage(_ percentage: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Float)> where M1.MatchedType == Float { - let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "selectAmountPercentage(_: Float)", parameterMatchers: matchers)) - } - - func updateAmount(_ newValue: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Decimal)> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "updateAmount(_: Decimal)", parameterMatchers: matchers)) - } - - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + func createViewModel(input: M1, externalContributions: M2, amount: M3, price: M4, locale: M5) -> Cuckoo.ProtocolStubFunction<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, Decimal, PriceData?, Locale), CrowdloanYourContributionsViewModel> where M1.MatchedType == CrowdloanYourContributionsViewInput, M2.OptionalMatchedType == [ExternalContribution], M3.MatchedType == Decimal, M4.OptionalMatchedType == PriceData, M5.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, Decimal, PriceData?, Locale)>] = [wrap(matchable: input) { $0.0 }, wrap(matchable: externalContributions) { $0.1 }, wrap(matchable: amount) { $0.2 }, wrap(matchable: price) { $0.3 }, wrap(matchable: locale) { $0.4 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsVMFactoryProtocol.self, method: "createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel", parameterMatchers: matchers)) } - func close() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupPresenterProtocol.self, method: "close()", parameterMatchers: matchers)) + func createReturnInIntervals(input: M1, externalContributions: M2, metadata: M3) -> Cuckoo.ProtocolStubFunction<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, CrowdloanMetadata), [ReturnInIntervalsViewModel]> where M1.MatchedType == CrowdloanYourContributionsViewInput, M2.OptionalMatchedType == [ExternalContribution], M3.MatchedType == CrowdloanMetadata { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, CrowdloanMetadata)>] = [wrap(matchable: input) { $0.0 }, wrap(matchable: externalContributions) { $0.1 }, wrap(matchable: metadata) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsVMFactoryProtocol.self, method: "createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel]", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondSetupPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanYourContributionsVMFactoryProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -54796,39 +54265,21 @@ import SoraFoundation @discardableResult - func setup() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func selectAmountPercentage(_ percentage: M1) -> Cuckoo.__DoNotUse<(Float), Void> where M1.MatchedType == Float { - let matchers: [Cuckoo.ParameterMatcher<(Float)>] = [wrap(matchable: percentage) { $0 }] - return cuckoo_manager.verify("selectAmountPercentage(_: Float)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func updateAmount(_ newValue: M1) -> Cuckoo.__DoNotUse<(Decimal), Void> where M1.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(Decimal)>] = [wrap(matchable: newValue) { $0 }] - return cuckoo_manager.verify("updateAmount(_: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func createViewModel(input: M1, externalContributions: M2, amount: M3, price: M4, locale: M5) -> Cuckoo.__DoNotUse<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, Decimal, PriceData?, Locale), CrowdloanYourContributionsViewModel> where M1.MatchedType == CrowdloanYourContributionsViewInput, M2.OptionalMatchedType == [ExternalContribution], M3.MatchedType == Decimal, M4.OptionalMatchedType == PriceData, M5.MatchedType == Locale { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, Decimal, PriceData?, Locale)>] = [wrap(matchable: input) { $0.0 }, wrap(matchable: externalContributions) { $0.1 }, wrap(matchable: amount) { $0.2 }, wrap(matchable: price) { $0.3 }, wrap(matchable: locale) { $0.4 }] + return cuckoo_manager.verify("createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func close() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("close()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func createReturnInIntervals(input: M1, externalContributions: M2, metadata: M3) -> Cuckoo.__DoNotUse<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, CrowdloanMetadata), [ReturnInIntervalsViewModel]> where M1.MatchedType == CrowdloanYourContributionsViewInput, M2.OptionalMatchedType == [ExternalContribution], M3.MatchedType == CrowdloanMetadata { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanYourContributionsViewInput, [ExternalContribution]?, CrowdloanMetadata)>] = [wrap(matchable: input) { $0.0 }, wrap(matchable: externalContributions) { $0.1 }, wrap(matchable: metadata) { $0.2 }] + return cuckoo_manager.verify("createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel]", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingUnbondSetupPresenterProtocolStub: StakingUnbondSetupPresenterProtocol { + class CrowdloanYourContributionsVMFactoryProtocolStub: CrowdloanYourContributionsVMFactoryProtocol { @@ -54836,51 +54287,33 @@ import SoraFoundation - func setup() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func selectAmountPercentage(_ percentage: Float) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func updateAmount(_ newValue: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func proceed() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func createViewModel(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, amount: Decimal, price: PriceData?, locale: Locale) -> CrowdloanYourContributionsViewModel { + return DefaultValueRegistry.defaultValue(for: (CrowdloanYourContributionsViewModel).self) } - func close() { - return DefaultValueRegistry.defaultValue(for: (Void).self) + func createReturnInIntervals(input: CrowdloanYourContributionsViewInput, externalContributions: [ExternalContribution]?, metadata: CrowdloanMetadata) -> [ReturnInIntervalsViewModel] { + return DefaultValueRegistry.defaultValue(for: ([ReturnInIntervalsViewModel]).self) } } - class MockStakingUnbondSetupInteractorInputProtocol: StakingUnbondSetupInteractorInputProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanYourContributionsInteractorInputProtocol: CrowdloanYourContributionsInteractorInputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondSetupInteractorInputProtocol + typealias MocksType = CrowdloanYourContributionsInteractorInputProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondSetupInteractorInputProtocol - typealias Verification = __VerificationProxy_StakingUnbondSetupInteractorInputProtocol + typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsInteractorInputProtocol + typealias Verification = __VerificationProxy_CrowdloanYourContributionsInteractorInputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondSetupInteractorInputProtocol? + private var __defaultImplStub: CrowdloanYourContributionsInteractorInputProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondSetupInteractorInputProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanYourContributionsInteractorInputProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -54906,23 +54339,8 @@ import SoraFoundation } - - - func estimateFee() { - - return cuckoo_manager.call("estimateFee()", - parameters: (), - escapingParameters: (), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.estimateFee()) - - } - - struct __StubbingProxy_StakingUnbondSetupInteractorInputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanYourContributionsInteractorInputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -54932,17 +54350,12 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) - } - - func estimateFee() -> Cuckoo.ProtocolStubNoReturnFunction<()> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorInputProtocol.self, method: "estimateFee()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorInputProtocol.self, method: "setup()", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondSetupInteractorInputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanYourContributionsInteractorInputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -54962,16 +54375,10 @@ import SoraFoundation return cuckoo_manager.verify("setup()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } - @discardableResult - func estimateFee() -> Cuckoo.__DoNotUse<(), Void> { - let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("estimateFee()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - } } - class StakingUnbondSetupInteractorInputProtocolStub: StakingUnbondSetupInteractorInputProtocol { + class CrowdloanYourContributionsInteractorInputProtocolStub: CrowdloanYourContributionsInteractorInputProtocol { @@ -54983,176 +54390,140 @@ import SoraFoundation return DefaultValueRegistry.defaultValue(for: (Void).self) } - - - func estimateFee() { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - } - class MockStakingUnbondSetupInteractorOutputProtocol: StakingUnbondSetupInteractorOutputProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanYourContributionsInteractorOutputProtocol: CrowdloanYourContributionsInteractorOutputProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondSetupInteractorOutputProtocol + typealias MocksType = CrowdloanYourContributionsInteractorOutputProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondSetupInteractorOutputProtocol - typealias Verification = __VerificationProxy_StakingUnbondSetupInteractorOutputProtocol + typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsInteractorOutputProtocol + typealias Verification = __VerificationProxy_CrowdloanYourContributionsInteractorOutputProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondSetupInteractorOutputProtocol? + private var __defaultImplStub: CrowdloanYourContributionsInteractorOutputProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondSetupInteractorOutputProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanYourContributionsInteractorOutputProtocol) { __defaultImplStub = stub - cuckoo_manager.enableDefaultStubImplementation() - } - - - - - - - - - - func didReceiveStakingLedger(result: Result) { - - return cuckoo_manager.call("didReceiveStakingLedger(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveStakingLedger(result: result)) - + cuckoo_manager.enableDefaultStubImplementation() } + + - func didReceiveAccountInfo(result: Result) { - - return cuckoo_manager.call("didReceiveAccountInfo(result: Result)", - parameters: (result), - escapingParameters: (result), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.didReceiveAccountInfo(result: result)) - - } + - func didReceivePriceData(result: Result) { + func didReceiveExternalContributions(_ externalContributions: [ExternalContribution]) { - return cuckoo_manager.call("didReceivePriceData(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveExternalContributions(_: [ExternalContribution])", + parameters: (externalContributions), + escapingParameters: (externalContributions), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceivePriceData(result: result)) + defaultCall: __defaultImplStub!.didReceiveExternalContributions(externalContributions)) } - func didReceiveBondingDuration(result: Result) { + func didReceiveBlockNumber(_ blockNumber: BlockNumber?) { - return cuckoo_manager.call("didReceiveBondingDuration(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveBlockNumber(_: BlockNumber?)", + parameters: (blockNumber), + escapingParameters: (blockNumber), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveBondingDuration(result: result)) + defaultCall: __defaultImplStub!.didReceiveBlockNumber(blockNumber)) } - func didReceiveExistentialDeposit(result: Result) { + func didReceiveBlockDuration(_ blockDuration: BlockTime) { - return cuckoo_manager.call("didReceiveExistentialDeposit(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveBlockDuration(_: BlockTime)", + parameters: (blockDuration), + escapingParameters: (blockDuration), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveExistentialDeposit(result: result)) + defaultCall: __defaultImplStub!.didReceiveBlockDuration(blockDuration)) } - func didReceiveFee(result: Result) { + func didReceiveLeasingPeriod(_ leasingPeriod: LeasingPeriod) { - return cuckoo_manager.call("didReceiveFee(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveLeasingPeriod(_: LeasingPeriod)", + parameters: (leasingPeriod), + escapingParameters: (leasingPeriod), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveFee(result: result)) + defaultCall: __defaultImplStub!.didReceiveLeasingPeriod(leasingPeriod)) } - func didReceiveController(result: Result) { + func didReceiveLeasingOffset(_ leasingOffset: LeasingOffset) { - return cuckoo_manager.call("didReceiveController(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveLeasingOffset(_: LeasingOffset)", + parameters: (leasingOffset), + escapingParameters: (leasingOffset), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveController(result: result)) + defaultCall: __defaultImplStub!.didReceiveLeasingOffset(leasingOffset)) } - func didReceiveStashItem(result: Result) { + func didReceivePrice(_ priceData: PriceData?) { - return cuckoo_manager.call("didReceiveStashItem(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceivePrice(_: PriceData?)", + parameters: (priceData), + escapingParameters: (priceData), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStashItem(result: result)) + defaultCall: __defaultImplStub!.didReceivePrice(priceData)) } - func didReceiveStakingDuration(result: Result) { + func didReceiveError(_ error: Error) { - return cuckoo_manager.call("didReceiveStakingDuration(result: Result)", - parameters: (result), - escapingParameters: (result), + return cuckoo_manager.call("didReceiveError(_: Error)", + parameters: (error), + escapingParameters: (error), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.didReceiveStakingDuration(result: result)) + defaultCall: __defaultImplStub!.didReceiveError(error)) } - struct __StubbingProxy_StakingUnbondSetupInteractorOutputProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CrowdloanYourContributionsInteractorOutputProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -55160,54 +54531,44 @@ import SoraFoundation } - func didReceiveStakingLedger(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveStakingLedger(result: Result)", parameterMatchers: matchers)) - } - - func didReceiveAccountInfo(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveAccountInfo(result: Result)", parameterMatchers: matchers)) - } - - func didReceivePriceData(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceivePriceData(result: Result)", parameterMatchers: matchers)) + func didReceiveExternalContributions(_ externalContributions: M1) -> Cuckoo.ProtocolStubNoReturnFunction<([ExternalContribution])> where M1.MatchedType == [ExternalContribution] { + let matchers: [Cuckoo.ParameterMatcher<([ExternalContribution])>] = [wrap(matchable: externalContributions) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveExternalContributions(_: [ExternalContribution])", parameterMatchers: matchers)) } - func didReceiveBondingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveBondingDuration(result: Result)", parameterMatchers: matchers)) + func didReceiveBlockNumber(_ blockNumber: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BlockNumber?)> where M1.OptionalMatchedType == BlockNumber { + let matchers: [Cuckoo.ParameterMatcher<(BlockNumber?)>] = [wrap(matchable: blockNumber) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveBlockNumber(_: BlockNumber?)", parameterMatchers: matchers)) } - func didReceiveExistentialDeposit(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveExistentialDeposit(result: Result)", parameterMatchers: matchers)) + func didReceiveBlockDuration(_ blockDuration: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(BlockTime)> where M1.MatchedType == BlockTime { + let matchers: [Cuckoo.ParameterMatcher<(BlockTime)>] = [wrap(matchable: blockDuration) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveBlockDuration(_: BlockTime)", parameterMatchers: matchers)) } - func didReceiveFee(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveFee(result: Result)", parameterMatchers: matchers)) + func didReceiveLeasingPeriod(_ leasingPeriod: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LeasingPeriod)> where M1.MatchedType == LeasingPeriod { + let matchers: [Cuckoo.ParameterMatcher<(LeasingPeriod)>] = [wrap(matchable: leasingPeriod) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveLeasingPeriod(_: LeasingPeriod)", parameterMatchers: matchers)) } - func didReceiveController(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveController(result: Result)", parameterMatchers: matchers)) + func didReceiveLeasingOffset(_ leasingOffset: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LeasingOffset)> where M1.MatchedType == LeasingOffset { + let matchers: [Cuckoo.ParameterMatcher<(LeasingOffset)>] = [wrap(matchable: leasingOffset) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveLeasingOffset(_: LeasingOffset)", parameterMatchers: matchers)) } - func didReceiveStashItem(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveStashItem(result: Result)", parameterMatchers: matchers)) + func didReceivePrice(_ priceData: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(PriceData?)> where M1.OptionalMatchedType == PriceData { + let matchers: [Cuckoo.ParameterMatcher<(PriceData?)>] = [wrap(matchable: priceData) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceivePrice(_: PriceData?)", parameterMatchers: matchers)) } - func didReceiveStakingDuration(result: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Result)> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupInteractorOutputProtocol.self, method: "didReceiveStakingDuration(result: Result)", parameterMatchers: matchers)) + func didReceiveError(_ error: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Error)> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCrowdloanYourContributionsInteractorOutputProtocol.self, method: "didReceiveError(_: Error)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondSetupInteractorOutputProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CrowdloanYourContributionsInteractorOutputProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -55222,63 +54583,51 @@ import SoraFoundation @discardableResult - func didReceiveStakingLedger(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingLedger(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceiveAccountInfo(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveAccountInfo(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func didReceivePriceData(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceivePriceData(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveExternalContributions(_ externalContributions: M1) -> Cuckoo.__DoNotUse<([ExternalContribution]), Void> where M1.MatchedType == [ExternalContribution] { + let matchers: [Cuckoo.ParameterMatcher<([ExternalContribution])>] = [wrap(matchable: externalContributions) { $0 }] + return cuckoo_manager.verify("didReceiveExternalContributions(_: [ExternalContribution])", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveBondingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveBondingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBlockNumber(_ blockNumber: M1) -> Cuckoo.__DoNotUse<(BlockNumber?), Void> where M1.OptionalMatchedType == BlockNumber { + let matchers: [Cuckoo.ParameterMatcher<(BlockNumber?)>] = [wrap(matchable: blockNumber) { $0 }] + return cuckoo_manager.verify("didReceiveBlockNumber(_: BlockNumber?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveExistentialDeposit(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveExistentialDeposit(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveBlockDuration(_ blockDuration: M1) -> Cuckoo.__DoNotUse<(BlockTime), Void> where M1.MatchedType == BlockTime { + let matchers: [Cuckoo.ParameterMatcher<(BlockTime)>] = [wrap(matchable: blockDuration) { $0 }] + return cuckoo_manager.verify("didReceiveBlockDuration(_: BlockTime)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveFee(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveFee(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveLeasingPeriod(_ leasingPeriod: M1) -> Cuckoo.__DoNotUse<(LeasingPeriod), Void> where M1.MatchedType == LeasingPeriod { + let matchers: [Cuckoo.ParameterMatcher<(LeasingPeriod)>] = [wrap(matchable: leasingPeriod) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingPeriod(_: LeasingPeriod)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveController(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveController(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveLeasingOffset(_ leasingOffset: M1) -> Cuckoo.__DoNotUse<(LeasingOffset), Void> where M1.MatchedType == LeasingOffset { + let matchers: [Cuckoo.ParameterMatcher<(LeasingOffset)>] = [wrap(matchable: leasingOffset) { $0 }] + return cuckoo_manager.verify("didReceiveLeasingOffset(_: LeasingOffset)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStashItem(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStashItem(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceivePrice(_ priceData: M1) -> Cuckoo.__DoNotUse<(PriceData?), Void> where M1.OptionalMatchedType == PriceData { + let matchers: [Cuckoo.ParameterMatcher<(PriceData?)>] = [wrap(matchable: priceData) { $0 }] + return cuckoo_manager.verify("didReceivePrice(_: PriceData?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult - func didReceiveStakingDuration(result: M1) -> Cuckoo.__DoNotUse<(Result), Void> where M1.MatchedType == Result { - let matchers: [Cuckoo.ParameterMatcher<(Result)>] = [wrap(matchable: result) { $0 }] - return cuckoo_manager.verify("didReceiveStakingDuration(result: Result)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceiveError(_ error: M1) -> Cuckoo.__DoNotUse<(Error), Void> where M1.MatchedType == Error { + let matchers: [Cuckoo.ParameterMatcher<(Error)>] = [wrap(matchable: error) { $0 }] + return cuckoo_manager.verify("didReceiveError(_: Error)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingUnbondSetupInteractorOutputProtocolStub: StakingUnbondSetupInteractorOutputProtocol { + class CrowdloanYourContributionsInteractorOutputProtocolStub: CrowdloanYourContributionsInteractorOutputProtocol { @@ -55286,55 +54635,43 @@ import SoraFoundation - func didReceiveStakingLedger(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceiveAccountInfo(result: Result) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func didReceivePriceData(result: Result) { + func didReceiveExternalContributions(_ externalContributions: [ExternalContribution]) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveBondingDuration(result: Result) { + func didReceiveBlockNumber(_ blockNumber: BlockNumber?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveExistentialDeposit(result: Result) { + func didReceiveBlockDuration(_ blockDuration: BlockTime) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveFee(result: Result) { + func didReceiveLeasingPeriod(_ leasingPeriod: LeasingPeriod) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveController(result: Result) { + func didReceiveLeasingOffset(_ leasingOffset: LeasingOffset) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStashItem(result: Result) { + func didReceivePrice(_ priceData: PriceData?) { return DefaultValueRegistry.defaultValue(for: (Void).self) } - func didReceiveStakingDuration(result: Result) { + func didReceiveError(_ error: Error) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -55342,19 +54679,19 @@ import SoraFoundation - class MockStakingUnbondSetupWireframeProtocol: StakingUnbondSetupWireframeProtocol, Cuckoo.ProtocolMock { + class MockCrowdloanYourContributionsWireframeProtocol: CrowdloanYourContributionsWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = StakingUnbondSetupWireframeProtocol + typealias MocksType = CrowdloanYourContributionsWireframeProtocol - typealias Stubbing = __StubbingProxy_StakingUnbondSetupWireframeProtocol - typealias Verification = __VerificationProxy_StakingUnbondSetupWireframeProtocol + typealias Stubbing = __StubbingProxy_CrowdloanYourContributionsWireframeProtocol + typealias Verification = __VerificationProxy_CrowdloanYourContributionsWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: StakingUnbondSetupWireframeProtocol? + private var __defaultImplStub: CrowdloanYourContributionsWireframeProtocol? - func enableDefaultImplementation(_ stub: StakingUnbondSetupWireframeProtocol) { + func enableDefaultImplementation(_ stub: CrowdloanYourContributionsWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -55365,68 +54702,89 @@ import SoraFoundation + + struct __StubbingProxy_CrowdloanYourContributionsWireframeProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + } + + struct __VerificationProxy_CrowdloanYourContributionsWireframeProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + } +} + + class CrowdloanYourContributionsWireframeProtocolStub: CrowdloanYourContributionsWireframeProtocol { + + + - func close(view: StakingUnbondSetupViewProtocol?) { - - return cuckoo_manager.call("close(view: StakingUnbondSetupViewProtocol?)", - parameters: (view), - escapingParameters: (view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.close(view: view)) - - } +} + + +import Cuckoo +@testable import novawallet + +import Foundation + + + class MockCustomCrowdloanDelegate: CustomCrowdloanDelegate, Cuckoo.ProtocolMock { + typealias MocksType = CustomCrowdloanDelegate + typealias Stubbing = __StubbingProxy_CustomCrowdloanDelegate + typealias Verification = __VerificationProxy_CustomCrowdloanDelegate + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + - func proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal) { - - return cuckoo_manager.call("proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal)", - parameters: (view, amount), - escapingParameters: (view, amount), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.proceed(view: view, amount: amount)) - + private var __defaultImplStub: CustomCrowdloanDelegate? + + func enableDefaultImplementation(_ stub: CustomCrowdloanDelegate) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() } + + - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - - return cuckoo_manager.call("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", - parameters: (message, title, closeAction, view), - escapingParameters: (message, title, closeAction, view), - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.present(message: message, title: title, closeAction: closeAction, from: view)) - - } + - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceive(bonusService: CrowdloanBonusServiceProtocol) { - return cuckoo_manager.call("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", - parameters: (viewModel, style, view), - escapingParameters: (viewModel, style, view), + return cuckoo_manager.call("didReceive(bonusService: CrowdloanBonusServiceProtocol)", + parameters: (bonusService), + escapingParameters: (bonusService), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.present(viewModel: viewModel, style: style, from: view)) + defaultCall: __defaultImplStub!.didReceive(bonusService: bonusService)) } - struct __StubbingProxy_StakingUnbondSetupWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_CustomCrowdloanDelegate: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -55434,29 +54792,14 @@ import SoraFoundation } - func close(view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingUnbondSetupViewProtocol?)> where M1.OptionalMatchedType == StakingUnbondSetupViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupWireframeProtocol.self, method: "close(view: StakingUnbondSetupViewProtocol?)", parameterMatchers: matchers)) - } - - func proceed(view: M1, amount: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(StakingUnbondSetupViewProtocol?, Decimal)> where M1.OptionalMatchedType == StakingUnbondSetupViewProtocol, M2.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondSetupViewProtocol?, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: amount) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupWireframeProtocol.self, method: "proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal)", parameterMatchers: matchers)) - } - - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) - } - - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockStakingUnbondSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + func didReceive(bonusService: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(CrowdloanBonusServiceProtocol)> where M1.MatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanBonusServiceProtocol)>] = [wrap(matchable: bonusService) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockCustomCrowdloanDelegate.self, method: "didReceive(bonusService: CrowdloanBonusServiceProtocol)", parameterMatchers: matchers)) } } - struct __VerificationProxy_StakingUnbondSetupWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_CustomCrowdloanDelegate: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -55471,33 +54814,15 @@ import SoraFoundation @discardableResult - func close(view: M1) -> Cuckoo.__DoNotUse<(StakingUnbondSetupViewProtocol?), Void> where M1.OptionalMatchedType == StakingUnbondSetupViewProtocol { - let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondSetupViewProtocol?)>] = [wrap(matchable: view) { $0 }] - return cuckoo_manager.verify("close(view: StakingUnbondSetupViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func proceed(view: M1, amount: M2) -> Cuckoo.__DoNotUse<(StakingUnbondSetupViewProtocol?, Decimal), Void> where M1.OptionalMatchedType == StakingUnbondSetupViewProtocol, M2.MatchedType == Decimal { - let matchers: [Cuckoo.ParameterMatcher<(StakingUnbondSetupViewProtocol?, Decimal)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: amount) { $0.1 }] - return cuckoo_manager.verify("proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.__DoNotUse<(String?, String?, String?, ControllerBackedProtocol?), Void> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return cuckoo_manager.verify("present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) - } - - @discardableResult - func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.__DoNotUse<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?), Void> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { - let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return cuckoo_manager.verify("present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func didReceive(bonusService: M1) -> Cuckoo.__DoNotUse<(CrowdloanBonusServiceProtocol), Void> where M1.MatchedType == CrowdloanBonusServiceProtocol { + let matchers: [Cuckoo.ParameterMatcher<(CrowdloanBonusServiceProtocol)>] = [wrap(matchable: bonusService) { $0 }] + return cuckoo_manager.verify("didReceive(bonusService: CrowdloanBonusServiceProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class StakingUnbondSetupWireframeProtocolStub: StakingUnbondSetupWireframeProtocol { + class CustomCrowdloanDelegateStub: CustomCrowdloanDelegate { @@ -55505,25 +54830,7 @@ import SoraFoundation - func close(view: StakingUnbondSetupViewProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func proceed(view: StakingUnbondSetupViewProtocol?, amount: Decimal) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(message: String?, title: String?, closeAction: String?, from view: ControllerBackedProtocol?) { - return DefaultValueRegistry.defaultValue(for: (Void).self) - } - - - - func present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from view: ControllerBackedProtocol?) { + func didReceive(bonusService: CrowdloanBonusServiceProtocol) { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -55536,74 +54843,192 @@ import Cuckoo import SoraFoundation - class MockUsernameSetupViewProtocol: UsernameSetupViewProtocol, Cuckoo.ProtocolMock { + class MockReferralCrowdloanViewProtocol: ReferralCrowdloanViewProtocol, Cuckoo.ProtocolMock { - typealias MocksType = UsernameSetupViewProtocol + typealias MocksType = ReferralCrowdloanViewProtocol - typealias Stubbing = __StubbingProxy_UsernameSetupViewProtocol - typealias Verification = __VerificationProxy_UsernameSetupViewProtocol + typealias Stubbing = __StubbingProxy_ReferralCrowdloanViewProtocol + typealias Verification = __VerificationProxy_ReferralCrowdloanViewProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: UsernameSetupViewProtocol? + private var __defaultImplStub: ReferralCrowdloanViewProtocol? - func enableDefaultImplementation(_ stub: UsernameSetupViewProtocol) { + func enableDefaultImplementation(_ stub: ReferralCrowdloanViewProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } - + + + + + var isSetup: Bool { + get { + return cuckoo_manager.getter("isSetup", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.isSetup) + } + + } + + + + var controller: UIViewController { + get { + return cuckoo_manager.getter("controller", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.controller) + } + + } + + + + var loadableContentView: UIView! { + get { + return cuckoo_manager.getter("loadableContentView", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.loadableContentView) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return cuckoo_manager.getter("shouldDisableInteractionWhenLoading", + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.shouldDisableInteractionWhenLoading) + } + + } + + + + + + + + func didReceiveLearnMore(viewModel: LearnMoreViewModel) { + + return cuckoo_manager.call("didReceiveLearnMore(viewModel: LearnMoreViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveLearnMore(viewModel: viewModel)) + + } + + + + func didReceiveReferral(viewModel: ReferralCrowdloanViewModel) { + + return cuckoo_manager.call("didReceiveReferral(viewModel: ReferralCrowdloanViewModel)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveReferral(viewModel: viewModel)) + + } + + func didReceiveInput(viewModel: InputViewModelProtocol) { + + return cuckoo_manager.call("didReceiveInput(viewModel: InputViewModelProtocol)", + parameters: (viewModel), + escapingParameters: (viewModel), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveInput(viewModel: viewModel)) + + } - var isSetup: Bool { - get { - return cuckoo_manager.getter("isSetup", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.isSetup) - } + + + func didReceiveShouldInputCode() { + + return cuckoo_manager.call("didReceiveShouldInputCode()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveShouldInputCode()) } - var controller: UIViewController { - get { - return cuckoo_manager.getter("controller", - superclassCall: - - Cuckoo.MockManager.crashOnProtocolSuperclassCall() - , - defaultCall: __defaultImplStub!.controller) - } + func didReceiveShouldAgreeTerms() { + + return cuckoo_manager.call("didReceiveShouldAgreeTerms()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveShouldAgreeTerms()) } - - + + func didStartLoading() { + + return cuckoo_manager.call("didStartLoading()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didStartLoading()) + + } - func setInput(viewModel: InputViewModelProtocol) { + func didStopLoading() { - return cuckoo_manager.call("setInput(viewModel: InputViewModelProtocol)", - parameters: (viewModel), - escapingParameters: (viewModel), + return cuckoo_manager.call("didStopLoading()", + parameters: (), + escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.setInput(viewModel: viewModel)) + defaultCall: __defaultImplStub!.didStopLoading()) } - struct __StubbingProxy_UsernameSetupViewProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ReferralCrowdloanViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -55611,24 +55036,64 @@ import SoraFoundation } - var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var isSetup: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "isSetup") } - var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + var controller: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { return .init(manager: cuckoo_manager, name: "controller") } - func setInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(InputViewModelProtocol)> where M1.MatchedType == InputViewModelProtocol { + var loadableContentView: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView") + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.ProtocolToBeStubbedReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading") + } + + + func didReceiveLearnMore(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(LearnMoreViewModel)> where M1.MatchedType == LearnMoreViewModel { + let matchers: [Cuckoo.ParameterMatcher<(LearnMoreViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveLearnMore(viewModel: LearnMoreViewModel)", parameterMatchers: matchers)) + } + + func didReceiveReferral(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ReferralCrowdloanViewModel)> where M1.MatchedType == ReferralCrowdloanViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ReferralCrowdloanViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveReferral(viewModel: ReferralCrowdloanViewModel)", parameterMatchers: matchers)) + } + + func didReceiveInput(viewModel: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(InputViewModelProtocol)> where M1.MatchedType == InputViewModelProtocol { let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupViewProtocol.self, method: "setInput(viewModel: InputViewModelProtocol)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveInput(viewModel: InputViewModelProtocol)", parameterMatchers: matchers)) + } + + func didReceiveShouldInputCode() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveShouldInputCode()", parameterMatchers: matchers)) + } + + func didReceiveShouldAgreeTerms() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didReceiveShouldAgreeTerms()", parameterMatchers: matchers)) + } + + func didStartLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didStartLoading()", parameterMatchers: matchers)) + } + + func didStopLoading() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanViewProtocol.self, method: "didStopLoading()", parameterMatchers: matchers)) } } - struct __VerificationProxy_UsernameSetupViewProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ReferralCrowdloanViewProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -55650,18 +55115,64 @@ import SoraFoundation return .init(manager: cuckoo_manager, name: "controller", callMatcher: callMatcher, sourceLocation: sourceLocation) } + + var loadableContentView: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "loadableContentView", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + + + var shouldDisableInteractionWhenLoading: Cuckoo.VerifyReadOnlyProperty { + return .init(manager: cuckoo_manager, name: "shouldDisableInteractionWhenLoading", callMatcher: callMatcher, sourceLocation: sourceLocation) + } + @discardableResult - func setInput(viewModel: M1) -> Cuckoo.__DoNotUse<(InputViewModelProtocol), Void> where M1.MatchedType == InputViewModelProtocol { + func didReceiveLearnMore(viewModel: M1) -> Cuckoo.__DoNotUse<(LearnMoreViewModel), Void> where M1.MatchedType == LearnMoreViewModel { + let matchers: [Cuckoo.ParameterMatcher<(LearnMoreViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveLearnMore(viewModel: LearnMoreViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveReferral(viewModel: M1) -> Cuckoo.__DoNotUse<(ReferralCrowdloanViewModel), Void> where M1.MatchedType == ReferralCrowdloanViewModel { + let matchers: [Cuckoo.ParameterMatcher<(ReferralCrowdloanViewModel)>] = [wrap(matchable: viewModel) { $0 }] + return cuckoo_manager.verify("didReceiveReferral(viewModel: ReferralCrowdloanViewModel)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveInput(viewModel: M1) -> Cuckoo.__DoNotUse<(InputViewModelProtocol), Void> where M1.MatchedType == InputViewModelProtocol { let matchers: [Cuckoo.ParameterMatcher<(InputViewModelProtocol)>] = [wrap(matchable: viewModel) { $0 }] - return cuckoo_manager.verify("setInput(viewModel: InputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("didReceiveInput(viewModel: InputViewModelProtocol)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveShouldInputCode() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didReceiveShouldInputCode()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didReceiveShouldAgreeTerms() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didReceiveShouldAgreeTerms()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStartLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStartLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func didStopLoading() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didStopLoading()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class UsernameSetupViewProtocolStub: UsernameSetupViewProtocol { + class ReferralCrowdloanViewProtocolStub: ReferralCrowdloanViewProtocol { @@ -55680,6 +55191,24 @@ import SoraFoundation } } + + + + var loadableContentView: UIView! { + get { + return DefaultValueRegistry.defaultValue(for: (UIView?).self) + } + + } + + + + var shouldDisableInteractionWhenLoading: Bool { + get { + return DefaultValueRegistry.defaultValue(for: (Bool).self) + } + + } @@ -55687,7 +55216,43 @@ import SoraFoundation - func setInput(viewModel: InputViewModelProtocol) { + func didReceiveLearnMore(viewModel: LearnMoreViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveReferral(viewModel: ReferralCrowdloanViewModel) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveInput(viewModel: InputViewModelProtocol) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveShouldInputCode() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didReceiveShouldAgreeTerms() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStartLoading() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func didStopLoading() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -55695,19 +55260,19 @@ import SoraFoundation - class MockUsernameSetupPresenterProtocol: UsernameSetupPresenterProtocol, Cuckoo.ProtocolMock { + class MockReferralCrowdloanPresenterProtocol: ReferralCrowdloanPresenterProtocol, Cuckoo.ProtocolMock { - typealias MocksType = UsernameSetupPresenterProtocol + typealias MocksType = ReferralCrowdloanPresenterProtocol - typealias Stubbing = __StubbingProxy_UsernameSetupPresenterProtocol - typealias Verification = __VerificationProxy_UsernameSetupPresenterProtocol + typealias Stubbing = __StubbingProxy_ReferralCrowdloanPresenterProtocol + typealias Verification = __VerificationProxy_ReferralCrowdloanPresenterProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: UsernameSetupPresenterProtocol? + private var __defaultImplStub: ReferralCrowdloanPresenterProtocol? - func enableDefaultImplementation(_ stub: UsernameSetupPresenterProtocol) { + func enableDefaultImplementation(_ stub: ReferralCrowdloanPresenterProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -55735,21 +55300,96 @@ import SoraFoundation - func proceed() { + func update(referralCode: String) { - return cuckoo_manager.call("proceed()", + return cuckoo_manager.call("update(referralCode: String)", + parameters: (referralCode), + escapingParameters: (referralCode), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.update(referralCode: referralCode)) + + } + + + + func applyDefaultCode() { + + return cuckoo_manager.call("applyDefaultCode()", parameters: (), escapingParameters: (), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed()) + defaultCall: __defaultImplStub!.applyDefaultCode()) + + } + + + + func applyInputCode() { + + return cuckoo_manager.call("applyInputCode()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.applyInputCode()) + + } + + + + func setTermsAgreed(value: Bool) { + + return cuckoo_manager.call("setTermsAgreed(value: Bool)", + parameters: (value), + escapingParameters: (value), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.setTermsAgreed(value: value)) + + } + + + + func presentTerms() { + + return cuckoo_manager.call("presentTerms()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentTerms()) + + } + + + + func presentLearnMore() { + + return cuckoo_manager.call("presentLearnMore()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.presentLearnMore()) } - struct __StubbingProxy_UsernameSetupPresenterProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ReferralCrowdloanPresenterProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -55759,17 +55399,42 @@ import SoraFoundation func setup() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "setup()", parameterMatchers: matchers)) } - func proceed() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + func update(referralCode: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(String)> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: referralCode) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "update(referralCode: String)", parameterMatchers: matchers)) + } + + func applyDefaultCode() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] - return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupPresenterProtocol.self, method: "proceed()", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "applyDefaultCode()", parameterMatchers: matchers)) + } + + func applyInputCode() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "applyInputCode()", parameterMatchers: matchers)) + } + + func setTermsAgreed(value: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(Bool)> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: value) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "setTermsAgreed(value: Bool)", parameterMatchers: matchers)) + } + + func presentTerms() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "presentTerms()", parameterMatchers: matchers)) + } + + func presentLearnMore() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanPresenterProtocol.self, method: "presentLearnMore()", parameterMatchers: matchers)) } } - struct __VerificationProxy_UsernameSetupPresenterProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ReferralCrowdloanPresenterProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -55790,15 +55455,45 @@ import SoraFoundation } @discardableResult - func proceed() -> Cuckoo.__DoNotUse<(), Void> { + func update(referralCode: M1) -> Cuckoo.__DoNotUse<(String), Void> where M1.MatchedType == String { + let matchers: [Cuckoo.ParameterMatcher<(String)>] = [wrap(matchable: referralCode) { $0 }] + return cuckoo_manager.verify("update(referralCode: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyDefaultCode() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] - return cuckoo_manager.verify("proceed()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + return cuckoo_manager.verify("applyDefaultCode()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func applyInputCode() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("applyInputCode()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func setTermsAgreed(value: M1) -> Cuckoo.__DoNotUse<(Bool), Void> where M1.MatchedType == Bool { + let matchers: [Cuckoo.ParameterMatcher<(Bool)>] = [wrap(matchable: value) { $0 }] + return cuckoo_manager.verify("setTermsAgreed(value: Bool)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentTerms() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentTerms()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func presentLearnMore() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("presentLearnMore()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } } } - class UsernameSetupPresenterProtocolStub: UsernameSetupPresenterProtocol { + class ReferralCrowdloanPresenterProtocolStub: ReferralCrowdloanPresenterProtocol { @@ -55812,7 +55507,37 @@ import SoraFoundation - func proceed() { + func update(referralCode: String) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func applyDefaultCode() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func applyInputCode() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func setTermsAgreed(value: Bool) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentTerms() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func presentLearnMore() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -55820,19 +55545,19 @@ import SoraFoundation - class MockUsernameSetupWireframeProtocol: UsernameSetupWireframeProtocol, Cuckoo.ProtocolMock { + class MockReferralCrowdloanWireframeProtocol: ReferralCrowdloanWireframeProtocol, Cuckoo.ProtocolMock { - typealias MocksType = UsernameSetupWireframeProtocol + typealias MocksType = ReferralCrowdloanWireframeProtocol - typealias Stubbing = __StubbingProxy_UsernameSetupWireframeProtocol - typealias Verification = __VerificationProxy_UsernameSetupWireframeProtocol + typealias Stubbing = __StubbingProxy_ReferralCrowdloanWireframeProtocol + typealias Verification = __VerificationProxy_ReferralCrowdloanWireframeProtocol let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) - private var __defaultImplStub: UsernameSetupWireframeProtocol? + private var __defaultImplStub: ReferralCrowdloanWireframeProtocol? - func enableDefaultImplementation(_ stub: UsernameSetupWireframeProtocol) { + func enableDefaultImplementation(_ stub: ReferralCrowdloanWireframeProtocol) { __defaultImplStub = stub cuckoo_manager.enableDefaultStubImplementation() } @@ -55845,16 +55570,31 @@ import SoraFoundation - func proceed(from view: UsernameSetupViewProtocol?, walletName: String) { + func complete(on view: ReferralCrowdloanViewProtocol?) { - return cuckoo_manager.call("proceed(from: UsernameSetupViewProtocol?, walletName: String)", - parameters: (view, walletName), - escapingParameters: (view, walletName), + return cuckoo_manager.call("complete(on: ReferralCrowdloanViewProtocol?)", + parameters: (view), + escapingParameters: (view), superclassCall: Cuckoo.MockManager.crashOnProtocolSuperclassCall() , - defaultCall: __defaultImplStub!.proceed(from: view, walletName: walletName)) + defaultCall: __defaultImplStub!.complete(on: view)) + + } + + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { + + return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", + parameters: (url, view, style), + escapingParameters: (url, view, style), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showWeb(url: url, from: view, style: style)) } @@ -55889,7 +55629,7 @@ import SoraFoundation } - struct __StubbingProxy_UsernameSetupWireframeProtocol: Cuckoo.StubbingProxy { + struct __StubbingProxy_ReferralCrowdloanWireframeProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager init(manager: Cuckoo.MockManager) { @@ -55897,24 +55637,29 @@ import SoraFoundation } - func proceed(from view: M1, walletName: M2) -> Cuckoo.ProtocolStubNoReturnFunction<(UsernameSetupViewProtocol?, String)> where M1.OptionalMatchedType == UsernameSetupViewProtocol, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(UsernameSetupViewProtocol?, String)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: walletName) { $0.1 }] - return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupWireframeProtocol.self, method: "proceed(from: UsernameSetupViewProtocol?, walletName: String)", parameterMatchers: matchers)) + func complete(on view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(ReferralCrowdloanViewProtocol?)> where M1.OptionalMatchedType == ReferralCrowdloanViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ReferralCrowdloanViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanWireframeProtocol.self, method: "complete(on: ReferralCrowdloanViewProtocol?)", parameterMatchers: matchers)) + } + + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) } func present(message: M1, title: M2, closeAction: M3, from view: M4) -> Cuckoo.ProtocolStubNoReturnFunction<(String?, String?, String?, ControllerBackedProtocol?)> where M1.OptionalMatchedType == String, M2.OptionalMatchedType == String, M3.OptionalMatchedType == String, M4.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(String?, String?, String?, ControllerBackedProtocol?)>] = [wrap(matchable: message) { $0.0 }, wrap(matchable: title) { $0.1 }, wrap(matchable: closeAction) { $0.2 }, wrap(matchable: view) { $0.3 }] - return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanWireframeProtocol.self, method: "present(message: String?, title: String?, closeAction: String?, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } func present(viewModel: M1, style: M2, from view: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)> where M1.MatchedType == AlertPresentableViewModel, M2.MatchedType == UIAlertController.Style, M3.OptionalMatchedType == ControllerBackedProtocol { let matchers: [Cuckoo.ParameterMatcher<(AlertPresentableViewModel, UIAlertController.Style, ControllerBackedProtocol?)>] = [wrap(matchable: viewModel) { $0.0 }, wrap(matchable: style) { $0.1 }, wrap(matchable: view) { $0.2 }] - return .init(stub: cuckoo_manager.createStub(for: MockUsernameSetupWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) + return .init(stub: cuckoo_manager.createStub(for: MockReferralCrowdloanWireframeProtocol.self, method: "present(viewModel: AlertPresentableViewModel, style: UIAlertController.Style, from: ControllerBackedProtocol?)", parameterMatchers: matchers)) } } - struct __VerificationProxy_UsernameSetupWireframeProtocol: Cuckoo.VerificationProxy { + struct __VerificationProxy_ReferralCrowdloanWireframeProtocol: Cuckoo.VerificationProxy { private let cuckoo_manager: Cuckoo.MockManager private let callMatcher: Cuckoo.CallMatcher private let sourceLocation: Cuckoo.SourceLocation @@ -55929,9 +55674,15 @@ import SoraFoundation @discardableResult - func proceed(from view: M1, walletName: M2) -> Cuckoo.__DoNotUse<(UsernameSetupViewProtocol?, String), Void> where M1.OptionalMatchedType == UsernameSetupViewProtocol, M2.MatchedType == String { - let matchers: [Cuckoo.ParameterMatcher<(UsernameSetupViewProtocol?, String)>] = [wrap(matchable: view) { $0.0 }, wrap(matchable: walletName) { $0.1 }] - return cuckoo_manager.verify("proceed(from: UsernameSetupViewProtocol?, walletName: String)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + func complete(on view: M1) -> Cuckoo.__DoNotUse<(ReferralCrowdloanViewProtocol?), Void> where M1.OptionalMatchedType == ReferralCrowdloanViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(ReferralCrowdloanViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("complete(on: ReferralCrowdloanViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { + let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] + return cuckoo_manager.verify("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } @discardableResult @@ -55949,7 +55700,7 @@ import SoraFoundation } } - class UsernameSetupWireframeProtocolStub: UsernameSetupWireframeProtocol { + class ReferralCrowdloanWireframeProtocolStub: ReferralCrowdloanWireframeProtocol { @@ -55957,7 +55708,13 @@ import SoraFoundation - func proceed(from view: UsernameSetupViewProtocol?, walletName: String) { + func complete(on view: ReferralCrowdloanViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { return DefaultValueRegistry.defaultValue(for: (Void).self) } diff --git a/novawalletTests/Modules/AssetSelection/AssetSelectionTests.swift b/novawalletTests/Modules/AssetSelection/AssetSelectionTests.swift index 104333b6f5..180fdc2287 100644 --- a/novawalletTests/Modules/AssetSelection/AssetSelectionTests.swift +++ b/novawalletTests/Modules/AssetSelection/AssetSelectionTests.swift @@ -42,6 +42,7 @@ class AssetSelectionTests: XCTestCase { let interactor = AssetSelectionInteractor( selectedMetaAccount: selectedAccount, + balanceSlice: \.transferable, repository: repository, walletLocalSubscriptionFactory: walletLocalSubscriptionFactory, priceLocalSubscriptionFactory: priceProviderFactory, diff --git a/novawalletTests/Modules/Crowdloan/CrowdloanList/CrowdloanListTests.swift b/novawalletTests/Modules/Crowdloan/CrowdloanList/CrowdloanListTests.swift index a719654f66..9537b10af3 100644 --- a/novawalletTests/Modules/Crowdloan/CrowdloanList/CrowdloanListTests.swift +++ b/novawalletTests/Modules/Crowdloan/CrowdloanList/CrowdloanListTests.swift @@ -89,7 +89,7 @@ class CrowdloanListTests: XCTestCase { func testCrowdloansSuccessRetrieving() throws { // given - let view = MockCrowdloanListViewProtocol() + let view = MockCrowdloansViewProtocol() let wireframe = MockCrowdloanListWireframeProtocol() let expectedActiveParaIds: Set = activeCrowdloans @@ -106,15 +106,10 @@ class CrowdloanListTests: XCTestCase { let chainCompletionExpectation = XCTestExpectation() let listCompletionExpectation = XCTestExpectation() - let walletSwitchReceiveExpectation = XCTestExpectation() stub(view) { stub in stub.isSetup.get.thenReturn(false, true) - stub.didReceive(walletSwitchViewModel: any()).then { state in - walletSwitchReceiveExpectation.fulfill() - } - stub.didReceive(listState: any()).then { state in let allLoaded: Bool = state.sections.reduce(true) { result, state in guard result else { @@ -156,7 +151,7 @@ class CrowdloanListTests: XCTestCase { // then - wait(for: [listCompletionExpectation, chainCompletionExpectation, walletSwitchReceiveExpectation], timeout: 10) + wait(for: [listCompletionExpectation, chainCompletionExpectation], timeout: 10) let yourContributionsCount: Int = { let yourContribution = actualViewModel!.sections[0] @@ -195,7 +190,7 @@ class CrowdloanListTests: XCTestCase { } private func createPresenter( - for view: MockCrowdloanListViewProtocol, + for view: MockCrowdloansViewProtocol, wireframe: MockCrowdloanListWireframeProtocol ) throws -> CrowdloanListPresenter? { let localizationManager = LocalizationManager.shared @@ -229,6 +224,7 @@ class CrowdloanListTests: XCTestCase { let presenter = CrowdloanListPresenter( interactor: interactor, wireframe: wireframe, + wallet: selectedAccount, viewModelFactory: viewModelFactory, localizationManager: localizationManager, crowdloansCalculator: CrowdloansCalculator(), diff --git a/novawalletTests/Modules/Governance/Gov2UnlockScheduleTests.swift b/novawalletTests/Modules/Governance/Gov2UnlockScheduleTests.swift new file mode 100644 index 0000000000..33dc87fe7a --- /dev/null +++ b/novawalletTests/Modules/Governance/Gov2UnlockScheduleTests.swift @@ -0,0 +1,350 @@ +import XCTest +@testable import novawallet + +class Gov2UnlockScheduleTests: XCTestCase { + + func testShouldHandleEmpty() { + GovernanceUnlocksTestBuilding.run(atBlock: 0) { + GovernanceUnlocksTestBuilding.given {} + GovernanceUnlocksTestBuilding.expect {} + } + } + + func testShouldHandleSingleClaimable() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 0, amount: 1, unlockAt: 1000) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 1) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 0) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + } + } + } + + func testShouldHandleBothPassedAndNotPriors() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.prior(amount: 2, unlockAt: 1000) + } + + TrackTestBuilding.track(1) { + TrackTestBuilding.VotingParams.prior(amount: 1, unlockAt: 1100) + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 1) { + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + + UnlockScheduleTestBuilding.ScheduleResult.remainingItems { + UnlockScheduleTestBuilding.unlock(amount: 1, atBlock: 1100) { + GovernanceUnlockSchedule.Action.unlock(track: 1) + } + } + } + } + } + + func testShouldExtendVotesWithPrior() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.prior(amount: 1, unlockAt: 1100) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 1, amount: 2, unlockAt: 1000) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.remainingItems { + UnlockScheduleTestBuilding.unlock(amount: 2, atBlock: 1100) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 1) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + } + } + } + } + + func testShouldTakeMaxBetweenTwoLocksWithSameTime() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 0, amount: 8, unlockAt: 1000) + TrackTestBuilding.Vote(referendum: 1, amount: 2, unlockAt: 1000) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 8) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 0) + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 1) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + } + } + } + + func testShouldHandleRegiggedPrior() { + GovernanceUnlocksTestBuilding.run(atBlock: 1200) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.prior(amount: 1, unlockAt: 1100) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 1, amount: 2, unlockAt: 1000) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 2) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 1) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + } + } + } + + func testShouldFoldSeveralClaimableToOne() { + GovernanceUnlocksTestBuilding.run(atBlock: 1100) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.locked(0) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 0, amount: 1, unlockAt: 1100) + } + } + TrackTestBuilding.track(1) { + TrackTestBuilding.VotingParams.locked(0) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 1, amount: 2, unlockAt: 1000) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 2) { + GovernanceUnlockSchedule.Action.unvote(track: 1, index: 1) + GovernanceUnlockSchedule.Action.unlock(track: 1) + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 0) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + } + } + } + + func testShouldIncludeShadowedAction() { + GovernanceUnlocksTestBuilding.run(atBlock: 1200) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(1) { + TrackTestBuilding.VotingParams.locked(0) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 1, amount: 1, unlockAt: 1000) + } + } + TrackTestBuilding.track(2) { + TrackTestBuilding.VotingParams.locked(0) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 2, amount: 2, unlockAt: 1100) + } + } + TrackTestBuilding.track(3) { + TrackTestBuilding.VotingParams.locked(0) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 3, amount: 1, unlockAt: 1200) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 2) { + GovernanceUnlockSchedule.Action.unvote(track: 2, index: 2) + GovernanceUnlockSchedule.Action.unlock(track: 2) + GovernanceUnlockSchedule.Action.unvote(track: 1, index: 1) + GovernanceUnlockSchedule.Action.unlock(track: 1) + GovernanceUnlockSchedule.Action.unvote(track: 3, index: 3) + GovernanceUnlockSchedule.Action.unlock(track: 3) + } + } + } + } + + func testShouldTakeGapIntoAccount() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.locked(10) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 0, amount: 2, unlockAt: 1000) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 10) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 0) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + } + } + } + + func testGapShouldBeLimitedWithOtherLocks() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.locked(10) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 0, amount: 1, unlockAt: 1000) + } + } + + TrackTestBuilding.track(1) { + TrackTestBuilding.VotingParams.prior(amount: 10, unlockAt: 1000) + } + + TrackTestBuilding.track(2) { + TrackTestBuilding.VotingParams.prior(amount: 1, unlockAt: 1100) + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 9) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 0) + GovernanceUnlockSchedule.Action.unlock(track: 0) + GovernanceUnlockSchedule.Action.unlock(track: 1) + } + + UnlockScheduleTestBuilding.ScheduleResult.remainingItems { + UnlockScheduleTestBuilding.unlock(amount: 1, atBlock: 1100) { + GovernanceUnlockSchedule.Action.unlock(track: 2) + } + } + } + } + } + + func testGapClaimShouldBeDelayed() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.locked(10) + } + + TrackTestBuilding.track(1) { + TrackTestBuilding.VotingParams.prior(amount: 10, unlockAt: 1100) + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.remainingItems { + UnlockScheduleTestBuilding.unlock(amount: 10, atBlock: 1100) { + GovernanceUnlockSchedule.Action.unlock(track: 0) + GovernanceUnlockSchedule.Action.unlock(track: 1) + } + } + } + } + } + + func testShouldNotDuplicateUnlockCommandWithBothPriorAndGapPresent() { + GovernanceUnlocksTestBuilding.run(atBlock: 1100) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.locked(10) + TrackTestBuilding.VotingParams.prior(amount: 5, unlockAt: 1050) + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 10) { + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + } + } + } + + func testPendingShouldBeSortedByRemainingTime() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(0) { + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 0, amount: 3, unlockAt: 1100) + TrackTestBuilding.Vote(referendum: 2, amount: 2, unlockAt: 1200) + TrackTestBuilding.Vote(referendum: 1, amount: 1, unlockAt: 1300) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.remainingItems { + UnlockScheduleTestBuilding.unlock(amount: 1, atBlock: 1100) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 0) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + + UnlockScheduleTestBuilding.unlock(amount: 1, atBlock: 1200) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 2) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + + UnlockScheduleTestBuilding.unlock(amount: 1, atBlock: 1300) { + GovernanceUnlockSchedule.Action.unvote(track: 0, index: 1) + GovernanceUnlockSchedule.Action.unlock(track: 0) + } + } + } + } + } + + func testGapShouldNotBeCoveredByItsTrackLocks() { + GovernanceUnlocksTestBuilding.run(atBlock: 1000) { + GovernanceUnlocksTestBuilding.given { + TrackTestBuilding.track(20) { + TrackTestBuilding.VotingParams.locked(1) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 13, amount: 1, unlockAt: 2000) + } + } + + TrackTestBuilding.track(21) { + TrackTestBuilding.VotingParams.locked(101) + TrackTestBuilding.VotingParams.votes { + TrackTestBuilding.Vote(referendum: 5, amount: 10, unlockAt: 1500) + } + } + } + + GovernanceUnlocksTestBuilding.expect { + UnlockScheduleTestBuilding.ScheduleResult.availableItem(amount: 91) { + GovernanceUnlockSchedule.Action.unlock(track: 21) + } + + UnlockScheduleTestBuilding.ScheduleResult.remainingItems { + UnlockScheduleTestBuilding.unlock(amount: 9, atBlock: 1500) { + GovernanceUnlockSchedule.Action.unvote(track: 21, index: 5) + GovernanceUnlockSchedule.Action.unlock(track: 21) + } + + UnlockScheduleTestBuilding.unlock(amount: 1, atBlock: 2000) { + GovernanceUnlockSchedule.Action.unvote(track: 20, index: 13) + GovernanceUnlockSchedule.Action.unlock(track: 20) + } + } + } + } + } +} diff --git a/novawalletTests/Modules/Governance/GovernanceUnlocksTestBuilding.swift b/novawalletTests/Modules/Governance/GovernanceUnlocksTestBuilding.swift new file mode 100644 index 0000000000..e82fb4bad1 --- /dev/null +++ b/novawalletTests/Modules/Governance/GovernanceUnlocksTestBuilding.swift @@ -0,0 +1,310 @@ +import XCTest +@testable import novawallet +import BigInt + +enum GovernanceUnlocksTestBuilding { + struct Test { + let givenSchedule: GovernanceUnlockSchedule? + let expectSchedule: UnlockScheduleTestBuilding.ScheduleResult? + } + + @resultBuilder + struct TestBuilder { + static func buildBlock(_ givenSchedule: GovernanceUnlockSchedule) -> Test { + .init(givenSchedule: givenSchedule, expectSchedule: nil) + } + + static func buildBlock(_ expectSchedule: UnlockScheduleTestBuilding.ScheduleResult) -> Test { + .init(givenSchedule: nil, expectSchedule: expectSchedule) + } + + static func buildBlock(_ components: Test...) -> Test { + let initTest = Test(givenSchedule: nil, expectSchedule: nil) + + return components.reduce(initTest) { (accum, test) in + let given = test.givenSchedule ?? accum.givenSchedule + let expect = test.expectSchedule ?? accum.expectSchedule + + return .init(givenSchedule: given, expectSchedule: expect) + } + } + } + + static func run(atBlock block: BlockNumber, @TestBuilder _ builder: () -> Test) { + let test = builder() + + guard let schedule = test.givenSchedule else { + XCTFail("Give schedule is not provided") + return + } + + guard let expect = test.expectSchedule else { + XCTFail("Expected result is not provided") + return + } + + XCTAssertEqual(schedule.availableUnlock(at: block), expect.available) + XCTAssertEqual(schedule.remainingLocks(after: block), expect.remaining) + } + + static func given( + @TrackTestBuilding.TrackVotingBuilder _ content: () -> TrackTestBuilding.VotingWithReferendumUnlock + ) -> Test { + let compoundVoting = content() + + let tracksVoting = compoundVoting.votingDistribution + let refendumsUnlock = compoundVoting.referendumsUnlock + + let initReferendums = [ReferendumIdLocal: GovUnlockReferendumProtocol]() + let referendums = tracksVoting.votes.tracksByReferendums().keys.reduce(into: initReferendums) { (accum, referendumId) in + let deposit = Referenda.Deposit(who: AccountId.zeroAccountId(of: 32), amount: BigUInt(0)) + let referendum = ReferendumInfo.approved( + .init( + since: refendumsUnlock[referendumId] ?? 0, + submissionDeposit: deposit, + decisionDeposit: deposit + ) + ) + + accum[referendumId] = Gov2UnlockReferendum(referendumInfo: referendum) + } + + let additions = GovUnlockCalculationInfo( + decisionPeriods: [:], + undecidingTimeout: 0, + voteLockingPeriod: 0 + ) + + let schedule = GovUnlocksCalculator().createUnlocksSchedule( + for: tracksVoting, + referendums: referendums, + additionalInfo: additions + ) + + return .init(givenSchedule: schedule, expectSchedule: nil) + } + + static func expect( + @UnlockScheduleTestBuilding.ScheduleResultBuilder _ builder: () -> UnlockScheduleTestBuilding.ScheduleResult + ) -> Test { + let result = builder() + + return .init(givenSchedule: nil, expectSchedule: result) + } +} + +enum UnlockScheduleTestBuilding { + @resultBuilder + struct ClaimActionBuilder { + static func buildBlock(_ components: GovernanceUnlockSchedule.Action...) -> Set { + Set(components) + } + } + + @resultBuilder + struct ItemBuilder { + static func buildBlock(_ components: GovernanceUnlockSchedule.Item...) -> [GovernanceUnlockSchedule.Item] { + Array(components) + } + } + + struct ScheduleResult { + let available: GovernanceUnlockSchedule.Claimable + let remaining: [GovernanceUnlockSchedule.Item] + + static func availableItem( + amount: BigUInt, + @ClaimActionBuilder _ actionsBlock: () -> Set + ) -> ScheduleResult { + return .init( + available: + .init( + amount: amount, + actions: actionsBlock() + ), + remaining: [] + ) + } + + static func remainingItems(@ItemBuilder _ block: () -> [GovernanceUnlockSchedule.Item]) -> ScheduleResult { + .init(available: .empty(), remaining: block()) + } + } + + @resultBuilder + struct ScheduleResultBuilder { + static func buildBlock(_ components: ScheduleResult...) -> ScheduleResult { + let initResult = ScheduleResult(available: .empty(), remaining: []) + + return components.reduce(initResult) { (accum, schedule) in + let available = !schedule.available.isEmpty ? schedule.available : accum.available + let remaining = accum.remaining + schedule.remaining + + return .init(available: available, remaining: remaining) + } + } + } + + static func unlock( + amount: BigUInt, + atBlock: BlockNumber, + @ClaimActionBuilder _ actionsBlock: () -> Set + ) -> GovernanceUnlockSchedule.Item { + let actions = actionsBlock() + + return .init(amount: amount, unlockAt: atBlock, actions: actions) + } +} + +enum TrackTestBuilding { + struct VotingWithReferendumUnlock { + let votingDistribution: ReferendumTracksVotingDistribution + let referendumsUnlock: [ReferendumIdLocal: BlockNumber] + } + + @resultBuilder + struct TrackVotingBuilder { + static func buildBlock(_ components: Voting...) -> VotingWithReferendumUnlock { + let initValue = ReferendumTracksVotingDistribution( + votes: .init(maxVotesPerTrack: 512), + trackLocks: [] + ) + + let votingDistribution = components.reduce(initValue) { (accum, voting) in + var accountVoting = accum.votes + + for vote in voting.votes { + accountVoting = accountVoting + .addingReferendum(vote.referendum, track: voting.trackId) + .addingVote( + .standard( + .init( + vote: .init(aye: vote.isAye, conviction: vote.conviction), + balance: vote.amount + ) + ), + referendumId: vote.referendum + ) + } + + if voting.prior.exists { + accountVoting = accountVoting.addingPriorLock(voting.prior, track: voting.trackId) + } + + if let delegating = voting.delegating { + accountVoting = accountVoting.addingDelegating(delegating, trackId: voting.trackId) + } + + let trackLock = ConvictionVoting.ClassLock( + trackId: Referenda.TrackId(voting.trackId), + amount: voting.locked + ) + + return ReferendumTracksVotingDistribution( + votes: accountVoting, + trackLocks: accum.trackLocks + [trackLock] + ) + } + + let referendumsUnlock = components.reduce(into: [ReferendumIdLocal: BlockNumber]()) { (accum, voting) in + for vote in voting.votes { + accum[vote.referendum] = vote.unlockAt + } + } + + return .init(votingDistribution: votingDistribution, referendumsUnlock: referendumsUnlock) + } + } + + struct Voting { + let trackId: TrackIdLocal + let locked: BigUInt + let votes: [Vote] + let prior: ConvictionVoting.PriorLock + let delegating: ReferendumDelegatingLocal? + } + + typealias Locked = BigUInt + + struct Vote { + let referendum: ReferendumIdLocal + let amount: BigUInt + let conviction: ConvictionVoting.Conviction + let unlockAt: BlockNumber + let isAye: Bool + + init( + referendum: ReferendumIdLocal, + amount: BigUInt, + unlockAt: BlockNumber, + conviction: ConvictionVoting.Conviction = .locked1x, + isAye: Bool = true + ) { + self.referendum = referendum + self.amount = amount + self.unlockAt = unlockAt + self.conviction = conviction + self.isAye = isAye + } + } + + @resultBuilder + struct VoteBuilder { + static func buildBlock(_ components: Vote...) -> [Vote] { + Array(components) + } + } + + struct VotingParams { + let locked: Locked + let votes: [Vote] + let prior: ConvictionVoting.PriorLock + let delegating: ReferendumDelegatingLocal? + + static func locked(_ amount: BigUInt) -> VotingParams { + VotingParams(locked: amount, votes: [], prior: .notExisting, delegating: nil) + } + + static func votes(@VoteBuilder _ content: () -> [Vote]) -> VotingParams { + VotingParams(locked: 0, votes: content(), prior: .notExisting, delegating: nil) + } + + static func prior(amount: BigUInt, unlockAt: BlockNumber) -> VotingParams { + VotingParams(locked: 0, votes: [], prior: .init(unlockAt: unlockAt, amount: amount), delegating: nil) + } + } + + @resultBuilder + class VotingParamsBuilder { + static func buildBlock(_ components: VotingParams...) -> VotingParams { + let initValue = VotingParams(locked: 0, votes: [], prior: .notExisting, delegating: nil) + + return components.reduce(initValue) { (accum, param) in + VotingParams( + locked: accum.locked + param.locked, + votes: accum.votes + param.votes, + prior: param.prior.exists ? param.prior : accum.prior, + delegating: param.delegating != nil ? param.delegating : accum.delegating + ) + } + } + } + + static func track(_ trackId: TrackIdLocal, @VotingParamsBuilder _ builder: () -> VotingParams) -> Voting { + let params = builder() + + return Voting( + trackId: trackId, + locked: params.locked, + votes: params.votes, + prior: params.prior, + delegating: params.delegating + ) + } + + static func tracksVoting( + @TrackVotingBuilder _ builder: () -> VotingWithReferendumUnlock + ) -> VotingWithReferendumUnlock { + builder() + } +}