From c52a2e0bb71896b23f434f0728f3073727d3b34e Mon Sep 17 00:00:00 2001 From: Daniel Savu Date: Fri, 26 Mar 2021 16:10:06 +0000 Subject: [PATCH] chore(oracle): Rename "max delay" to "online timeout" --- src/parachain/oracle.ts | 6 +++--- test/mock/parachain/oracle.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parachain/oracle.ts b/src/parachain/oracle.ts index 5203446bc..890d8982c 100644 --- a/src/parachain/oracle.ts +++ b/src/parachain/oracle.ts @@ -46,7 +46,7 @@ export interface OracleAPI { */ getLastExchangeRateTime(): Promise; /** - * @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>; /** @@ -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; + getOnlineTimeout(): Promise; } export class DefaultOracleAPI implements OracleAPI { @@ -103,7 +103,7 @@ export class DefaultOracleAPI implements OracleAPI { return new Big(this.convertFromRawExchangeRate(rawRate.toString())); } - async getMaxDelay(): Promise { + async getOnlineTimeout(): Promise { const head = await this.api.rpc.chain.getFinalizedHead(); const moment = await this.api.query.exchangeRateOracle.maxDelay.at(head); return moment.toNumber(); diff --git a/test/mock/parachain/oracle.ts b/test/mock/parachain/oracle.ts index 8b0d210b2..5a9d19901 100644 --- a/test/mock/parachain/oracle.ts +++ b/test/mock/parachain/oracle.ts @@ -5,7 +5,7 @@ import Big from "big.js"; import { PolkaBTC } from "@interlay/polkabtc/interfaces"; export class MockOracleAPI implements OracleAPI { - getMaxDelay(): Promise { + getOnlineTimeout(): Promise { return Promise.resolve(100); }