Skip to main content

trident_client/
lib.rs

1//! Trident is a suite of tools and libraries for testing, auditing and developing.
2//! [Solana](https://solana.com/) / [Anchor](https://book.anchor-lang.com/chapter_1/what_is_anchor.html) programs (smart contracts).
3//!
4//! Trident could be useful for writing Rust dApps, too.
5
6mod commander;
7mod coverage;
8mod error;
9mod exit_code;
10mod idl_loader;
11mod server;
12mod test_generator;
13mod test_generator_manifest;
14mod test_generator_template;
15mod utils;
16
17pub mod ___private {
18    pub use super::commander::Commander;
19    pub use super::commander::Error;
20    pub use super::exit_code::ExitCodeMode;
21    pub use super::idl_loader::load_idls;
22    pub use super::idl_loader::load_idls_from_files;
23    pub use super::idl_loader::IdlError;
24    pub use super::server::DashboardServer;
25    pub use super::test_generator::ProjectType;
26    pub use super::test_generator::TestGenerator;
27}
28
29mod constants {
30    // Tomls
31    pub(crate) const CARGO_TOML: &str = "Cargo.toml";
32    pub(crate) const TRIDENT_TOML: &str = "Trident.toml";
33
34    // Tests
35    /// Directory name for the Trident tests workspace
36    /// To customize: change this value and VSCODE_TESTS_WORKSPACE_PATH accordingly
37    pub(crate) const TESTS_WORKSPACE_DIRECTORY: &str = "trident-tests";
38
39    // VSCode - Paths relative to project root
40    pub(crate) const VSCODE_DIRECTORY: &str = ".vscode";
41    pub(crate) const VSCODE_SETTINGS: &str = "settings.json";
42    /// Path to the tests workspace for VSCode settings (relative to project root)
43    /// This is used in rust-analyzer.linkedProjects configuration
44    /// To customize: ensure this matches TESTS_WORKSPACE_DIRECTORY
45    /// Format: "./{TESTS_WORKSPACE_DIRECTORY}/Cargo.toml"
46    pub(crate) const VSCODE_TESTS_WORKSPACE_PATH: &str = "./trident-tests/Cargo.toml";
47
48    // Fuzzing
49    pub(crate) const FUZZ_ACCOUNTS_FILE_NAME: &str = "fuzz_accounts.rs";
50    pub(crate) const TYPES_FILE_NAME: &str = "types.rs";
51    pub(crate) const FUZZ_TEST: &str = "test_fuzz.rs";
52
53    // Formatting
54    pub(crate) const SKIP: &str = "\x1b[33mSkip\x1b[0m";
55    pub(crate) const FINISH: &str = "\x1b[92mFinished\x1b[0m";
56    pub(crate) const UPDATED: &str = "\x1b[94mUpdated\x1b[0m";
57}