fix: resolve compilation errors in agent-registry and upgrade-manager - #470
Merged
Conversation
- Remove redundant `From` impl for `UpgradeableError` after applying `#[contracterror]` to fix trait conflicts. - Resolve module resolution issues and restored missing types (`SlaViolation`) in agent-registry. - Update `generate_migration_steps` and string handling logic to use Soroban-compatible comparisons. - Rectify ownership logic by cloning `new_wasm_hash` before usage in `pre_upgrade_hook`. - Fix outdated test initializations and correctly configure `GasConfig` parameters in test suites. - Resolve `Events` missing imports in `upgrade_tests.rs`.
|
@k-deejah 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! 🚀 |
|
@AbuJulaybeeb is attempting to deploy a commit to the Jaja's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
agent-registryandupgrade-managercrates.SlaViolationtype and resolved module exports fortypes.rs.GasConfiginstantiations in test suites to include newly added tracking fields.borrow of moved value) in upgrade hooks.Why
This change was required to finalize the implementation for #391. While the underlying storage compaction and footprint reductions were previously introduced, the refactoring resulted in strict compilation failures regarding trait conflicts (
#[contracterror]),borrow of moved valueissues, and broken test suite initializations. Resolving these issues was mandatory to ensure the optimizations compile successfully and the tests execute.Implementation
impl From<&UpgradeableError> for soroban_sdk::Errorwhich was redundantly conflicting with the auto-generated implementation provided by the#[contracterror]macro. Restored the accidentally deletedMigrationPlanFailedenum variant.pub mod types;andpub use types::*;inlib.rsand restored theSlaViolationstruct that was causing resolution errors.generate_migration_stepsto accept Soroban&Stringtypes rather than standard&str, replacing.starts_with()with exact semantic bounds compatible with Soroban'sno_stdStringAPI.new_wasm_hashinpre_upgrade_hookbefore it is consumed, rectifying aborrow of moved valuecompiler error.update_metadata,update_metadata_marginal,cleanup_error, andcleanup_error_marginalfields toGasConfigtest mocks.Events,AgentRegistryContractClient) inupgrade_tests.rs..unwrap()and.is_ok()assertions on return types that directly returned values rather thanResults.Testing
cargo test -p agent-registrycargo buildupgrade-manager,agent-registry) compile successfully in ano_stdenvironment.Note: Some agent registry snapshot integration tests are failing (
HostError: Error(Auth, ExistingValue)) as they require further mock auth alignments with the new optimization logic, but the workspace builds cleanly and unit compilation is resolved.Scope / Risk
agent-registryandupgrade-managersmart contracts, along with their respective test suites.Issue
Closes #391