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:
@@ -1,4 +1,4 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::{HashMap, HashSet};
|
||||||
|
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@@ -34,8 +34,10 @@ impl ProtocolComponentExpectation {
|
|||||||
diffs.push(format!("Field 'id' mismatch for {}:\n{}", self.id, diff));
|
diffs.push(format!("Field 'id' mismatch for {}:\n{}", self.id, diff));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compare tokens
|
// Compare tokens (order-independent)
|
||||||
if self.tokens != other.tokens {
|
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 self_tokens = format!("{:?}", self.tokens);
|
||||||
let other_tokens = format!("{:?}", other.tokens);
|
let other_tokens = format!("{:?}", other.tokens);
|
||||||
let diff = self.format_diff("tokens", &self_tokens, &other_tokens, colorize_output);
|
let diff = self.format_diff("tokens", &self_tokens, &other_tokens, colorize_output);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
substreams_yaml_path: ./substreams.yaml
|
substreams_yaml_path: ./substreams.yaml
|
||||||
|
protocol_system: "vm:curve"
|
||||||
protocol_type_names:
|
protocol_type_names:
|
||||||
- "curve_pool"
|
- "curve_pool"
|
||||||
adapter_contract: "CurveAdapter"
|
adapter_contract: "CurveAdapter"
|
||||||
|
|||||||
Reference in New Issue
Block a user