@@ -106,24 +106,6 @@ describe("Decryption", function () {
106106 // Define extra data for version 0
107107 const extraDataV0 = hre . ethers . solidityPacked ( [ "uint8" ] , [ 0 ] ) ;
108108
109- let ciphertextCommits : CiphertextCommits ;
110- let decryption : Decryption ;
111- let protocolPayment : ProtocolPayment ;
112- let mockedZamaOFT : ZamaOFT ;
113- let owner : Wallet ;
114- let pauser : Wallet ;
115- let snsCiphertextMaterials : SnsCiphertextMaterialStruct [ ] ;
116- let kmsSignatures : string [ ] ;
117- let kmsTxSenders : HardhatEthersSigner [ ] ;
118- let kmsSigners : HardhatEthersSigner [ ] ;
119- let coprocessorTxSenders : HardhatEthersSigner [ ] ;
120- let publicDecryptionPrice : bigint ;
121- let userDecryptionPrice : bigint ;
122- let tokenFundedTxSender : Wallet ;
123- let protocolPaymentAddress : string ;
124- let decryptionAddress : string ;
125- let mockedFeesSenderToBurnerAddress : string ;
126-
127109 // Add ciphertext materials
128110 async function prepareAddCiphertextFixture ( ) {
129111 const fixtureData = await loadFixture ( loadTestVariablesFixture ) ;
@@ -152,6 +134,8 @@ describe("Decryption", function () {
152134 }
153135
154136 describe ( "Deployment" , function ( ) {
137+ let decryption : Decryption ;
138+ let owner : Wallet ;
155139 let decryptionFactory : Decryption__factory ;
156140
157141 beforeEach ( async function ( ) {
@@ -173,6 +157,21 @@ describe("Decryption", function () {
173157 } ) ;
174158
175159 describe ( "Public Decryption" , function ( ) {
160+ let ciphertextCommits : CiphertextCommits ;
161+ let decryption : Decryption ;
162+ let protocolPayment : ProtocolPayment ;
163+ let mockedZamaOFT : ZamaOFT ;
164+ let pauser : Wallet ;
165+ let snsCiphertextMaterials : SnsCiphertextMaterialStruct [ ] ;
166+ let kmsSignatures : string [ ] ;
167+ let kmsTxSenders : HardhatEthersSigner [ ] ;
168+ let kmsSigners : HardhatEthersSigner [ ] ;
169+ let coprocessorTxSenders : HardhatEthersSigner [ ] ;
170+ let publicDecryptionPrice : bigint ;
171+ let tokenFundedTxSender : Wallet ;
172+ let protocolPaymentAddress : string ;
173+ let decryptionAddress : string ;
174+ let mockedFeesSenderToBurnerAddress : string ;
176175 let eip712Message : EIP712 ;
177176
178177 // Expected decryption request ID (after a first request) for a public decryption request
@@ -215,7 +214,6 @@ describe("Decryption", function () {
215214 protocolPayment = fixtureData . protocolPayment ;
216215 mockedZamaOFT = fixtureData . mockedZamaOFT ;
217216 mockedFeesSenderToBurnerAddress = fixtureData . mockedFeesSenderToBurnerAddress ;
218- owner = fixtureData . owner ;
219217 pauser = fixtureData . pauser ;
220218 snsCiphertextMaterials = fixtureData . snsCiphertextMaterials ;
221219 kmsSignatures = fixtureData . kmsSignatures ;
@@ -225,7 +223,6 @@ describe("Decryption", function () {
225223 eip712Message = fixtureData . eip712Message ;
226224 decryptionAddress = fixtureData . decryptionAddress ;
227225 publicDecryptionPrice = fixtureData . publicDecryptionPrice ;
228- userDecryptionPrice = fixtureData . userDecryptionPrice ;
229226 tokenFundedTxSender = fixtureData . tokenFundedTxSender ;
230227
231228 protocolPaymentAddress = await protocolPayment . getAddress ( ) ;
@@ -679,6 +676,21 @@ describe("Decryption", function () {
679676 } ) ;
680677
681678 describe ( "User Decryption" , function ( ) {
679+ let ciphertextCommits : CiphertextCommits ;
680+ let decryption : Decryption ;
681+ let protocolPayment : ProtocolPayment ;
682+ let mockedZamaOFT : ZamaOFT ;
683+ let pauser : Wallet ;
684+ let snsCiphertextMaterials : SnsCiphertextMaterialStruct [ ] ;
685+ let kmsSignatures : string [ ] ;
686+ let kmsTxSenders : HardhatEthersSigner [ ] ;
687+ let kmsSigners : HardhatEthersSigner [ ] ;
688+ let coprocessorTxSenders : HardhatEthersSigner [ ] ;
689+ let userDecryptionPrice : bigint ;
690+ let tokenFundedTxSender : Wallet ;
691+ let protocolPaymentAddress : string ;
692+ let decryptionAddress : string ;
693+ let mockedFeesSenderToBurnerAddress : string ;
682694 let userSignature : string ;
683695 let userDecryptedShares : string [ ] ;
684696 let eip712RequestMessage : EIP712 ;
@@ -717,15 +729,7 @@ describe("Decryption", function () {
717729 } ;
718730
719731 // Define fake values
720- const fakeUserAddress = createRandomAddress ( ) ;
721732 const fakeContractAddresses = createRandomAddresses ( 3 ) ;
722- const fakeContractAddress = fakeContractAddresses [ 0 ] ;
723- const fakeContractAddressCtHandleContractPairs : CtHandleContractPairStruct [ ] = [
724- {
725- contractAddress : fakeContractAddress ,
726- ctHandle,
727- } ,
728- ] ;
729733
730734 // Define utility values
731735 const tenDaysInSeconds = 10 * 24 * 60 * 60 ;
@@ -785,7 +789,7 @@ describe("Decryption", function () {
785789 decryption = fixtureData . decryption ;
786790 protocolPayment = fixtureData . protocolPayment ;
787791 mockedZamaOFT = fixtureData . mockedZamaOFT ;
788- owner = fixtureData . owner ;
792+ mockedFeesSenderToBurnerAddress = fixtureData . mockedFeesSenderToBurnerAddress ;
789793 pauser = fixtureData . pauser ;
790794 snsCiphertextMaterials = fixtureData . snsCiphertextMaterials ;
791795 userSignature = fixtureData . userSignature ;
@@ -797,7 +801,6 @@ describe("Decryption", function () {
797801 eip712RequestMessage = fixtureData . eip712RequestMessage ;
798802 eip712ResponseMessages = fixtureData . eip712ResponseMessages ;
799803 decryptionAddress = fixtureData . decryptionAddress ;
800- publicDecryptionPrice = fixtureData . publicDecryptionPrice ;
801804 userDecryptionPrice = fixtureData . userDecryptionPrice ;
802805 tokenFundedTxSender = fixtureData . tokenFundedTxSender ;
803806
@@ -1636,6 +1639,19 @@ describe("Decryption", function () {
16361639 } ) ;
16371640
16381641 describe ( "Delegated User Decryption" , function ( ) {
1642+ let ciphertextCommits : CiphertextCommits ;
1643+ let decryption : Decryption ;
1644+ let protocolPayment : ProtocolPayment ;
1645+ let mockedZamaOFT : ZamaOFT ;
1646+ let pauser : Wallet ;
1647+ let snsCiphertextMaterials : SnsCiphertextMaterialStruct [ ] ;
1648+ let kmsSignatures : string [ ] ;
1649+ let kmsTxSenders : HardhatEthersSigner [ ] ;
1650+ let coprocessorTxSenders : HardhatEthersSigner [ ] ;
1651+ let userDecryptionPrice : bigint ;
1652+ let tokenFundedTxSender : Wallet ;
1653+ let protocolPaymentAddress : string ;
1654+ let mockedFeesSenderToBurnerAddress : string ;
16391655 let delegateSignature : string ;
16401656 let userDecryptedShares : string [ ] ;
16411657 let eip712RequestMessage : EIP712 ;
@@ -1680,19 +1696,7 @@ describe("Decryption", function () {
16801696 } ;
16811697
16821698 // Define fake values.
1683- const fakeDelegatorAddress = createRandomAddress ( ) ;
16841699 const fakeContractAddresses = createRandomAddresses ( 3 ) ;
1685- const fakeContractAddress = fakeContractAddresses [ 0 ] ;
1686- const fakeContractAddressCtHandleContractPairs : CtHandleContractPairStruct [ ] = [
1687- {
1688- contractAddress : fakeContractAddress ,
1689- ctHandle,
1690- } ,
1691- ] ;
1692- const fakeDelegatorDelegationAccounts : IDecryption . DelegationAccountsStruct = {
1693- delegatorAddress : fakeDelegatorAddress ,
1694- delegateAddress,
1695- } ;
16961700
16971701 // Define utility values.
16981702 const tenDaysInSeconds = 10 * 24 * 60 * 60 ;
@@ -1754,7 +1758,6 @@ describe("Decryption", function () {
17541758 protocolPayment = fixtureData . protocolPayment ;
17551759 mockedZamaOFT = fixtureData . mockedZamaOFT ;
17561760 mockedFeesSenderToBurnerAddress = fixtureData . mockedFeesSenderToBurnerAddress ;
1757- owner = fixtureData . owner ;
17581761 pauser = fixtureData . pauser ;
17591762 snsCiphertextMaterials = fixtureData . snsCiphertextMaterials ;
17601763 delegateSignature = fixtureData . delegateSignature ;
@@ -2428,6 +2431,10 @@ describe("Decryption", function () {
24282431 } ) ;
24292432
24302433 describe ( "Pause" , async function ( ) {
2434+ let decryption : Decryption ;
2435+ let owner : Wallet ;
2436+ let pauser : Wallet ;
2437+
24312438 beforeEach ( async function ( ) {
24322439 const fixtureData = await loadFixture ( loadTestVariablesFixture ) ;
24332440 decryption = fixtureData . decryption ;
0 commit comments