Repository navigation
#17 Add contract configuration read API FIXED - #188
Open
onakijames-droid wants to merge 1 commit into
Open
onakijames-droid wants to merge 1 commit into
onakijames-droid wants to merge 1 commit into
Conversation
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.
CLOSE #17 Add contract configuration read API
Description
Added stable, read-only configuration and diagnostics helpers for SDK and dashboard clients.
This PR introduces a new
read_helpersmodule exposing aggregate read APIs for:All new helpers are safe read-only calls: they require no auth, emit no events, perform no storage writes, and are callable before initialization and while paused.
Key implementation files:
src/read_helpers.rs— new response structs, optional wrapper types, storage version constant, and public read entrypoints.src/lib.rs— exports the newread_helpersmodule.src/test.rs— adds default-state, configured-state, and no-mutation coverage.docs/configuration-read-helpers.md— documents client usage and safety guarantees.docs/contract-spec.md/README.md— links and summarizes the new read-helper API.fixtures/sdk/*.json— regenerated fixture snapshots so SDK fixture tests pass with the current observable contract behavior.Related Issues
Fixes: configuration visibility issue for SDK/dashboard diagnostics.
Issue number was not provided in the prompt.
Completion Table
get_contract_config,get_storage_info,get_storage_version, and supporting response structs insrc/read_helpers.rs.test_read_helpers_default_state_and_never_mutateandtest_read_helpers_configured_state_and_pause_visibilityinsrc/test.rs.docs/configuration-read-helpers.md; updateddocs/contract-spec.mdandREADME.md.get_role_state,get_pause_state,get_storage_info, andget_storage_versioninsrc/read_helpers.rs.docs/configuration-read-helpers.mdanddocs/contract-spec.md.get_compliance_module_status,get_compliance_account_state, andget_asset_registry_statusinsrc/read_helpers.rs.docs/configuration-read-helpers.md.set,remove,publish, orrequire_auth.docs/configuration-read-helpers.md.src/test.rs. Fullcargo testpasses.docs/configuration-read-helpers.md; updateddocs/contract-spec.mdandREADME.md.Detailed Traceability Mapping
ContractConfigRead, optional wrapper enums,StorageVersionRead,get_contract_config,get_storage_info, andget_storage_version.STORAGE_VERSIONis a constant, not a stored key.test_read_helpers_default_state_and_never_mutate;test_read_helpers_configured_state_and_pause_visibility.RoleReadState,PauseReadState, and version read helpers.ComplianceModuleStatusRead,ComplianceAccountRead, andAssetRegistryStatusRead.src/test.rs:test_read_helpers_default_state_and_never_mutate,test_read_helpers_configured_state_and_pause_visibility.Type of Change
PR Evidence Checklist
1. Issue Reference
Note: issue number was not provided, so this PR references the configuration visibility issue by description.
2. Implementation Summary
New public functions are documented. No new events, error codes, or roles were added.
3. Tests Added or Justification
src/test.rs—test_read_helpers_default_state_and_never_mutatesrc/test.rs—test_read_helpers_configured_state_and_pause_visibility4. Commands Run
make verifypasses locally.5. CI Status
6. Acceptance Criteria Coverage
No incomplete criteria.
7. Storage Compatibility
The new helpers only read existing storage keys.
STORAGE_VERSIONis a compile-time constant and is not persisted.Policy & Standards
CONTRIBUTING.mdguidelines.cargo fmtwas run).cargo clippywas not run in this workspace).cargo testwas run).Additional Context
Commands run
CARGO_BUILD_JOBS=1 cargo test -q -j 1Result:
Result:
Notes
cargo testandcargo buildpass. The build currently emits pre-existing warnings unrelated to this PR, including:src/asset.rshost_errorhelper intests/sdk_fixtures.rsNo new persisted storage keys, events, error codes, or roles were introduced.