Skip to content

Commit

Permalink
(fix) syntax and docs comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-valerio committed Oct 30, 2024
1 parent 25b06b6 commit 7716885
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/instrumenter/seedgen/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl SeedExtractInjector {
let name = format!("seedgen_{i}");
writer.write_seed(name.as_str(), bytes)?;
if self.verbose() {
let path = format!("{pfile}/phink/corpus/{name}.bin")
let path = format!("{pfile}/phink/corpus/{name}.bin");
println!("Writing bytes 0x{} to `{path}`", hex::encode(bytes));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/instrumenter/traits/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub trait ContractVisitor {
))?;
phink_log!(self, "🏗️ {output_p:?} already exists... so we've erased it");
}

fs::create_dir_all(output_p.clone())
.with_context(|| format!("🙅 Failed to create directory: {output_p:?}"))?;

Expand Down
13 changes: 7 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ pub mod cover;
pub mod fuzzer;
pub mod instrumenter;

/// This type is used to handle all the different errors on Phink. It's a simple biding to anyhow.
/// This type is used to handle all the different errors on Phink. It's a simple binding to
/// `anyhow`.
pub type EmptyResult = anyhow::Result<()>;
pub type ResultOf<T> = anyhow::Result<T>;

Expand Down Expand Up @@ -75,24 +76,24 @@ enum Commands {
/// Starts the fuzzing campaign. Instrumentation required before!
Fuzz,
/// Run the tests of the ink! smart-contract to execute the
/// messages and extracts valid seeds fromit. For instance, if a test call three messages,
/// messages and extracts valid seeds from it. For instance, if a test call three messages,
/// those three messages will be extracted to be used as seeds inside the corpus directory
GenerateSeed {
/// Path where the contract is located. It must be the root directory of
/// the contract
contract: PathBuf,
/// Path where the temporary contract will be compiled to. Optionnal. In `tmp` if not
/// defined.
/// Path where the temporary contract will be compiled to. Optionnal field, set to `tmp` if
/// not defined (or somewhere else, depending your OS)
compiled_directory: Option<PathBuf>,
},
/// Instrument the ink! contract, and compile it with Phink features
Instrument(Contract),
/// Run all the seeds
/// Run all the seeds from `corpus/`
Run,
/// Generate a coverage report, only of the harness. You won't have your contract coverage here
/// (mainly for debugging purposes only)
HarnessCover,
/// Generate a coverage report for your smart-contract
/// Generate a coverage report for your ink! smart-contract
Coverage(Contract),
/// Execute one seed
Execute {
Expand Down

0 comments on commit 7716885

Please sign in to comment.