Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/generators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,17 @@ fn gen_analysis_get_function_entry(input_size: u64) -> GenOutput {
GenOutput::new(None, body, input_size)
}

/// cost_function: AnalysisFetchContractEntry
/// input_size: count of public and read-only functions in contract
/// `contract_analysis_size(&contract)`
fn gen_analysis_fetch_contract_entry(input_size: u64) -> GenOutput {
let dummy_fns = (0..input_size)
.map(|i| format!("(define-public (dummy-fn-{} (a uint) (b uint))", i))
.collect();

GenOutput::new(None, dummy_fns, input_size)
}

/// cost_function: InnerTypeCheckCost
/// input_size: type signature size of argument
/// `arg_type.size()`
Expand Down Expand Up @@ -2474,7 +2485,9 @@ pub fn gen(function: ClarityCostFunction, scale: u16, input_size: u64) -> GenOut

/// reviewed: @pavitthrap
/// This cost function is not used anywhere.
ClarityCostFunction::AnalysisFetchContractEntry => unimplemented!(), // not used anywhere
ClarityCostFunction::AnalysisFetchContractEntry => {
gen_analysis_fetch_contract_entry(input_size)
}


/// Ast ////////////////////////////////
Expand Down