Liquidator: more pyth -> oracles renames

This commit is contained in:
Christian Kamm 2022-08-10 09:32:46 +02:00
parent 405c41edcf
commit b52aad82e1
1 changed files with 4 additions and 5 deletions

View File

@ -99,10 +99,9 @@ async fn feed_data(
Some(all_accounts_config.clone()),
)
.map_err_anyhow()?;
// TODO: mango_pyth_oracles should not contain stub mango_pyth_oracles, since they already sub'ed with mango_sub
let mut mango_pyth_oracles_sub_map = StreamMap::new();
let mut mango_oracles_sub_map = StreamMap::new();
for oracle in mango_oracles.into_iter() {
mango_pyth_oracles_sub_map.insert(
mango_oracles_sub_map.insert(
oracle,
client
.account_subscribe(
@ -136,13 +135,13 @@ async fn feed_data(
return Ok(());
}
},
message = mango_pyth_oracles_sub_map.next() => {
message = mango_oracles_sub_map.next() => {
if let Some(data) = message {
let response = data.1.map_err_anyhow()?;
let response = solana_client::rpc_response::Response{ context: RpcResponseContext{ slot: response.context.slot, api_version: None }, value: RpcKeyedAccount{ pubkey: data.0.to_string(), account: response.value} } ;
sender.send(Message::Account(AccountUpdate::from_rpc(response)?)).await.expect("sending must succeed");
} else {
warn!("pyth stream closed");
warn!("oracle stream closed");
return Ok(());
}
},