Skip to content

Commit

Permalink
fix(app): after updrage fixes (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
happylolonly authored Oct 8, 2024
1 parent 7f14a7b commit abd1e40
Show file tree
Hide file tree
Showing 11 changed files with 11,476 additions and 5,466 deletions.
6 changes: 0 additions & 6 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
# RPC_URL=https://rpc.bostrom.moon.cybernode.ai
# LCD_URL=https://lcd.bostrom.moon.cybernode.ai
# WEBSOCKET_URL=wss://rpc.bostrom.moon.cybernode.ai/websocket
# INDEX_HTTPS=https://index.bostrom.moon.cybernode.ai/v1/graphql
# INDEX_WEBSOCKET = wss://index.bostrom.moon.cybernode.ai/v1/graphql
# CHAIN_ID = localbostrom
4 changes: 1 addition & 3 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { CodegenConfig } from '@graphql-codegen/cli';
// require('dotenv').config();
// TODO: need to use config variables somehow

const schemaUrl = 'https://index.bostrom.moon.cybernode.ai/v1/graphql'; // process.env.NEXT_PUBLIC_GRAPHQL_HOST;

console.log('url', schemaUrl);
const schemaUrl = 'https://index.bostrom.cybernode.ai/v1/graphql'; // process.env.NEXT_PUBLIC_GRAPHQL_HOST;

const config: CodegenConfig = {
overwrite: true,
Expand Down
2 changes: 0 additions & 2 deletions src/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const DEFAULT_CHAIN_ID: Networks.BOSTROM | Networks.SPACE_PUSSY =

export const CHAIN_ID = DEFAULT_CHAIN_ID;

console.log('CHAIN_ID', CHAIN_ID);

export const LCD_URL =
process.env.LCD_URL || defaultNetworks[DEFAULT_CHAIN_ID].LCD_URL;

Expand Down
7 changes: 7 additions & 0 deletions src/constants/defaultNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ const defaultNetworks: NetworksList = {
// BECH32_PREFIX: 'bostrom',
// MEMO_KEPLR: '[bostrom] cyb.ai, using keplr',
// },
// RPC_URL=https://rpc.bostrom.moon.cybernode.ai
// LCD_URL=https://lcd.bostrom.moon.cybernode.ai
// WEBSOCKET_URL=wss://rpc.bostrom.moon.cybernode.ai/websocket
// INDEX_HTTPS=https://index.bostrom.moon.cybernode.ai/v1/graphql
// INDEX_WEBSOCKET = wss://index.bostrom.moon.cybernode.ai/v1/graphql
// CHAIN_ID = localbostrom

'space-pussy': {
CHAIN_ID: Networks.SPACE_PUSSY,
BASE_DENOM: 'pussy',
Expand Down
46 changes: 21 additions & 25 deletions src/containers/validator/UptimeHook.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
// import { useUptimeByAddressQuery } from 'src/generated/graphql';
// import { INFINITY } from 'src/constants/app';
// import BigNumber from 'bignumber.js';
// import { Dots } from '../../components';
// import { consensusPubkey } from '../../utils/utils';
import { useUptimeByAddressQuery } from 'src/generated/graphql';
import { INFINITY } from 'src/constants/app';
import BigNumber from 'bignumber.js';
import { Dots } from '../../components';
import { consensusPubkey } from '../../utils/utils';

// function useUptime({ consensusPub }: { consensusPub: string }) {
// const { loading, data, error } = useUptimeByAddressQuery({
// variables: {
// address: `${consensusPubkey(consensusPub)}`,
// },
// });

// if (loading) {
// return <Dots />;
// }
function useUptime({ consensusPub }: { consensusPub: string }) {
const { loading, data, error } = useUptimeByAddressQuery({
variables: {
address: `${consensusPubkey(consensusPub)}`,
},
});

// if (error) {
// return INFINITY;
// }
if (loading) {
return <Dots />;
}

// return `${new BigNumber(data?.uptime[0].uptime || 0)
// .shiftedBy(2)
// .dp(2, BigNumber.ROUND_FLOOR)
// .toString()} %`;
// }
if (error) {
return INFINITY;
}

function useUptime({ consensusPub }: { consensusPub: string }) {
return '';
return `${new BigNumber(data?.uptime[0].uptime || 0)
.shiftedBy(2)
.dp(2, BigNumber.ROUND_FLOOR)
.toString()} %`;
}

export default useUptime;
1 change: 1 addition & 0 deletions src/features/staking/delegation/useDelegation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function useDelegationFunc(...[delegatorAddress, validatorAddress]: Params) {
};
}

// TODO: add skip somewhere
function useDelegation(validatorAddress: string) {
const address = useAppSelector(selectCurrentAddress);

Expand Down
Loading

0 comments on commit abd1e40

Please sign in to comment.