fix fallback oracle assignment (#977)

This commit is contained in:
Maximilian Schneider 2024-06-27 22:45:03 +01:00 committed by GitHub
parent 7843aaa37f
commit 3162920d8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -5312,10 +5312,11 @@ export class MangoClient {
// fixed // fixed
if (typeof this.fallbackOracleConfig !== 'string') { if (typeof this.fallbackOracleConfig !== 'string') {
if (this.fixedFallbacks.size === 0) { if (this.fixedFallbacks.size === 0) {
const oracles: PublicKey[] = this.fallbackOracleConfig; const oracles: PublicKey[] = [];
const fallbacks: PublicKey[] = []; const fallbacks: PublicKey[] = [];
Array.from(group.banksMapByTokenIndex.values()).forEach((b) => { Array.from(group.banksMapByTokenIndex.values()).forEach((b) => {
if (oracles.find((o) => o.toBase58() === b[0].oracle.toBase58())) { if ((this.fallbackOracleConfig as PublicKey[]).find((o) => o.toBase58() === b[0].oracle.toBase58())) {
oracles.push(b[0].oracle);
fallbacks.push(b[0].fallbackOracle); fallbacks.push(b[0].fallbackOracle);
} }
}); });