SIGN IN SIGN UP
unionlabs / union UNCLAIMED

The trust-minimized, zero-knowledge bridging protocol, designed for censorship resistance, extremely high security, and usage in decentralized finance.

0 0 174 Rust

feat(zkgm): introduce stake/unstake/withdrawStake/withdrawRewards tests (#4686)

Introduce staking tests

- test_verify_stake_ok - Valid staking with governance token transfer
and NFT minting
- test_verify_unstake_ok - Valid unstaking from STAKED state with NFT
escrow
- test_verify_withdrawStake_ok - Valid withdrawal after unstaking
completion time
- test_verify_withdrawRewards_ok - Valid reward withdrawal from STAKED
position
- test_verify_stake_invalidGovernanceToken - Rejects wrong governance
token
- test_verify_stake_invalidMetadataImage - Rejects mismatched metadata
- test_verify_stake_cannotBeForwarded - Prevents stake instruction
forwarding
- test_verify_unstake_notStakable - Prevents unstaking from STAKING
state
- test_verify_withdrawStake_notWithdrawable - Prevents premature
withdrawal
- test_verify_withdrawRewards_notWithdrawable - Prevents reward
withdrawal from non-STAKED
- test_onAckPacket_stake_success/failure - Handles stake
completion/refund
- test_onAckPacket_unstake_success - Sets UNSTAKING state with
completion time
- test_onAckPacket_withdrawStake_success - Transfers tokens and handles
rewards/slashing
- test_onAckPacket_withdrawRewards_success - Mints rewards and returns
NFT
- test_onTimeoutPacket_stake/unstake - Refunds tokens and returns NFTs
on timeout
- test_registerGovernanceToken_ok/alreadySet - Channel governance token
management
- test_staking_batch_ok - Multiple stake operations in single
transaction
H
hussein committed
7b60ba094bcab13396b2cd9a03c987203fd2653b
Committed by GitHub <noreply@github.com> on 6/12/2025, 10:17:51 AM