feat(curve): Get coin indexes from static attributes

This way we don't need extra RPC calls to get these values

Took 57 minutes
This commit is contained in:
Diana Carvalho
2025-05-19 13:29:18 +01:00
parent ae4602f668
commit fcaacf21fb
5 changed files with 81 additions and 115 deletions

View File

@@ -1562,6 +1562,11 @@ mod tests {
.to_vec(),
),
);
attrs.insert(
"coins".into(),
Bytes::from_str("0x5b22307864616331376639353864326565353233613232303632303639393435393763313364383331656337222c22307832323630666163356535353432613737336161343466626366656466376331393362633263353939222c22307863303261616133396232323366653864306130653563346632376561643930383363373536636332225d")
.unwrap(),
);
attrs
},
..Default::default()
@@ -1726,6 +1731,11 @@ mod tests {
.to_vec(),
),
);
attrs.insert(
"coins".into(),
Bytes::from_str("0x5b22307864616331376639353864326565353233613232303632303639393435393763313364383331656337222c22307832323630666163356535353432613737336161343466626366656466376331393362633263353939222c22307863303261616133396232323366653864306130653563346632376561643930383363373536636332225d")
.unwrap(),
);
attrs
},
..Default::default()
@@ -2651,8 +2661,9 @@ mod tests {
"0x98ee851a00abee0d95d08cf4ca2bdce32aeaaf7f"
.as_bytes()
.to_vec(),
),
)]);
)),
("coins".to_string(), Bytes::from_str("0x5b22307863303261616133396232323366653864306130653563346632376561643930383363373536636332222c22307835356330386361353234393765326631353334623539653239313762663532346434373635323537225d").unwrap()),
]);
let component = ProtocolComponent {
id: String::from("0x77146B0a1d08B6844376dF6d9da99bA7F1b19e71"),
@@ -2715,7 +2726,8 @@ mod tests {
.as_bytes()
.to_vec(),
),
)]);
),
("coins".to_string(), Bytes::from_str("0x5b22307865656565656565656565656565656565656565656565656565656565656565656565656565656565222c22307861653761623936353230646533613138653565313131623565616162303935333132643766653834225d").unwrap()),]);
let component = ProtocolComponent {
id: String::from("0xDC24316b9AE028F1497c275EB9192a3Ea0f67022"),