anchor_coverage/anchor_cli_lib/
hacks.rs

1use super::*;
2
3// smoelius: Avoid "`Stdout` is never constructed" warning.
4#[allow(dead_code)]
5const STDOUT: OutFile = OutFile::Stdout;
6
7// smoelius: `__build_with_debug` is the parent module's main export.
8
9#[allow(clippy::too_many_arguments)]
10pub fn __build_with_debug(
11    cfg_override: &ConfigOverride,
12    no_idl: bool,
13    idl: Option<String>,
14    idl_ts: Option<String>,
15    verifiable: bool,
16    skip_lint: bool,
17    program_name: Option<String>,
18    solana_version: Option<String>,
19    docker_image: Option<String>,
20    bootstrap: BootstrapMode,
21    stdout: Option<File>, // Used for the package registry server.
22    stderr: Option<File>, // Used for the package registry server.
23    env_vars: Vec<String>,
24    cargo_args: Vec<String>,
25    no_docs: bool,
26    arch: ProgramArch,
27) -> Result<()> {
28    build(
29        cfg_override,
30        no_idl,
31        idl,
32        idl_ts,
33        verifiable,
34        skip_lint,
35        program_name,
36        solana_version,
37        docker_image,
38        bootstrap,
39        stdout,
40        stderr,
41        env_vars,
42        cargo_args,
43        no_docs,
44        arch,
45    )
46}
47
48// smoelius: The next three functions are needed by the `anchor_cli_config` module.
49
50pub fn __get_keypair(path: &str) -> Result<Keypair> {
51    get_keypair(path)
52}
53
54pub fn __is_hidden(entry: &walkdir::DirEntry) -> bool {
55    is_hidden(entry)
56}
57
58pub fn __keys_sync(cfg_override: &ConfigOverride, program_name: Option<String>) -> Result<()> {
59    keys_sync(cfg_override, program_name)
60}
61
62// smoelius: The remaining functions are stand-ins for Anchor functions with the same names.
63
64pub fn cd_member(_cfg_override: &ConfigOverride, _program_name: &str) -> Result<()> {
65    Ok(())
66}
67
68pub fn check_overflow(_cargo_toml_path: impl AsRef<Path>) -> Result<bool> {
69    Ok(false)
70}
71
72pub fn check_anchor_version(_cfg: &WithPath<Config>) -> Result<()> {
73    Ok(())
74}
75
76pub fn check_deps(_cfg: &WithPath<Config>) -> Result<()> {
77    Ok(())
78}
79
80pub fn build_cwd_verifiable(
81    _cfg: &WithPath<Config>,
82    _cargo_toml: PathBuf,
83    _build_config: &BuildConfig,
84    _stdout: Option<File>,
85    _stderr: Option<File>,
86    _skip_lint: bool,
87    _env_vars: Vec<String>,
88    _cargo_args: Vec<String>,
89    _no_docs: bool,
90    _arch: &ProgramArch,
91) -> Result<()> {
92    Ok(())
93}
94
95pub fn check_idl_build_feature() -> Result<()> {
96    Ok(())
97}