Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/better make class #3549

Merged
merged 21 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
60e9cae
Adds a placeholder for goMaker
tjayrush Mar 20, 2024
1b07c99
Removes unused code
tjayrush Mar 20, 2024
3fa25a2
Adds goMaker to the build
tjayrush Mar 20, 2024
993f492
Adds a VERSION file and moves some code
tjayrush Mar 20, 2024
049d9fa
Moves data files to ./other/data-models. Adds usage field (unused) to…
tjayrush Mar 20, 2024
74fec2d
Fixes a few things with the old code generator
tjayrush Mar 20, 2024
f19e82c
Removes generation of all SDK code from the C++. Does not yet replace…
tjayrush Mar 20, 2024
31498c8
Removes no longer needed templates
tjayrush Mar 20, 2024
924499d
Tidys the go.mod file in goMaker
tjayrush Mar 20, 2024
3d3f628
Removes --sdk from build commands
tjayrush Mar 20, 2024
8afffc3
Cleans up (by hand) formatting using gofmt (new autogen will use gofmt)
tjayrush Mar 20, 2024
c0d735c
Cleans up (by hand) formatting for typescript SDK
tjayrush Mar 20, 2024
384a6de
Cleans up (by hand) python SDK. Removes redundant option.
tjayrush Mar 20, 2024
e539f61
Renames help_text.go to helpfile.go
tjayrush Mar 20, 2024
5525541
Hand edits in anticipation of the new auto-gen code
tjayrush Mar 20, 2024
6781d4b
Hand edits in anticipation of the new auto-gen code
tjayrush Mar 20, 2024
0bd9b88
Hand edits in anticipation of the new auto-gen code
tjayrush Mar 20, 2024
712bd37
Hand edits in anticipation of the new auto-gen code
tjayrush Mar 20, 2024
a46e453
Removes all GoLang generation (other than data structures) from C++ c…
tjayrush Mar 20, 2024
67acadb
Touching
tjayrush Mar 20, 2024
82b980d
Merge branch 'develop' of github.com:TrueBlocks/trueblocks-core into …
tjayrush Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Hand edits in anticipation of the new auto-gen code
  • Loading branch information
tjayrush committed Mar 20, 2024
commit 55255418c98353b3142c9f79f1d729e2d34216c5
2 changes: 0 additions & 2 deletions sdk/go/abis.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func abisParseFunc(target interface{}, key, value string) (bool, error) {
}

// No enums

// EXISTING_CODE
if key == "proxyFor" {
opts, _ := target.(*AbisOptions)
Expand All @@ -78,4 +77,3 @@ func GetAbisOptions(args []string) (*AbisOptions, error) {
}

// No enums

12 changes: 5 additions & 7 deletions sdk/go/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ func blocksParseFunc(target interface{}, key, value string) (bool, error) {
return false, fmt.Errorf("parseFunc(blocks): target is not of correct type")
}

switch key {
case "flow":
if key == "flow" {
var err error
values := strings.Split(value, ",")
if opts.Flow, err = enumFromBlocksFlow(values); err != nil {
Expand Down Expand Up @@ -96,8 +95,8 @@ func GetBlocksOptions(args []string) (*BlocksOptions, error) {
type BlocksFlow int

const (
NoBF BlocksFlow = 0
BFFrom = 1 << iota
NoBF BlocksFlow = 0
BFFrom = 1 << iota
BFTo
BFReward
)
Expand All @@ -109,8 +108,8 @@ func (v BlocksFlow) String() string {
}

var m = map[BlocksFlow]string{
BFFrom: "from",
BFTo: "to",
BFFrom: "from",
BFTo: "to",
BFReward: "reward",
}

Expand Down Expand Up @@ -145,4 +144,3 @@ func enumFromBlocksFlow(values []string) (BlocksFlow, error) {

return result, nil
}

26 changes: 12 additions & 14 deletions sdk/go/chunks.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ func chunksParseFunc(target interface{}, key, value string) (bool, error) {
return false, fmt.Errorf("parseFunc(chunks): target is not of correct type")
}

switch key {
case "mode":
if key == "mode" {
var err error
values := strings.Split(value, ",")
if opts.Mode, err = enumFromChunksMode(values); err != nil {
Expand Down Expand Up @@ -99,8 +98,8 @@ func GetChunksOptions(args []string) (*ChunksOptions, error) {
type ChunksMode int

const (
NoCM2 ChunksMode = 0
CMManifest = 1 << iota
NoCHM ChunksMode = 0
CMManifest = 1 << iota
CMIndex
CMBlooms
CMPins
Expand All @@ -111,18 +110,18 @@ const (

func (v ChunksMode) String() string {
switch v {
case NoCM2:
case NoCHM:
return "none"
}

var m = map[ChunksMode]string{
CMManifest: "manifest",
CMIndex: "index",
CMBlooms: "blooms",
CMPins: "pins",
CMAddresses: "addresses",
CMManifest: "manifest",
CMIndex: "index",
CMBlooms: "blooms",
CMPins: "pins",
CMAddresses: "addresses",
CMAppearances: "appearances",
CMStats: "stats",
CMStats: "stats",
}

var ret []string
Expand All @@ -137,7 +136,7 @@ func (v ChunksMode) String() string {

func enumFromChunksMode(values []string) (ChunksMode, error) {
if len(values) == 0 {
return NoCM2, fmt.Errorf("no value provided for mode option")
return NoCHM, fmt.Errorf("no value provided for mode option")
}

var result ChunksMode
Expand All @@ -158,10 +157,9 @@ func enumFromChunksMode(values []string) (ChunksMode, error) {
case "stats":
result |= CMStats
default:
return NoCM2, fmt.Errorf("unknown mode: %s", val)
return NoCHM, fmt.Errorf("unknown mode: %s", val)
}
}

return result, nil
}

14 changes: 6 additions & 8 deletions sdk/go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ func configParseFunc(target interface{}, key, value string) (bool, error) {
return false, fmt.Errorf("parseFunc(config): target is not of correct type")
}

switch key {
case "mode":
if key == "mode" {
var err error
values := strings.Split(value, ",")
if opts.Mode, err = enumFromConfigMode(values); err != nil {
Expand Down Expand Up @@ -80,14 +79,14 @@ func GetConfigOptions(args []string) (*ConfigOptions, error) {
type ConfigMode int

const (
NoCM1 ConfigMode = 0
CMShow = 1 << iota
NoCOM ConfigMode = 0
CMShow = 1 << iota
CMEdit
)

func (v ConfigMode) String() string {
switch v {
case NoCM1:
case NoCOM:
return "none"
}

Expand All @@ -108,7 +107,7 @@ func (v ConfigMode) String() string {

func enumFromConfigMode(values []string) (ConfigMode, error) {
if len(values) == 0 {
return NoCM1, fmt.Errorf("no value provided for mode option")
return NoCOM, fmt.Errorf("no value provided for mode option")
}

var result ConfigMode
Expand All @@ -119,10 +118,9 @@ func enumFromConfigMode(values []string) (ConfigMode, error) {
case "edit":
result |= CMEdit
default:
return NoCM1, fmt.Errorf("unknown mode: %s", val)
return NoCOM, fmt.Errorf("unknown mode: %s", val)
}
}

return result, nil
}

10 changes: 4 additions & 6 deletions sdk/go/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ func exportParseFunc(target interface{}, key, value string) (bool, error) {
return false, fmt.Errorf("parseFunc(export): target is not of correct type")
}

switch key {
case "flow":
if key == "flow" {
var err error
values := strings.Split(value, ",")
if opts.Flow, err = enumFromExportFlow(values); err != nil {
Expand Down Expand Up @@ -110,7 +109,7 @@ type ExportFlow int

const (
NoEF ExportFlow = 0
EFIn = 1 << iota
EFIn = 1 << iota
EFOut
EFZero
)
Expand All @@ -122,8 +121,8 @@ func (v ExportFlow) String() string {
}

var m = map[ExportFlow]string{
EFIn: "in",
EFOut: "out",
EFIn: "in",
EFOut: "out",
EFZero: "zero",
}

Expand Down Expand Up @@ -158,4 +157,3 @@ func enumFromExportFlow(values []string) (ExportFlow, error) {

return result, nil
}

2 changes: 0 additions & 2 deletions sdk/go/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func initParseFunc(target interface{}, key, value string) (bool, error) {
}

// No enums

// EXISTING_CODE
// EXISTING_CODE

Expand All @@ -72,4 +71,3 @@ func GetInitOptions(args []string) (*InitOptions, error) {
}

// No enums

2 changes: 0 additions & 2 deletions sdk/go/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func listParseFunc(target interface{}, key, value string) (bool, error) {
}

// No enums

// EXISTING_CODE
// EXISTING_CODE

Expand All @@ -79,4 +78,3 @@ func GetListOptions(args []string) (*ListOptions, error) {
}

// No enums

2 changes: 0 additions & 2 deletions sdk/go/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func logsParseFunc(target interface{}, key, value string) (bool, error) {
}

// No enums

// EXISTING_CODE
// EXISTING_CODE

Expand All @@ -70,4 +69,3 @@ func GetLogsOptions(args []string) (*LogsOptions, error) {
}

// No enums

2 changes: 0 additions & 2 deletions sdk/go/monitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func monitorsParseFunc(target interface{}, key, value string) (bool, error) {
}

// No enums

// EXISTING_CODE
// EXISTING_CODE

Expand All @@ -78,4 +77,3 @@ func GetMonitorsOptions(args []string) (*MonitorsOptions, error) {
}

// No enums

2 changes: 0 additions & 2 deletions sdk/go/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func namesParseFunc(target interface{}, key, value string) (bool, error) {
}

// No enums

// EXISTING_CODE
// EXISTING_CODE

Expand All @@ -84,4 +83,3 @@ func GetNamesOptions(args []string) (*NamesOptions, error) {
}

// No enums

2 changes: 0 additions & 2 deletions sdk/go/receipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func receiptsParseFunc(target interface{}, key, value string) (bool, error) {
}

// No enums

// EXISTING_CODE
// EXISTING_CODE

Expand All @@ -68,4 +67,3 @@ func GetReceiptsOptions(args []string) (*ReceiptsOptions, error) {
}

// No enums

1 change: 0 additions & 1 deletion sdk/go/scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ func GetScrapeOptions(args []string) (*ScrapeOptions, error) {
}

// No enums

35 changes: 17 additions & 18 deletions sdk/go/slurp.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ func slurpParseFunc(target interface{}, key, value string) (bool, error) {
return false, fmt.Errorf("parseFunc(slurp): target is not of correct type")
}

switch key {
case "types":
if key == "types" {
var err error
values := strings.Split(value, ",")
if opts.Types, err = enumFromSlurpTypes(values); err != nil {
return false, err
} else {
found = true
}
case "source":
}
if key == "source" {
var err error
values := strings.Split(value, ",")
if opts.Source, err = enumFromSlurpSource(values); err != nil {
Expand Down Expand Up @@ -96,17 +96,17 @@ func GetSlurpOptions(args []string) (*SlurpOptions, error) {
type SlurpTypes int

const (
NoST SlurpTypes = 0
STExt = 1 << iota
NoST SlurpTypes = 0
STExt = 1 << iota
STInt
STToken
STNfts
ST1155
STMiner
STUncles
STWithdrawals
STSome = STExt | STInt | STToken | STNfts | ST1155
STAll = STExt | STInt | STToken | STNfts | ST1155 | STMiner | STUncles | STWithdrawals
STSome = STExt | STInt | STToken | STNfts
STAll = STExt | STInt | STToken | STNfts | ST1155 | STMiner | STUncles | STWithdrawals
)

func (v SlurpTypes) String() string {
Expand All @@ -120,13 +120,13 @@ func (v SlurpTypes) String() string {
}

var m = map[SlurpTypes]string{
STExt: "ext",
STInt: "int",
STToken: "token",
STNfts: "nfts",
ST1155: "1155",
STMiner: "miner",
STUncles: "uncles",
STExt: "ext",
STInt: "int",
STToken: "token",
STNfts: "nfts",
ST1155: "1155",
STMiner: "miner",
STUncles: "uncles",
STWithdrawals: "withdrawals",
}

Expand Down Expand Up @@ -181,8 +181,8 @@ func enumFromSlurpTypes(values []string) (SlurpTypes, error) {
type SlurpSource int

const (
NoSS SlurpSource = 0
SSEtherscan = 1 << iota
NoSS SlurpSource = 0
SSEtherscan = 1 << iota
SSKey
)

Expand All @@ -194,7 +194,7 @@ func (v SlurpSource) String() string {

var m = map[SlurpSource]string{
SSEtherscan: "etherscan",
SSKey: "key",
SSKey: "key",
}

var ret []string
Expand Down Expand Up @@ -226,4 +226,3 @@ func enumFromSlurpSource(values []string) (SlurpSource, error) {

return result, nil
}

Loading