Skip to content

Commit

Permalink
Merge pull request #151 from TrueBlocks/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tjayrush authored Nov 28, 2024
2 parents d387ed0 + 9f89d0c commit 4bad0e8
Show file tree
Hide file tree
Showing 39 changed files with 406 additions and 1,254 deletions.
5 changes: 2 additions & 3 deletions app/app_getters.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/TrueBlocks/trueblocks-browse/pkg/types"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
coreTypes "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
)

func (a *App) IsShowing(which string) bool {
Expand Down Expand Up @@ -73,11 +72,11 @@ func (a *App) GetChains() []string {
return ret
}

func (a *App) GetChainInfo(chain string) coreTypes.Chain {
func (a *App) GetChainInfo(chain string) types.Chain {
for _, ch := range a.status.Chains {
if ch.Chain == chain {
return ch
}
}
return coreTypes.Chain{}
return types.Chain{}
}
1 change: 0 additions & 1 deletion app/proc_daemons.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func (a *App) getDaemon(name string) types.Daemoner {
case "ipfs":
return a.daemons.IpfsController
default:
// logger.Fatal("getDaemon", "should not happen", name)
return &types.Daemon{}
}
}
5 changes: 1 addition & 4 deletions app/wizard.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package app
import (
"github.com/TrueBlocks/trueblocks-browse/pkg/messages"
"github.com/TrueBlocks/trueblocks-browse/pkg/types"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/logger"
)

func (a *App) isConfigured() bool {
Expand Down Expand Up @@ -49,7 +48,7 @@ func (a *App) StepWizard(step types.WizStep) types.WizState {
a.Navigate("/", "")
}
a.emitMsg(messages.Refresh, &messages.MessageMsg{
State: string(a.wizard.State),
State: a.wizard.State.String(),
Num1: 2, // 2 is the wizard step if needed
})
}()
Expand Down Expand Up @@ -79,8 +78,6 @@ func (a *App) StepWizard(step types.WizStep) types.WizState {
}

a.saveSession()
logger.InfoBB("Wizard state:", a.wizard.State)

return a.wizard.State
}

Expand Down
26 changes: 13 additions & 13 deletions code_gen/generated/codebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 9
},
Expand Down Expand Up @@ -137,7 +137,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 9
},
Expand Down Expand Up @@ -209,7 +209,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 8
},
Expand Down Expand Up @@ -298,7 +298,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 11
},
Expand Down Expand Up @@ -359,7 +359,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 6
},
Expand Down Expand Up @@ -401,7 +401,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 3
},
Expand Down Expand Up @@ -461,7 +461,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 6
},
Expand Down Expand Up @@ -515,7 +515,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 5
},
Expand Down Expand Up @@ -549,7 +549,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 2
},
Expand Down Expand Up @@ -590,7 +590,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 3
},
Expand Down Expand Up @@ -631,7 +631,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 3
},
Expand Down Expand Up @@ -679,7 +679,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 4
},
Expand Down Expand Up @@ -714,7 +714,7 @@
},
{
"name": "updater",
"type": "updater.Updater",
"type": "sdk.Updater",
"description": "jim",
"num": 2
},
Expand Down
18 changes: 9 additions & 9 deletions code_gen/templates/classDefinitions/fields/abi.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
abi ,types.Abi , ,embed , , ,jim
largestFile ,string , , , , ,jim
mostFunctions ,string , , , , ,jim
mostEvents ,string , , , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
items ,[]types.Abi , , , , ,jim
nItems ,uint64 , , , , ,jim
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
abi ,types.Abi , ,embed , , ,jim
largestFile ,string , , , , ,jim
mostFunctions ,string , , , , ,jim
mostEvents ,string , , , , ,jim
chain ,string , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.Abi , , , , ,jim
nItems ,uint64 , , , , ,jim
14 changes: 7 additions & 7 deletions code_gen/templates/classDefinitions/fields/config.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
config ,types.Config , ,embed , , ,jim
nChains ,uint64 , , , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
items ,[]types.Chain , , , , ,jim
nItems ,uint64 , , , , ,jim
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
config ,types.Config , ,embed , , ,jim
nChains ,uint64 , , , , ,jim
chain ,string , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.Chain , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/daemon.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
daemon ,types.Daemon , ,embed , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.Nothing , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/history.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ nLogs ,uint64 , , , , ,jim
nTokens ,uint64 , , , , ,jim
nErrors ,uint64 , , , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.Transaction , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/index.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
chunkStats ,types.ChunkStats , ,embed , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.ChunkStats , , , , ,jim
nItems ,uint64 , , , , ,jim
18 changes: 9 additions & 9 deletions code_gen/templates/classDefinitions/fields/manifest.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
manifest ,types.Manifest , ,embed , , ,jim
nBlooms ,uint64 , , , , ,jim
bloomsSize ,uint64 , , , , ,jim
nIndexes ,uint64 , , , , ,jim
indexSize ,uint64 , , , , ,jim
updater ,updater.Updater , , , , ,jim
items ,[]types.ChunkRecord , , , , ,jim
nItems ,uint64 , , , , ,jim
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
manifest ,types.Manifest , ,embed , , ,jim
nBlooms ,uint64 , , , , ,jim
bloomsSize ,uint64 , , , , ,jim
nIndexes ,uint64 , , , , ,jim
indexSize ,uint64 , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.ChunkRecord , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/monitor.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ nDeleted ,uint64 , , , , ,jim
fileSize ,uint64 , , , , ,jim
nRecords ,uint64 , , , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.Monitor , , , , ,jim
nItems ,uint64 , , , , ,jim
28 changes: 14 additions & 14 deletions code_gen/templates/classDefinitions/fields/name.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
nContracts ,uint64 , , , , ,jim
nCustom ,uint64 , , , , ,jim
nDeleted ,uint64 , , , , ,jim
nErc20s ,uint64 , , , , ,jim
nErc721s ,uint64 , , , , ,jim
nPrefund ,uint64 , , , , ,jim
nRegular ,uint64 , , , , ,jim
nSystem ,uint64 , , , , ,jim
sizeOnDisc ,uint64 , , , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
items ,[]types.Name , , , , ,jim
nItems ,uint64 , , , , ,jim
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
nContracts ,uint64 , , , , ,jim
nCustom ,uint64 , , , , ,jim
nDeleted ,uint64 , , , , ,jim
nErc20s ,uint64 , , , , ,jim
nErc721s ,uint64 , , , , ,jim
nPrefund ,uint64 , , , , ,jim
nRegular ,uint64 , , , , ,jim
nSystem ,uint64 , , , , ,jim
sizeOnDisc ,uint64 , , , , ,jim
chain ,string , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.Name , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/project.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ nManifests ,uint64 , , , ,
nCaches ,uint64 , , , , ,jim
historySize ,uint64 , , , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.HistoryContainer , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/session.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
session ,types.Session , ,embed , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.Nothing , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/settings.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name ,type ,strDefault ,attributes ,upgrades ,docOrder ,descript
# config ,types.Config , , , , ,jim
# session ,types.Session , , , , ,jim
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.CacheItem , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/status.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ status ,types.Status , ,embed , , ,jim
nFolders ,uint64 , , , , ,jim
nFiles ,uint64 , , , , ,jim
nBytes ,uint64 , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.CacheItem , , , , ,jim
nItems ,uint64 , , , , ,jim
2 changes: 1 addition & 1 deletion code_gen/templates/classDefinitions/fields/wizard.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name ,type ,strDefault ,attributes ,upgrades ,docOrder ,description
chain ,string , , , , ,jim
updater ,updater.Updater , , , , ,jim
updater ,sdk.Updater , , , , ,jim
items ,[]types.WizError , , , , ,jim
nItems ,uint64 , , , , ,jim
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ func New{{$class}}Container(chain string, {{$param1}}{{$param2}}) {{$class}}Cont
return ret
}

func New{{$class}}Updater(chain string{{$param2}}{{$param4}}, resetIn ...bool) updater.Updater {
func New{{$class}}Updater(chain string{{$param2}}{{$param4}}, resetIn ...bool) sdk.Updater {
reset := false
if len(resetIn) > 0 {
reset = resetIn[0]
}

// EXISTING_CODE
// EXISTING_CODE
updater, _ := updater.NewUpdater("{{$routeLower}}", items)
u, _ := sdk.NewUpdater("{{$routeLower}}", items)
if reset {
updater.Reset()
u.Reset()
}
return updater
return u
}

func (s *{{$class}}Container) String() string {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/debug/DebugState.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Text } from "@mantine/core";
import { updater } from "@gocode/models";
import { sdk } from "@gocode/models";
import { useRenderCounter } from "@hooks";
import { useAppState, useViewState } from "@state";

const debug = false;
const debug = true;

export const DebugState = ({ u }: { u: updater.Updater }) => {
export const DebugState = ({ u }: { u: sdk.Updater }) => {
const { info } = useAppState();
const { nItems } = useViewState();
const renderCount = useRenderCounter();
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/Daemons/DaemonsFormDef.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Box, SimpleGrid, Stack, Text } from "@mantine/core";
import { Table } from "@tanstack/react-table";
// import { DaemonCard, DaemonLog, FieldGroup, FieldsetWrapper, PinButton } from "@components";
import { FieldGroup, FieldsetWrapper, PinButton } from "@components";
import { messages, types, updater } from "@gocode/models";
import { messages, types, sdk } from "@gocode/models";
export interface Nope {
scraper: types.Daemon;
freshen: types.Daemon;
ipfs: types.Daemon;
logMessages: messages.MessageMsg[];
toggleDaemon: (name: string) => void;
updater: updater.Updater;
updater: sdk.Updater;
}
// EXISTING_CODE

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Daemons/DaemonsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const DaemonsView = () => {
// ToggleDaemon(name);
// };

// const upd = updater.Updater.createFrom({});
// const upd = sdk.Updater.createFrom({});
// const daemons: Nope = {
// toggleDaemon,
// scraper,
Expand Down
Loading

0 comments on commit 4bad0e8

Please sign in to comment.