Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions src/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use std::{

use fuels::types::{param_types::ParamType, Token};
use serde::{Deserialize, Serialize};
use tracing::{debug, error, info, warn};
use tracing::{debug, info, warn};

use crate::{rustsdk::{self, RustSDK}, sampler::Sampler, sway::Sway, tssdk::Ts};
use crate::{rustsdk::RustSDK, sampler::Sampler, sway::Sway, tssdk::Ts};

pub struct Fuzzer {
sampler: Sampler,
Expand Down Expand Up @@ -72,7 +72,7 @@ impl Fuzzer {
decodings: Vec<bool>,
dir: String,
) {
if decodings.len() == 0 {
if decodings.is_empty() {
// No decodings generated
return;
}
Expand Down Expand Up @@ -163,7 +163,7 @@ impl Fuzzer {
self.check_decodings(&samples, reduced_sway_decodings, "sway".to_string());
self.check_decodings(&samples, ts_decodings, "ts".to_string());

if sway_encodings.len() == 0 || rust_encodings.len() == 0 || ts_encodings.len() == 0 {
if sway_encodings.is_empty() || rust_encodings.is_empty() || ts_encodings.is_empty() {
warn!("Failed to generate encodings for all 3 languages, please consult the output logs for more information.");
self.round += 1;
// NOTE maybe do binary search to find the failing ParamType/Token that compiles
Expand Down
5 changes: 2 additions & 3 deletions src/rustsdk.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use std::io::Write;
use std::{fs, process};
use std::fs;
use std::time::{SystemTime, UNIX_EPOCH};

use fuels::core::codec::{ABIDecoder, ABIEncoder};
use fuels::types::output;
use fuels::types::{param_types::ParamType, Token};
use tracing::{debug, info, warn};
use tracing::{debug, warn};

use crate::{error::ABIProbeError, Encoding};

Expand Down
6 changes: 3 additions & 3 deletions src/sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use fuels::types::{
StaticStringToken, Token, U256,
};
use rand::{rngs::StdRng, Rng, SeedableRng};
use tracing::{debug, info};
use tracing::debug;

const NUM_PRIMITIVE_TYPES: usize = 12;
const NUM_COMPOUND_TYPES: usize = 4;
Expand Down Expand Up @@ -208,7 +208,7 @@ impl Sampler {
let fields_names: Vec<String> = fields_types
.iter()
.enumerate()
.map(|(i, _param_type)| (format!("field{}", i + 1)))
.map(|(i, _param_type)| format!("field{}", i + 1))
.collect();
let fields: Vec<(String, ParamType)> = fields_names
.into_iter()
Expand All @@ -230,7 +230,7 @@ impl Sampler {
let enum_field_names: Vec<_> = enum_types
.iter()
.enumerate()
.map(|(i, _param_type)| (format!("Variant{}", i + 1)))
.map(|(i, _param_type)| format!("Variant{}", i + 1))
.collect();

let enum_fields = enum_field_names
Expand Down
2 changes: 1 addition & 1 deletion src/sway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use fuels::{
types::{param_types::ParamType, RawSlice, Token},
};
use tokio::runtime::Runtime;
use tracing::{info, debug, warn};
use tracing::{debug, warn};

const OUTPUT_PATH: &str = "./forc_project/src/main.sw";
const SWAY_COMPILATION_FAIL: &str = "Failed to compile";
Expand Down
2 changes: 1 addition & 1 deletion src/sway_converter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use fuels::types::{param_types::ParamType, Token};
use std::vec;
use tracing::{debug, info};
use tracing::debug;

pub struct SwayConverter {
vector_counter: usize,
Expand Down
2 changes: 1 addition & 1 deletion src/ts_converter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use fuels::types::{param_types::ParamType, Token};
use tracing::{debug, info};
use tracing::debug;

const CUSTOM_TYPES: &str = "{custom_types}";
const TESTCASES: &str = "{testcases}";
Expand Down
2 changes: 1 addition & 1 deletion src/tssdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
};

use fuels::types::{param_types::ParamType, Token};
use tracing::{debug, info, warn};
use tracing::{debug, warn};

use crate::{error::ABIProbeError, ts_converter::TSConverter, Encoding};

Expand Down