test: Refactor tests

- Move encoding integration tests to integration test folder (in the rust project)
- Move protocol integration tests be inside the protocol file. This way we can change the block without any problems and it is easier for integrators

Took 6 minutes

Took 6 minutes


Took 17 minutes
This commit is contained in:
Diana Carvalho
2025-06-23 12:51:48 +01:00
parent 920b37cf96
commit e09789f347
25 changed files with 2377 additions and 2719 deletions

View File

@@ -19,12 +19,12 @@ pub struct SwapEncoderRegistry {
impl SwapEncoderRegistry {
/// Populates the registry with the `SwapEncoders` for the given blockchain by parsing the
/// executors' addresses in the file at the given path.
/// protocols' addresses in the file at the given path.
pub fn new(executors_file_path: Option<String>, chain: Chain) -> Result<Self, EncodingError> {
let config_str = if let Some(ref path) = executors_file_path {
fs::read_to_string(path).map_err(|e| {
EncodingError::FatalError(format!(
"Error reading executors file from {executors_file_path:?}: {e}",
"Error reading protocols file from {executors_file_path:?}: {e}",
))
})?
} else {
@@ -33,7 +33,7 @@ impl SwapEncoderRegistry {
let config: HashMap<String, HashMap<String, String>> = serde_json::from_str(&config_str)?;
let executors = config
.get(&chain.name)
.ok_or(EncodingError::FatalError("No executors found for chain".to_string()))?;
.ok_or(EncodingError::FatalError("No protocols found for chain".to_string()))?;
let protocol_specific_config: HashMap<String, HashMap<String, HashMap<String, String>>> =
serde_json::from_str(PROTOCOL_SPECIFIC_CONFIG)?;

File diff suppressed because it is too large Load Diff