Expand test coverage: dex competitions/cross-chain, governance private voting, insurance triggers, staking penalties - #1051
Merged
nanaf6203-bit merged 3 commits intoAug 25, 2026
Conversation
…nce triggers and staking penalties - dex: cover the trading-competition lifecycle (creation, validation, scoring via swaps, pro-rata reward claims, double-claim rejection, activate/deactivate toggles), the cross-chain trade flow (create, attach bridge request, finalize, authorization and error branches) and liquidity-mining campaign configuration (MettaChain#997) - governance: test the private voting feature end to end - commit, start reveal phase, reveal with correct/wrong salt, reveal before phase start, double reveal, plus vote_with_signature with and without an approval and register_public_key signer gating (MettaChain#998) - insurance: cover claim-trigger registration and deactivation, the admin/oracle authorization boundary of report_oracle_event, one-shot firing, threshold met/unmet boundaries and the auto-paid claim path (MettaChain#999) - staking: pin the unbonding period boundary (claim exactly at and one block before/after), fix a mangled attribute that silently disabled two tests, and assert exact early-withdrawal penalty math on non-round amounts for default and custom bps (MettaChain#1000) Closes MettaChain#997, closes MettaChain#998, closes MettaChain#999, closes MettaChain#1000
|
@khaadish Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
The gate fails for all PRs independent of their contents: the pinned dependency set (trie-db 0.28.0) no longer compiles under the stable rustc (1.98.0) that CI installs fresh on every run, so clippy aborts inside dependency code before reaching project code. Per maintainer request, comment out the workflow until the dependency baseline is refreshed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands test coverage across four contracts, closing all four assigned coverage issues.
create_cross_chain_trade->attach_bridge_request->finalize_cross_chain_tradewith authorization checks, unknown-pool/unconfigured-route rejections and open-position accounting via portfolio snapshots), andset_liquidity_mining_campaign(authorization, validation, storage round-trip).vote_with_signatureis tested withNone(plain vote) and with an approval from an unregistered key / invalid signature (rejected without recording).register_public_keysigner gating included.register_claim_trigger(holder/admin paths, unauthorized rejection, invalid payout modes),deactivate_claim_trigger(one-shot deactivation, stranger rejection, TriggerNotFound) andreport_oracle_event(admin and authorized-oracle acceptance, unauthorized reporter rejection, threshold met-vs-unmet including exact boundary 149/150, auto-created claim paid from the pool withClaimStatus::Paid, one-shot re-fire rejection).start + UNBONDING_PERIOD_BLOCKSsucceeds, one block before fails then succeeds on the next block; fixes a mangled#[ink::test]attribute that silently disabled two existing tests; adds exact early-withdrawal penalty math assertions on non-round amounts (12_345 @ 333 bps = 411 retained; 9_999 @ default 1_000 bps = 999 retained). Slashing flows were already covered by existing tests (slash_validator_*,slash_multiple_delegators).Test results
Closes #997
Closes #998
Closes #999
Closes #1000