Add OffchainAsset (OA) magic numbers to KnownMagic enum#128
Add OffchainAsset (OA) magic numbers to KnownMagic enum#128thedavidmeister wants to merge 5 commits into
Conversation
Adds the five OffchainAsset magic numbers used by the gildlab/SFT frontend and h20.market tokenization UI to the KnownMagic enum so RainMetaDocumentV1Item can encode/decode receipt information: - OaSchema = 0xffa8e8a9b9cf4a31 - OaHashList = 0xff9fae3cc645f463 - OaStructure = 0xffc47a6299e8a911 - OaTokenImage = 0xff8cd2927c8c86cb - OaTokenCredentialLinks = 0xffbc38eb14ad2209 The new variants are also added to the TryFrom<u64> match so they round-trip on decode. Existing magic values are unchanged. Closes #98 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 51 minutes and 36 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Adds the five OffchainAsset (OA) magic numbers used by the gildlab/SFT frontend and the h20.market tokenization UI to the
KnownMagicenum incrates/cli/src/meta/magic.rs, soRainMetaDocumentV1Itemcan be used to encode/decode receipt information forOffchainAssetReceiptVaultdeposits and withdrawals.OaSchema0xffa8e8a9b9cf4a31OaHashList0xff9fae3cc645f463OaStructure0xffc47a6299e8a911OaTokenImage0xff8cd2927c8c86cbOaTokenCredentialLinks0xffbc38eb14ad2209Details
TryFrom<u64>match so they round-trip on decode (consistent with every other variant in that match).u64prefix bytes (mirroring the existing per-magic tests), plus a round-trip test throughTryFrom<u64>.cargo build,cargo test(126 passed, 0 failed),cargo fmt, andcargo clippy --all-targets --all-featuresare all green. Mutation-validated: flippingOaSchema's value madetest_oa_schemafail, then restored.Out of scope
The issue's "Additional consideration" about supporting
OA_SCHEMAas an extra CBOR map key (extendingRainMetaDocumentV1Itembeyond keys 0-4) is a separate, larger change and is not addressed here.Closes #98
🤖 Generated with Claude Code