@@ -89,6 +89,10 @@ describe('Governor actions tests', () => {
8989
9090 const poolDeployResult = await pool . sendDeploy ( deployer . getSender ( ) , toNano ( '11' ) ) ;
9191
92+ const poolJettonDeployResult = await poolJetton . sendDeploy ( deployer . getSender ( ) , toNano ( '1.05' ) ) ;
93+ const adminTransferResult = await poolJetton . sendChangeAdmin ( deployer . getSender ( ) , pool . address ) ;
94+
95+
9296 // Preparation for the post update execution test
9397 const sendSlice = Cell . fromBase64 ( "te6ccgEBAQEAJgAASHCAGMjLBVjPFoIQO5rKAPoCy2pwgQU5yMsfyz/J0M8WyXD7AA==" ) . beginParse ( ) ;
9498 /*<{
@@ -339,6 +343,7 @@ describe('Governor actions tests', () => {
339343 // Let's test random address too just in case
340344 res = await pool . sendDeposit ( bc . sender ( randomAddress ( ) ) , depoAmount ) ;
341345 assertExitCode ( res . transactions , Errors . depossits_are_closed ) ;
346+ await pool . sendSetDepositSettings ( governor , toNano ( '1' ) , true , true ) ;
342347 } ) ;
343348 } ) ;
344349 describe ( 'Governance fee setting' , ( ) => {
@@ -372,7 +377,7 @@ describe('Governor actions tests', () => {
372377 let res = await pool . sendSetInterest ( randomUser , newInterest ) ;
373378
374379 assertExitCode ( res . transactions , Errors . wrong_sender ) ;
375- // Makre sure those are separate roles
380+ // Make sure those are separate roles
376381 res = await pool . sendSetInterest ( governor , newInterest ) ;
377382 assertExitCode ( res . transactions , Errors . wrong_sender ) ;
378383 } ) ;
@@ -394,12 +399,19 @@ describe('Governor actions tests', () => {
394399
395400 let res = await pool . sendHaltMessage ( bc . sender ( notHalter ) ) ;
396401 assertExitCode ( res . transactions , Errors . wrong_sender ) ;
397- // Makre sure it's separate role
402+ // Make sure it's separate role
398403 res = await pool . sendHaltMessage ( bc . sender ( newGovernor ) ) ;
399404 assertExitCode ( res . transactions , Errors . wrong_sender ) ;
400405 } ) ;
401406 it ( 'Halter should be able to halt pool' , async ( ) => {
402407 const poolBefore = await pool . getFullData ( ) ;
408+ // deposit while we can
409+ const depositResult = await pool . sendDeposit ( deployer . getSender ( ) , toNano ( '10' ) ) ;
410+ expect ( depositResult . transactions ) . toHaveTransaction ( {
411+ on : deployer . address ,
412+ op : Op . jetton . transfer_notification
413+ } ) ;
414+
403415 expect ( poolBefore . halted ) . toBe ( false ) ;
404416
405417 const res = await pool . sendHaltMessage ( bc . sender ( newHalter ) ) ;
@@ -410,13 +422,7 @@ describe('Governor actions tests', () => {
410422 } ) ;
411423 it ( 'Pool in halted state should prevent haltable ops' , async ( ) => {
412424 const haltedOps = [
413- // Withdraw
414- async ( ) => bc . sendMessage ( internal ( {
415- from : poolJetton . address ,
416- to : pool . address ,
417- value : toNano ( '1' ) ,
418- body : beginCell ( ) . storeUint ( Op . pool . withdraw , 32 ) . storeUint ( 0 , 64 ) . endCell ( )
419- } ) ) ,
425+ // Withdraw is not haltable since in any case we need handle and send jettons back
420426 async ( ) => pool . sendDeposit ( bc . sender ( randomAddress ( ) ) , getRandomTon ( 100000 , 200000 ) ) ,
421427 // Loan request
422428 async ( ) => bc . sendMessage ( internal ( {
@@ -454,8 +460,25 @@ describe('Governor actions tests', () => {
454460 exitCode : Errors . halted
455461 } ) ;
456462 }
463+
464+ //Check remint on withdrawal for halted pool
465+ let myPoolJettonWalletAddress = await poolJetton . getWalletAddress ( deployer . address ) ;
466+ let myPoolJettonWallet = bc . openContract ( PoolJettonWallet . createFromAddress ( myPoolJettonWalletAddress ) ) ;
467+ let oldJettonAmount = await myPoolJettonWallet . getJettonBalance ( ) ;
468+ let oldBalance = ( await bc . getContract ( deployer . address ) ) . balance ;
469+ let burnResult = await myPoolJettonWallet . sendBurnWithParams ( deployer . getSender ( ) , toNano ( '1.0' ) , toNano ( '1.0' ) , deployer . address , true , true ) ;
470+ expect ( burnResult . transactions ) . toHaveTransaction ( {
471+ on : pool . address ,
472+ success : true
473+ } ) ;
474+ expect ( burnResult . transactions ) . toHaveTransaction ( {
475+ on : deployer . address ,
476+ op : Op . jetton . transfer_notification
477+ } ) ;
478+ expect ( ( await bc . getContract ( deployer . address ) ) . balance - oldBalance < 0n ) . toBeTruthy ( ) ;
479+ expect ( oldJettonAmount - await myPoolJettonWallet . getJettonBalance ( ) ) . toEqual ( 0n ) ;
457480 } ) ;
458- it ( 'Governance ops should be possibl when halted' , async ( ) => {
481+ it ( 'Governance ops should be possible when halted' , async ( ) => {
459482 const rollBack = bc . snapshot ( ) ;
460483 const governor = bc . sender ( newGovernor ) ;
461484 const notHaltable = [
0 commit comments