chore(contracts): remove duplicated init definitions and reconcile signature to docs - #302
Merged
greatest0fallt1me merged 5 commits intoApr 24, 2026
Conversation
…signature to docs - Replace all StorageKey::MetaKey references with StorageKey::Meta (5 sites) - Restore get_max_deduct as private helper (was accidentally removed) - Add require_not_paused guard to deduct() per pause circuit-breaker spec - Remove duplicate require_not_paused call from batch_deduct() - Fix deposit event to emit caller as topic1 per EVENT_SCHEMA.md - Flip deduct/batch_deduct_while_paused tests to should_panic - Fix duplicate else block syntax error in property-based test - Update deposit_event_schema_alignment and owner_deposit tests (1→2 topics) - Prefix unused variables _settlement, _step_cap (clippy -D warnings clean) - Reconcile README init signature to include initial_balance param - Update SECURITY.md: tick init guard checklist items, clarify get_max_deduct
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
Resolves the duplicated
initdefinition in the vault contract and reconciles all related signatures, storage keys, and tests to match the documented spec.Changes
contracts/vault/src/lib.rsStorageKey::MetaKeywithStorageKey::Meta(5 sites) —MetaKeyvariant does not exist in the enum; this was the root compile-breaking bugget_max_deductas a private internal helper; it was accidentally removed when deduplicating the entrypoint declarations, but is still called bydeduct()andbatch_deduct()require_not_pausedguard todeduct()—depositandbatch_deductboth had it;deductwas missing itrequire_not_pausedcall frombatch_deduct()(was called twice)depositevent to emitcallerastopic1perEVENT_SCHEMA.md(was emitting only 1 topic; schema specifies 2)contracts/vault/src/test.rsdeduct_while_paused_succeeds→deduct_while_paused_failswith#[should_panic(expected = "vault is paused")]batch_deduct_while_paused_succeeds→batch_deduct_while_paused_failswith#[should_panic(expected = "vault is paused")]} else {syntax error in property-based fuzz testdeposit_event_schema_alignmentandowner_deposit_increases_balance_and_emits_eventto assert 2 topics and verifytopic1is the depositor address_settlement,_step_cap(clippy-D warningsclean)README.mdinitsignature to include theinitial_balanceparameter with descriptionSECURITY.md[x]on init-guard checklist itemsget_max_deductnote: retained as private helper, not removedTest Results
Closes #243