chore: update format! macro use to satisfy latest clippy version (#194)
This commit is contained in:
@@ -18,7 +18,7 @@ pub fn store_pools(pools_created: BlockEntityChanges, store: StoreSetIfNotExists
|
||||
currency1: component_change.tokens[1].clone(),
|
||||
created_tx_hash: change.tx.as_ref().unwrap().hash.clone(),
|
||||
};
|
||||
store.set_if_not_exists(0, format!("{}:{}", "pool", pool_address), &pool);
|
||||
store.set_if_not_exists(0, format!("pool:{pool_address}"), &pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ fn log_to_event(
|
||||
// We need to track initialization again to keep track of pool current tick, which is set on
|
||||
// initialization and changed on swaps.
|
||||
let pool_id = init.id.to_vec().to_hex();
|
||||
let pool = pools_store.get_last(format!("{}:{}", "pool", &pool_id))?;
|
||||
let pool = pools_store.get_last(format!("pool:{pool_id}"))?;
|
||||
Some(PoolEvent {
|
||||
log_ordinal: event.ordinal,
|
||||
pool_id,
|
||||
@@ -67,7 +67,7 @@ fn log_to_event(
|
||||
})
|
||||
} else if let Some(swap) = Swap::match_and_decode(event) {
|
||||
let pool_id = swap.id.to_vec().to_hex();
|
||||
let pool = pools_store.get_last(format!("{}:{}", "pool", &pool_id))?;
|
||||
let pool = pools_store.get_last(format!("pool:{pool_id}"))?;
|
||||
Some(PoolEvent {
|
||||
log_ordinal: event.ordinal,
|
||||
pool_id,
|
||||
@@ -102,7 +102,7 @@ fn log_to_event(
|
||||
// })
|
||||
} else if let Some(modify_liquidity) = ModifyLiquidity::match_and_decode(event) {
|
||||
let pool_id = modify_liquidity.id.to_vec().to_hex();
|
||||
let pool = pools_store.get_last(format!("{}:{}", "pool", &pool_id))?;
|
||||
let pool = pools_store.get_last(format!("pool:{pool_id}"))?;
|
||||
Some(PoolEvent {
|
||||
log_ordinal: event.ordinal,
|
||||
pool_id,
|
||||
@@ -124,7 +124,7 @@ fn log_to_event(
|
||||
.id
|
||||
.to_vec()
|
||||
.to_hex();
|
||||
let pool = pools_store.get_last(format!("{}:{}", "pool", &pool_id))?;
|
||||
let pool = pools_store.get_last(format!("pool:{pool_id}"))?;
|
||||
Some(PoolEvent {
|
||||
log_ordinal: event.ordinal,
|
||||
pool_id: pool_id.clone(),
|
||||
|
||||
@@ -17,7 +17,7 @@ pub fn store_pool_current_sqrt_price(events: Events, store: StoreSetBigInt) {
|
||||
.into_iter()
|
||||
.filter_map(event_to_current_sqrt_price)
|
||||
.for_each(|(pool, ordinal, new_tick_index)| {
|
||||
store.set(ordinal, format!("pool:{0}", pool), &new_tick_index)
|
||||
store.set(ordinal, format!("pool:{pool}"), &new_tick_index)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,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:{0}", pool), &new_tick_index.into())
|
||||
store.set(ordinal, format!("pool:{pool}"), &new_tick_index.into())
|
||||
});
|
||||
}
|
||||
fn event_to_current_tick(event: PoolEvent) -> Option<(String, u64, i32)> {
|
||||
|
||||
Reference in New Issue
Block a user