zeta-chain / protocol-contracts-solana

solana interface contract for zetachain
3 stars 2 forks source link

program: add pause deposit state and guard in deposit & deposit_spl_token #14

Closed brewmaster012 closed 1 month ago

brewmaster012 commented 1 month ago

So that the program can be paused when zeta blockchain is undergoing upgrade or downtime, or TSS migration.

Only user deposits are paused to prevent users losing or experiencing delay in their assets during downtime; Withdraws are not paused because:

  1. withdraws is initiated by blockchain and should be paused there
  2. if withdraw is paused in program in error, then withdraw will abort and user lost funds.

The new guards and instructions are part of the test suite; to run

anchor test
codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 7.40741% with 25 lines in your changes missing coverage. Please review.

Project coverage is 9.17%. Comparing base (eb03529) to head (52a13a4).

Files Patch % Lines
programs/protocol-contracts-solana/src/lib.rs 7.40% 25 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #14 +/- ## ======================================== - Coverage 9.42% 9.17% -0.25% ======================================== Files 1 1 Lines 191 218 +27 ======================================== + Hits 18 20 +2 - Misses 173 198 +25 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.