Skip to content

Commit

Permalink
fix(status-page): use ttko from env
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysuzx committed Jun 15, 2023
1 parent 9b6aa6e commit 9481f66
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/status-page/src/utils/buildStatusIndicators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import { getQueuedTransactions } from "./getQueuedTransactions";
import type { initConfig } from "./initConfig";
import { watchHeaderSynced } from "./watchHeaderSynced";
import axios from "axios";
import { getConfig } from "./getConfig";
import { getStateVariables } from "./getStateVariables";
import TaikoL2 from "../constants/abi/TaikoL2";

export async function buildStatusIndicators(
config: ReturnType<typeof initConfig>,
Expand Down Expand Up @@ -296,7 +294,9 @@ export async function buildStatusIndicators(
provider
);
const fee = await contract.getBlockFee();
return `${ethers.utils.formatUnits(fee, decimals)} TKO`;
return `${ethers.utils.formatUnits(fee, decimals)} ${
config.feeTokenSymbol
}`;
},
watchStatusFunc: null,
provider: config.l1Provider,
Expand Down Expand Up @@ -328,7 +328,7 @@ export async function buildStatusIndicators(
);

if (!events || events.length === 0) {
return `0 TKO`;
return `0 ${config.feeTokenSymbol}`;
}

const event = events[events.length - 1].args as any as {
Expand All @@ -338,7 +338,7 @@ export async function buildStatusIndicators(
return `${ethers.utils.formatUnits(
event.reward.toString(),
decimals
)} TKO`;
)} ${config.feeTokenSymbol}`;
},
watchStatusFunc: async (
provider: ethers.providers.JsonRpcProvider,
Expand All @@ -348,7 +348,9 @@ export async function buildStatusIndicators(
const contract = new Contract(address, TaikoL1, provider);
const listener = (id, blockHash, reward, ...args) => {
onEvent(
`${ethers.utils.formatUnits(reward.toString(), decimals)} TKO`
`${ethers.utils.formatUnits(reward.toString(), decimals)} ${
config.feeTokenSymbol
}`
);
};
contract.on("BlockVerified", listener);
Expand Down Expand Up @@ -497,7 +499,7 @@ export async function buildStatusIndicators(
return `${ethers.utils.formatUnits(
resp.data.averageProofReward,
decimals
)} TKO`;
)} ${config.feeTokenSymbol}`;
},
colorFunc: function (status: Status) {
return "green";
Expand Down

0 comments on commit 9481f66

Please sign in to comment.