Open
Conversation
|
@Agbeleshe is attempting to deploy a commit to the fabianalejandrosanchezduran-gmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
@aguilar1x patiently waiting for your review 👋🙂 |
Author
|
@FabianSanchezD . Pattiently waiting for yout review |
Author
|
@aguilar1x still waiting for your review |
aguilar1x
requested changes
Jan 31, 2026
added a test that expects metadata updates to extend storage TTL, but your contract doesn’t consistently call env.storage().persistent().extend_ttl(...) on updates, so the TTL isn’t being renewed and the test fails.
Author
|
@aguilar1x still waiting for your review |
1 similar comment
Author
|
@aguilar1x still waiting for your review |
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.
PR: Enforce Asset Existence Before Setting Metadata
close #30
Rationale and Background
The previous implementation of the
set_rwa_metadatafunction allowed for a silent inconsistency where metadata could be created for assets not yet registered in the internal assets vector. This led to a state where query functions likeget_all_rwa_assets()could return IDs that weren't properly searchable via price feed functions, causing issues for integrators relying on a consistent registry. By enforcing registration before metadata assignment, we ensure that every asset with metadata is a valid, queryable part of the oracle ecosystem.Implementation Details
To address this, we added a new
AssetNotRegisterederror variant with code 10 to the contract's error enum. Theset_rwa_metadatafunction now proactively validates that any incomingasset_idexists in the system's storage before applying updates. Furthermore, the logic was refactored to unconditionally synchronize theasset_typesmapping once an asset is verified as registered, eliminating the previous conditional block that occasionally failed to update mapping values even when the asset existed.Testing and Verification
The test suite in
test.rswas significantly expanded to cover all edge cases associated with this refactor, including four specific new tests for registration rejection and post-registration acceptance. We also updated all legacy tests to ensure they now perform the required registration steps before setting metadata, maintaining a clean green-build state. These tests verify that the contract now correctly rejects unregistered symbols while maintaining full compatibility with assets added via both the constructor and theadd_assetsadministrative function.Final Results and Impact
Following the refactor, the contract successfully passes all 14 unit tests and compiles to a release WASM profile without errors. The primary benefit of this change is the elimination of "ghost" metadata entries, ensuring that
get_rwa_asset_type()andget_rwa_metadata()are always perfectly synchronized for any asset registered in the oracle. This leads to a more predictable and robust experience for downstream applications and protocols integrating with the Neko RWA infrastructure.