Skip to content

Commit

Permalink
chore(oracle): Rename "max delay" to "online timeout"
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-savu committed Mar 26, 2021
1 parent f75487d commit c52a2e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/parachain/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface OracleAPI {
*/
getLastExchangeRateTime(): Promise<Date>;
/**
* @returns A map from the oracle's account id to its
* @returns A map from the oracle's account id to its name
*/
getSourcesById(): Promise<Map<string, string>>;
/**
Expand Down Expand Up @@ -82,7 +82,7 @@ export interface OracleAPI {
* @returns The period of time (in milliseconds) after an oracle's last submission
* during which it is considered online
*/
getMaxDelay(): Promise<number>;
getOnlineTimeout(): Promise<number>;
}

export class DefaultOracleAPI implements OracleAPI {
Expand All @@ -103,7 +103,7 @@ export class DefaultOracleAPI implements OracleAPI {
return new Big(this.convertFromRawExchangeRate(rawRate.toString()));
}

async getMaxDelay(): Promise<number> {
async getOnlineTimeout(): Promise<number> {
const head = await this.api.rpc.chain.getFinalizedHead();
const moment = await this.api.query.exchangeRateOracle.maxDelay.at(head);
return moment.toNumber();
Expand Down
2 changes: 1 addition & 1 deletion test/mock/parachain/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Big from "big.js";
import { PolkaBTC } from "@interlay/polkabtc/interfaces";

export class MockOracleAPI implements OracleAPI {
getMaxDelay(): Promise<number> {
getOnlineTimeout(): Promise<number> {
return Promise.resolve(100);
}

Expand Down

0 comments on commit c52a2e0

Please sign in to comment.