This reverts commit f29de67f1f.
This commit is contained in:
@@ -30,7 +30,7 @@ pub fn store_pools(pools_created: BlockChanges, store: StoreSetIfNotExistsProto<
|
||||
)
|
||||
.to_u64(),
|
||||
};
|
||||
store.set_if_not_exists(0, format!("Pool:{pool_address}"), &pool);
|
||||
store.set_if_not_exists(0, format!("{}:{}", "Pool", pool_address), &pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ pub fn map_events(
|
||||
.logs
|
||||
.iter()
|
||||
.filter_map(|log| {
|
||||
let key = format!("Pool:{address}", address = log.address.to_hex());
|
||||
let key = format!("{}:{}", "Pool", log.address.to_hex());
|
||||
// Skip if the log is not from a known pool.
|
||||
if let Some(pool) = pools_store.get_last(key) {
|
||||
log_to_event(log, pool, &tx)
|
||||
|
||||
@@ -29,7 +29,7 @@ pub fn store_pools_balances(balances_deltas: BlockBalanceDeltas, store: StoreAdd
|
||||
}
|
||||
|
||||
fn event_to_balance_deltas(event: PoolEvent) -> Vec<BalanceDelta> {
|
||||
let address = format!("0x{addr}", addr = event.pool_address)
|
||||
let address = format!("0x{}", event.pool_address)
|
||||
.as_bytes()
|
||||
.to_vec();
|
||||
match event.r#type.unwrap() {
|
||||
|
||||
@@ -20,7 +20,7 @@ pub fn store_pool_current_tick(events: Events, store: StoreSetInt64) {
|
||||
.into_iter()
|
||||
.filter_map(event_to_current_tick)
|
||||
.for_each(|(pool, ordinal, new_tick_index)| {
|
||||
store.set(ordinal, format!("pool:{pool}"), &new_tick_index.into())
|
||||
store.set(ordinal, format!("pool:{0}", pool), &new_tick_index.into())
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ pub fn map_liquidity_changes(
|
||||
.map(|e| {
|
||||
(
|
||||
pools_current_tick_store
|
||||
.get_at(e.log_ordinal, format!("pool:{pool_addr}", pool_addr = &e.pool_address))
|
||||
.get_at(e.log_ordinal, format!("pool:{0}", &e.pool_address))
|
||||
.unwrap_or(0),
|
||||
e,
|
||||
)
|
||||
@@ -57,14 +57,14 @@ pub fn store_liquidity(ticks_deltas: LiquidityChanges, store: StoreSetSumBigInt)
|
||||
LiquidityChangeType::Delta => {
|
||||
store.sum(
|
||||
changes.ordinal,
|
||||
format!("pool:{addr}", addr = hex::encode(&changes.pool_address)),
|
||||
format!("pool:{0}", hex::encode(&changes.pool_address)),
|
||||
BigInt::from_signed_bytes_be(&changes.value),
|
||||
);
|
||||
}
|
||||
LiquidityChangeType::Absolute => {
|
||||
store.set(
|
||||
changes.ordinal,
|
||||
format!("pool:{addr}", addr = hex::encode(&changes.pool_address)),
|
||||
format!("pool:{0}", hex::encode(&changes.pool_address)),
|
||||
BigInt::from_signed_bytes_be(&changes.value),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,11 +34,7 @@ pub fn store_ticks_liquidity(ticks_deltas: TickDeltas, store: StoreAddBigInt) {
|
||||
deltas.iter().for_each(|delta| {
|
||||
store.add(
|
||||
delta.ordinal,
|
||||
format!(
|
||||
"pool:{addr}:tick:{index}",
|
||||
addr = hex::encode(&delta.pool_address),
|
||||
index = delta.tick_index,
|
||||
),
|
||||
format!("pool:{0}:tick:{1}", hex::encode(&delta.pool_address), delta.tick_index,),
|
||||
BigInt::from_signed_bytes_be(&delta.liquidity_net_delta),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -86,8 +86,7 @@ pub fn map_protocol_changes(
|
||||
BigInt::from_str(&String::from_utf8(store_delta.old_value).unwrap())
|
||||
.unwrap()
|
||||
.is_zero();
|
||||
let attribute_name =
|
||||
format!("ticks/{index}/net-liquidity", index = tick_delta.tick_index);
|
||||
let attribute_name = format!("ticks/{}/net-liquidity", tick_delta.tick_index);
|
||||
let attribute = Attribute {
|
||||
name: attribute_name,
|
||||
value: new_value_bigint.to_signed_bytes_be(),
|
||||
|
||||
Reference in New Issue
Block a user