fix(hello-world): repair contract lib build after merged refactor (#884) - #886
Open
kaluuba-org wants to merge 1 commit into
Open
fix(hello-world): repair contract lib build after merged refactor (#884)#886kaluuba-org wants to merge 1 commit into
kaluuba-org wants to merge 1 commit into
Conversation
…artdevs17#884) Upstream main (3b731f2) left the hello-world contract library with 93 compile errors after the architectural refactor in Smartdevs17#884. This repairs the crate so cargo check -p hello-world passes: restored the mangled get_legacy_risk_params body and removed the duplicate get_risk_params in risk_params.rs, restored the dropped timelock module declaration in lib.rs, and fixed SDK-27 API drift (sequence(), ReentrancyGuard::new_with_key 3-arg form, is_zero_address via XDR, Vec::remove(u32), typed flags), enum/structural mismatches (CircuitBreakerStatus Paused/Emergency variants, RecoveryRequest.ready_at, CircuitBreakerState construction), missing GovernanceError/DebtTokenError variants, the missing From<EmergencyWithdrawalError> impl, and shared-events conversion helpers.
|
@kaluuba-org is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
4 tasks
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.
Closes #720 #712
Summary
Upstream
main(3b731f2, #884) left thehello-worldcontract library with 93 compile errors. This PR repairs the crate socargo check -p hello-worldpasses cleanly.What was broken and fixed
get_legacy_risk_params(body truncated mid-expression, leaving an unclosed delimiter) and left a duplicateget_risk_paramsdefinition. Restored the legacy getter body and removed the duplicate.pub mod timelock;declaration (the crate routestimelock::*entrypoints at lib.rs:2452-2513, so the module was required); typedflagsasu32; fixedgov_get_multisig_configreturn type; fixed the cross-asset and oracle entrypoint result mapping.env.ledger().sequence_number()→.sequence()(flash_loan.rs);ReentrancyGuard::new_with_key(env, key, false);Address::zero()→ XDR-constructed zero-contract-address check (private in SDK 27);Vec::removenow takesu32;iter().positionclosure pattern.Paused/EmergencytoCircuitBreakerStatuswith exhaustive match arms;EmergencyTrigger::AdminEmergency→Admin;abnormal_utilization_threshold_bps→abnormal_utilization_bps; completedCircuitBreakerStateconstruction withtier/affected_pool/guardian_multisig/governance_vote_required; addedRecoveryRequest.ready_at.GovernanceErrorvariants (RecoveryNotReady,InvalidActionTypeDelay,EmergencyOverrideAlreadyApproved,InsufficientEmergencyApprovals), missingDebtTokenErrorconversion arms, and the missingFrom<EmergencyWithdrawalError> for LendingError.to_shared_proposal_type/to_shared_vote_type/to_shared_emergency_triggerconversions for the shared-events schema.Vecimports, borrow-after-move fix in mev_protection.rs,get_static_reserve_factor→get_legacy_reserve_factor,reserve::get_reserve_balance→treasury::get_reserve_balance, and a type annotation in reputation.rs.Verification
Known remaining breakage (pre-existing, out of scope)
Chronicled for follow-up PRs; none are caused by this change:
cargo test -p hello-worldfails with ~647 errors across 52 stale test files. The tests target the pre-refactor contract API (e.g.client.get_utilization(),is_operation_paused,get_risk_config) which no longer exists onHelloContractClient. Porting them to the new API is a separate, sizable effort.stellarlend-commonships a full#[contract] UpgradeManagerwhoseno_mangleexports collide whenstellarlend-amm(ahello-worlddependency) re-exports those methods:rust-lld: error: duplicate symbol: upgrade_rollback(etc.). Needsstellarlend-common's contract to be feature-gated or split out.stellar contract build(stellar-cli v25.2+) or thewasm32v1-nonetarget; plaincargo build --target wasm32-unknown-unknownis unsupported by the Soroban Environment.