Skip to content

Commit

Permalink
Merge pull request #298 from TrueBlocks/develop
Browse files Browse the repository at this point in the history
Fixes broken build
  • Loading branch information
tjayrush authored Apr 13, 2023
2 parents 6c1a336 + 9a569ff commit 93a348c
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 33 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"react-syntax-highlighter": "^15.4.3",
"react-test-renderer": "^17.0.2",
"recharts": "^2.0.9",
"trueblocks-sdk": "^0.60.1",
"trueblocks-sdk": "^0.62.9",
"ts-morph": "^13.0.2"
}
}
7 changes: 4 additions & 3 deletions src/ui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import {
Chain,
Config, getConfig, getVersion, SuccessResponse,
Config, getStatus, getVersion, SuccessResponse,
} from 'trueblocks-sdk';

import { ChainSelect } from '@components/ChainSelect';
Expand Down Expand Up @@ -95,10 +95,11 @@ export const App = () => {

useEffect(() => {
const fetchStatus = async () => {
const statusResponse = wrapResponse(await getConfig({
modes: ['show'],
const statusResponse = wrapResponse(await getStatus({
modes: ["some"],
chain: chain.chain,
fmt: 'json',
verbose: true,
}));

if (isSuccessfulCall(statusResponse)) {
Expand Down
4 changes: 0 additions & 4 deletions src/ui/modules/types/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export function createEmptyStatus(): Config {
nFiles: 0,
nFolders: 0,
sizeInBytes: 0,
isValid: false,
},
{
items: [],
Expand All @@ -35,7 +34,6 @@ export function createEmptyStatus(): Config {
nFiles: 0,
nFolders: 0,
sizeInBytes: 0,
isValid: false,
},
{
items: [],
Expand All @@ -44,7 +42,6 @@ export function createEmptyStatus(): Config {
nFiles: 0,
nFolders: 0,
sizeInBytes: 0,
isValid: false,
},
{
items: [],
Expand All @@ -53,7 +50,6 @@ export function createEmptyStatus(): Config {
nFiles: 0,
nFolders: 0,
sizeInBytes: 0,
isValid: false,
},
],
chains: [],
Expand Down
9 changes: 4 additions & 5 deletions src/ui/views/Dashboard/Tabs/Monitors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { ColumnsType } from 'antd/lib/table';
import {
Chain, Config,
getConfig, Monitor,
getStatus, Monitor,
} from 'trueblocks-sdk';

import { ClickableAddress } from '@components/ClickableAddress';
Expand Down Expand Up @@ -40,11 +40,10 @@ export const Monitors = () => {
const [selectedNameTags] = useState('');
const [loadingEdit, setLoadingEdit] = useState(false);

const monitorsCall = useSdk(() => getConfig({
const monitorsCall = useSdk(() => getStatus({
chain: chain.chain,
modes: ['show'],
module: ['monitors'],
details: true,
modes: ['monitors'],
verbose: true,
}), undefined, []) as CallStatus<Config[]>;
if (isFailedCall(monitorsCall)) {
createErrorNotification({
Expand Down
15 changes: 7 additions & 8 deletions src/ui/views/Settings/Tabs/Indexes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useMemo } from 'react';

import { ColumnsType } from 'antd/lib/table';
import {
Config, getConfig, IndexCacheItem, PinnedChunk,
Config, getStatus, CacheRecordUp,
} from 'trueblocks-sdk';

import { BaseView } from '@components/BaseView';
Expand All @@ -27,11 +27,10 @@ import { IndexTable } from './SubTabs/IndexTable';

export const IndexesView = () => {
const { chain } = useGlobalState();
const statusCall = useSdk(() => getConfig({
const statusCall = useSdk(() => getStatus({
chain: chain.chain,
modes: ['show'],
module: ['index'],
details: true,
modes: ['index'],
verbose: true,
}));

const theGridData = useMemo(() => {
Expand All @@ -43,7 +42,7 @@ export const IndexesView = () => {
return statusCall.data;
}
return [createEmptyStatus()];
}, [statusCall]) as any as IndexCacheItem[];
}, [statusCall]) as any as CacheRecordUp[];

useEffect(() => {
if (isFailedCall(statusCall)) {
Expand Down Expand Up @@ -88,7 +87,7 @@ function padLeft(num: number, size: number, char: string = '0') {
return s;
}

const renderBlockRange = (record: PinnedChunk) => (
const renderBlockRange = (record: CacheRecordUp) => (
<div>
<div>
{padLeft(record.firstApp, 9)}
Expand All @@ -103,7 +102,7 @@ const renderBlockRange = (record: PinnedChunk) => (
</div>
);

export const indexSchema: ColumnsType<PinnedChunk> = [
export const indexSchema: ColumnsType<CacheRecordUp> = [
addColumn({
title: 'Block Range',
dataIndex: 'firstApp',
Expand Down
14 changes: 7 additions & 7 deletions src/ui/views/Settings/Tabs/SubTabs/IndexGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React, { useEffect, useState } from 'react';
import { createUseStyles } from 'react-jss';

import cx from 'classnames';
import { IndexCacheItem } from 'trueblocks-sdk';
import { CacheRecordUp } from 'trueblocks-sdk';

export const IndexGrid = ({
theData,
title,
loading,
}: {
theData: IndexCacheItem[];
theData: CacheRecordUp[];
title: string | JSX.Element,
loading: boolean
}) => (
Expand All @@ -28,7 +28,7 @@ const cols = Array(10)
export const GridTable = ({
data,
}: {
data: IndexCacheItem[];
data: CacheRecordUp[];
}) => {
const [selected, setSelected] = useState(localStorage.getItem('grid-select') || '');
// TODO(tjayrush): This needs to pick up the actual last indexed block
Expand Down Expand Up @@ -142,7 +142,7 @@ export const DetailTable = ({
cellStart,
cellSpan,
}: {
data: IndexCacheItem[];
data: CacheRecordUp[];
cellStart: any;
cellSpan: any;
}) => {
Expand Down Expand Up @@ -171,7 +171,7 @@ export const DetailTable = ({
}

const range = { start: cellStart, end: cellStart + cellSpan };
const filteredData = data.filter((item: IndexCacheItem) => item.firstApp >= range.start && item.firstApp < range.end);
const filteredData = data.filter((item: CacheRecordUp) => item.firstApp >= range.start && item.firstApp < range.end);
if (filteredData.length > 200 || cellSpan > 100000) {
return (
<div
Expand Down Expand Up @@ -232,10 +232,10 @@ export const DetailTable = ({
gridGap: '4px',
}}
>
{filteredData.map((record: IndexCacheItem) => (
{filteredData.map((record: CacheRecordUp) => (
<div key={record.firstApp} style={{ padding: '2px', border: '1px solid grey' }}>
<div style={{ fontWeight: 600, backgroundColor: 'lightgrey' }}>
{record.filename.replace(/.bin/, '')}
{record.filename.replace(/^.*[\\\/]/, '').replace(/.bin/, '')}
</div>
{details.map((field) => {
let val = <></>;
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13663,7 +13663,7 @@ resolve@^2.0.0-next.3:
react-test-renderer: ^17.0.2
recharts: ^2.0.9
style-loader: ^2.0.0
trueblocks-sdk: ^0.60.1
trueblocks-sdk: ^0.62.9
ts-jest: ^26.5.3
ts-loader: ^8.0.18
ts-morph: ^13.0.2
Expand All @@ -13674,13 +13674,13 @@ resolve@^2.0.0-next.3:
languageName: unknown
linkType: soft

"trueblocks-sdk@npm:^0.60.1":
version: 0.60.1
resolution: "trueblocks-sdk@npm:0.60.1"
"trueblocks-sdk@npm:^0.62.9":
version: 0.62.9
resolution: "trueblocks-sdk@npm:0.62.9"
dependencies:
typescript: ^4.9.4
vitest: ^0.29.2
checksum: cc3f0f969baf1cbe68285156db83dc1e11f28d72fe62c2d686b77f7a0e4bc62b4a74c789d69e2e5479a20d439e80e7bedca8ee9f1fdb3e5f162012834fe990bf
checksum: a5201074c9940b9742c39f8d29ecbf25ec0a5d85d5d9f9b85b106c3da02271f5ca1a0776157795c744f54da616c8adf1cbfdc18f4e0f5b1e13f664014553cc1a
languageName: node
linkType: hard

Expand Down

0 comments on commit 93a348c

Please sign in to comment.