π οΈ [TASK] : Remove all dead code annotations #1721
Labels
requires architecture review
Requires at least 1 architect to sign off on PR before merge.
Milestone
Remove the
#[allow(dead_code)]
annotations within cat-gateway, and list all functions/types which are really dead.Attach the list as a series of links to the code which is really dead, for further analysis.
Also look for any modules which are not being included, or large sections of code which are commented out or disabled in any way.
Dead code often occurs in large groups, try and group them in the list if the functions, types, etc are all related, or call one another.
Try and put the highest function which is dead at the top of the group. This is because all the other functions are dead if they are only called by this top level function, so it helps analyze what dead and if it should be dead or not.
This ticket will create a draft PR with all the annotations removed, but that PR will not get merged as is, it will be expanded once the true list of dead code has been reviewed and functions are approved for removal.
List of Dead Code found
bin/src/db/event/legacy
andbin/src/service/common/objects/legacy
. They can be removed without any side effects. When remove this part, also consider to remove their dependency:rust_decimal
.bin/src/cardano/cip36_registration_obsolete
: including obsolete Rust code and CDDL codebin/src/cardano/mod.rs
:MAX_BLOCKS_BATCH_LEN
bin/src/cardano/util.rs
:type WitnessHash
type WitnessPubKey
type StakeCredentialHash
type StakeCredentialKey
fn parse_policy_assets
fn parse_child_assets
fn valid_era
extract_stake_credentials_from_certs
fn find_matching_stake_credential
bin/src/db/event/common/query_limits.rs
QueryLimitsInner::All
QueryLimitsInner::Limit
QueryLimits::ALL
QueryLimits::ONE
bin/src/db/event/signed_docs/full_signed_doc.rs
fn authors
fn metadata
fn body
bin/src/db/event/signed_docs/signed_doc_body.rs
fn authors
bin/src/db/index/session.rs
CassandraSession::persistent
bin/src/db/index/queries/mod.rs
type FallibleQueryResult
bin/src/db/index/schema/mod.rs
const SCHEMA_VERSION
bin/src/service/api/cardano/registration_get.rs
this file is unused (not included)bin/src/service/api/cardano/sync_state_get.rs
Responses::Ok
bin/src/service/api/cardano/types.rs
fn get_credentials
fn bytes
type TxId
type StakeCredential
type PublicVotingInfo
type PaymentAddress
type MetadataCip36
bin/src/service/api/health/live_get.rs
fn set_live
bin/src/service/common/auth/api_key.rs
struct InternalApiKeyAuthorization(String)
theString
inside the structbin/src/service/common/objects/cardano/registration_info.rs
fn RegistrationInfo::new
bin/src/service/common/objects/generic/pagination.rs
const CURRENT_PAGE_DESCRIPTION
fn CurrentPage::new
bin/src/service/common/responses/mod.rs
TooManyRequests
fn unauthorized
fn forbidden
fn rate_limit
bin/src/service/common/types/cardano/nonce.rs
fn into_option
bin/src/service/common/types/cardano/txn_index.rs
fn into_option
bin/src/service/common/types/headers/retry_after.rs
RetryAfterHeader::Date
RetryAfterOption::None
RetryAfterOption::Some
bin/src/utils/blake2b_hash.rs
type Blake2b224
fn blake2b_224
type Blake2b256
fn blake2b_256
The text was updated successfully, but these errors were encountered: