Skip to content

Remove account_id parameter from IndexerViewClient methods - #4102

Open
ayushsingh82 wants to merge 1 commit into
near:mainfrom
ayushsingh82:remove-view-client-account-id-param
Open

Remove account_id parameter from IndexerViewClient methods#4102
ayushsingh82 wants to merge 1 commit into
near:mainfrom
ayushsingh82:remove-view-client-account-id-param

Conversation

@ayushsingh82

Copy link
Copy Markdown

Summary

  • IndexerViewClient is always accessed through IndexerState, which already holds mpc_contract_id — every method taking it as a parameter was passing the same redundant value at every call site (there was already a TODO(#1514) in the code noting this)
  • IndexerViewClient now stores its own copy of mpc_contract_id, set once in IndexerState::new
  • Removed the parameter from all 12 methods on IndexerViewClient (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 private get_mpc_state helper
  • Updated all call sites in tx_sender.rs, tee.rs (including the generic monitor_allowed_hashes fetcher, whose Fetcher bound dropped its AccountId argument), participants.rs, foreign_chain.rs, and migrations.rs
  • IndexerState::mpc_contract_id itself is unchanged — it's still needed for building outgoing transactions, unrelated to IndexerViewClient

Closes #1514

Verification

  • cargo check -p mpc-node --all-features: clean
  • cargo clippy -p mpc-node --all-targets --all-features -- -D warnings: clean (type-checks test code too)
  • cargo fmt -- --check: clean
  • Wasn't able to complete a full cargo test link+run locally (linking mpc-node's test binary, which statically pulls in nearcore/near-client/etc., needs more disk than my local environment has available) — cargo check/clippy --all-targets already 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

  • CI clippy job passes
  • CI test suite passes

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove account_id parameter from IndexerViewClient::get_pending_requests

1 participant