fix(core): resolve compilation errors and field mismatches from wave 1 contributions#146
Closed
fix(core): resolve compilation errors and field mismatches from wave 1 contributions#146
Conversation
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
This PR cleans up cascading issues introduced during wave 1 open-source contributions. All fixes are backend-only — no new features, no behaviour changes. The goal is to merge a known-good backend to main before wave 2 begins.
What was broken
routes/tx.rsget_tx_rawhandler that referencedfetch_transaction_raw— a method that was never implemented onHorizonClient#[utoipa::path]attribute block left behind after the handler was deletedbody::Body,response::Response,http::StatusCode,http::header) that came in with the raw handlerget_tx_rawentry from the OpenApipaths()macro inroutes/mod.rsroutes/account.rsserde_json::Valuereturn type with a typedAccountExplanationResponsestruct —serde_jsonwas not inCargo.tomland the untyped response was causing compile failuresservices/horizon.rsfetch_account()method — it existed in the route handler but was never implemented onHorizonClient, causing every account lookup to failHorizonAccountintermediary struct matching Horizon's actual/accounts/:idresponse shape:signersasVec<HorizonSigner>,flagsas a nestedHorizonAccountFlagsobject,home_domainas a plainString(Horizon sends""notnull)#[serde(default)]to all optional fields so unknown or absent fields do not cause deserialization failuresinto_domain()convertinghome_domain: StringtoOption<String>correctlymodels/operation.rsFrom<HorizonOperation>impl:op.type_i→op.operation_type(field was renamed inHorizonOperationbut the consumer was not updated)op.master_weight→op.master_key_weightop.clear_flags/op.set_flags: Horizon returnsVec<u32>but domain model expectsu32— now folded into a bitmask with.reduce(|a, b| a | b)op.offer_id: Horizon returnsString, domain model expectsu64— now parsed with.and_then(|s| s.parse::<u64>().ok()).unwrap_or(0)op.pathreference — field does not exist onHorizonOperationCargo.tomlserde_json = "1"to[dependencies]— was missing, causing compile failures in account routeVerified against mainnet
Files changed
packages/core/src/routes/tx.rspackages/core/src/routes/account.rspackages/core/src/routes/mod.rspackages/core/src/services/horizon.rspackages/core/src/models/operation.rspackages/core/Cargo.toml