feat(curve): add coins in static attributes (#205)
* feat(curve): add coins in static attributes This will be used by tycho-execution when executing swaps on the pool. It is needed because the `exchange` function takes token indexes and not addresses as input. * style: make clippy happy with `format!` --------- Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
This commit is contained in:
@@ -4,7 +4,7 @@ use std::{collections::HashMap, iter::zip};
|
||||
use substreams_ethereum::pb::eth::v2::TransactionTrace;
|
||||
use tycho_substreams::prelude::*;
|
||||
|
||||
const PARAMS_SEPERATOR: &str = ",";
|
||||
const PARAMS_SEPERATOR: &str = "#";
|
||||
|
||||
#[derive(Debug, Deserialize, PartialEq)]
|
||||
struct PoolQueryParams {
|
||||
@@ -127,7 +127,7 @@ fn parse_params(params: &str) -> Result<HashMap<String, PoolQueryParams>, anyhow
|
||||
.split(PARAMS_SEPERATOR)
|
||||
.map(|param| {
|
||||
let pool: PoolQueryParams = serde_qs::from_str(param)
|
||||
.with_context(|| format!("Failed to parse pool query params: {0}", param))?;
|
||||
.with_context(|| format!("Failed to parse pool query params: {param}"))?;
|
||||
Ok((pool.tx_hash.clone(), pool))
|
||||
})
|
||||
.collect::<Result<HashMap<_, _>>>()
|
||||
|
||||
Reference in New Issue
Block a user