fix: Curve SDK tests

- Don't care about token order when comparing. We did not care in the python package. Not sure there is any advantage to caring.
This commit is contained in:
TAMARA LIPOWSKI
2025-09-17 19:46:55 -04:00
committed by Tamara
parent 8ad709b07a
commit ca7998c5ce
2 changed files with 6 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};
use colored::Colorize;
use serde::{Deserialize, Serialize};
@@ -34,8 +34,10 @@ impl ProtocolComponentExpectation {
diffs.push(format!("Field 'id' mismatch for {}:\n{}", self.id, diff));
}
// Compare tokens
if self.tokens != other.tokens {
// Compare tokens (order-independent)
let self_tokens_set: HashSet<_> = self.tokens.iter().collect();
let other_tokens_set: HashSet<_> = other.tokens.iter().collect();
if self_tokens_set != other_tokens_set {
let self_tokens = format!("{:?}", self.tokens);
let other_tokens = format!("{:?}", other.tokens);
let diff = self.format_diff("tokens", &self_tokens, &other_tokens, colorize_output);

View File

@@ -1,4 +1,5 @@
substreams_yaml_path: ./substreams.yaml
protocol_system: "vm:curve"
protocol_type_names:
- "curve_pool"
adapter_contract: "CurveAdapter"