Remove account_id parameter from IndexerViewClient methods - #4102
Open
ayushsingh82 wants to merge 1 commit into
Open
Remove account_id parameter from IndexerViewClient methods#4102ayushsingh82 wants to merge 1 commit into
ayushsingh82 wants to merge 1 commit into
Conversation
IndexerViewClient is always accessed through IndexerState, which already holds mpc_contract_id, so every method taking it as a parameter was passing the same redundant value at every call site. IndexerViewClient now stores its own copy of mpc_contract_id (set once in IndexerState::new) and each method reads it from self instead. Closes near#1514
This was referenced Aug 7, 2026
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
IndexerViewClientis always accessed throughIndexerState, which already holdsmpc_contract_id— every method taking it as a parameter was passing the same redundant value at every call site (there was already aTODO(#1514)in the code noting this)IndexerViewClientnow stores its own copy ofmpc_contract_id, set once inIndexerState::newIndexerViewClient(get_pending_request,get_pending_ckd_request,get_pending_verify_foreign_tx_request,get_participant_attestation,get_supported_chains,get_foreign_chains_configs,get_available_chains,get_allowed_foreign_chain_providers,get_mpc_contract_state_dto,get_mpc_allowed_image_hashes,get_mpc_allowed_launcher_compose_hashes,get_mpc_tee_accounts,get_mpc_migration_info) and the privateget_mpc_statehelpertx_sender.rs,tee.rs(including the genericmonitor_allowed_hashesfetcher, whoseFetcherbound dropped itsAccountIdargument),participants.rs,foreign_chain.rs, andmigrations.rsIndexerState::mpc_contract_iditself is unchanged — it's still needed for building outgoing transactions, unrelated toIndexerViewClientCloses #1514
Verification
cargo check -p mpc-node --all-features: cleancargo clippy -p mpc-node --all-targets --all-features -- -D warnings: clean (type-checks test code too)cargo fmt -- --check: cleancargo testlink+run locally (linkingmpc-node's test binary, which statically pulls innearcore/near-client/etc., needs more disk than my local environment has available) —cargo check/clippy --all-targetsalready confirm the test code (including#[cfg(test)]modules) type-checks correctly under the new signatures. Happy to fix up anything CI's actual test run surfaces.Test plan