Skip to content

Commit

Permalink
Merge pull request #3549 from TrueBlocks/feature/better-makeClass
Browse files Browse the repository at this point in the history
Feature/better make class
  • Loading branch information
tjayrush authored Mar 20, 2024
2 parents 2d5ee43 + 82b980d commit 092d65b
Show file tree
Hide file tree
Showing 214 changed files with 330 additions and 2,450 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- [Introduction](#introduction)
- [Installing](#installing)
- [Command line](#command-line)
- [Command Line](#command-line)
- [Chifra Serve](#chifra-serve)
- [Troubleshooting](#troubleshooting)
- [The unchained index](#the-unchained-index)
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.8
1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
goMaker
sdkTester
old
examples
Expand Down
2 changes: 1 addition & 1 deletion docs/content/chifra/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Each of the following additional configurable command line options are available
| firstSnap | uint64 | 2000000 | the first block at which snap_to_grid is enabled |
| unripeDist | uint64 | 28 | the distance (in blocks) from the front of the chain under which (inclusive) a block is considered unripe |
| channelCount | uint64 | 20 | number of concurrent processing channels |
| allowMissing | bool | true | do not report errors for blockchains that contain blocks with zero addresses |
| allowMissing | bool | false | do not report errors for blockchains that contain blocks with zero addresses |

Note that for Ethereum mainnet, the default values for appsPerChunk and firstSnap are 2,000,000 and 2,300,000 respectively. See the specification for a justification of these values.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/chifra/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Purpose:
Open a local or remote explorer for one or more addresses, blocks, or transactions.
Usage:
chifra explore [flags] <term> [term...]
chifra explore [flags] [terms...]
Arguments:
terms - one or more address, name, block, or transaction identifier
Expand Down
2 changes: 1 addition & 1 deletion docs/readmes/admin-scrape.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Each of the following additional configurable command line options are available
| firstSnap | uint64 | 2000000 | the first block at which snap_to_grid is enabled |
| unripeDist | uint64 | 28 | the distance (in blocks) from the front of the chain under which (inclusive) a block is considered unripe |
| channelCount | uint64 | 20 | number of concurrent processing channels |
| allowMissing | bool | true | do not report errors for blockchains that contain blocks with zero addresses |
| allowMissing | bool | false | do not report errors for blockchains that contain blocks with zero addresses |

Note that for Ethereum mainnet, the default values for appsPerChunk and firstSnap are 2,000,000 and 2,300,000 respectively. See the specification for a justification of these values.

Expand Down
2 changes: 1 addition & 1 deletion docs/readmes/other-explore.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Purpose:
Open a local or remote explorer for one or more addresses, blocks, or transactions.
Usage:
chifra explore [flags] <term> [term...]
chifra explore [flags] [terms...]
Arguments:
terms - one or more address, name, block, or transaction identifier
Expand Down
2 changes: 1 addition & 1 deletion docs/templates/readme-intros/admin-scrape.config.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
| firstSnap | uint64 | 2000000 | the first block at which snap_to_grid is enabled |
| unripeDist | uint64 | 28 | the distance (in blocks) from the front of the chain under which (inclusive) a block is considered unripe |
| channelCount | uint64 | 20 | number of concurrent processing channels |
| allowMissing | bool | true | do not report errors for blockchains that contain blocks with zero addresses |
| allowMissing | bool | false | do not report errors for blockchains that contain blocks with zero addresses |
14 changes: 7 additions & 7 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Go Version
go 1.22

use ./src/apps/chifra

use ./src/examples/usesSDK

use ./sdk/go

use ./src/dev_tools/sdkTester
use (
./sdk/go
./src/apps/chifra
./src/dev_tools/goMaker
./src/dev_tools/sdkTester
./src/examples/usesSDK
)
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

Loading

0 comments on commit 092d65b

Please sign in to comment.