feat: add disclosure_uri and disclosure_hash to offering metadata#504
Open
bbjiggy wants to merge 4 commits into
Open
feat: add disclosure_uri and disclosure_hash to offering metadata#504bbjiggy wants to merge 4 commits into
bbjiggy wants to merge 4 commits into
Conversation
Add `DisclosureMeta` struct with `uri: Bytes` (max 256 bytes) and `hash: BytesN<32>` fields, stored per-offering under `DataKey2::DisclosureMeta`. Introduce `update_disclosure` (issuer-only, auth-gated) that validates URI length and rejects incoherent empty-URI/non-zero-hash pairs, then persists the binding and emits `disc_upd`. Add `get_disclosure` read-only accessor. New error codes: `DisclosureUriTooLong = 51`, `InconsistentDisclosure = 52`. Test coverage: happy path, boundary (256 B), oversize (257 B), empty-URI variants, overwrite, unknown/wrong-issuer rejection, event emission. Closes RevoraOrg#485
|
@bbjiggy 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! 🚀 |
- Cargo.toml: declare cfg(kani) as known so clippy does not flag unexpected_cfgs - lib.rs: use .clamp() instead of .max().min() chain, .is_empty() instead of .len() == 0, remove blank line after orphaned doc-comment section header - test_claim_transfer_fail.rs: fix sibling-offering test — deploy token_b via deploy_failing_token, add missing payout_asset/payment_token args to register_offering and deposit_revenue - test_compute_share_invariants.rs: add &[] so for &bps in &[...] pattern compiles (u32 ref destructure) - test_event_indexed_v2.rs: replace deprecated register_stellar_asset_contract with register_stellar_asset_contract_v2, remove redundant as u32 casts - vesting.rs: Vec::new(env) not Vec::new(&env), collapse nested if into &&
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
DisclosureMetastruct (uri: Bytes,hash: BytesN<32>) stored per-offering underDataKey2::DisclosureMetaupdate_disclosure(issuer, namespace, token, uri, hash)— issuer-only, auth-gated — validates URI ≤ 256 bytes, rejects empty-URI/non-zero-hash, persists the binding, and emitsdisc_updeventget_disclosureread-only accessorDisclosureUriTooLong = 51,InconsistentDisclosure = 52Test plan
get_disclosure— values round-tripDisclosureUriTooLongInconsistentDisclosureOfferingNotFoundOfferingNotFoundupdate_disclosureCloses #485