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

Fixes issue #3725 #3733

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/abis/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultAbisOptions = AbisOptions{}
globals.SetDefaults(&defaultAbisOptions.Globals)
defaultAbisOptions.Globals.TestMode = testMode
defaultAbisOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultAbisOptions.Globals.Caps = getCaps()
opts := AbisOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultAbisOptions = opts
}

func (opts *AbisOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/blocks/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultBlocksOptions = BlocksOptions{}
globals.SetDefaults(&defaultBlocksOptions.Globals)
defaultBlocksOptions.Globals.TestMode = testMode
defaultBlocksOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultBlocksOptions.Globals.Caps = getCaps()
opts := BlocksOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultBlocksOptions = opts
}

func (opts *BlocksOptions) getCaches() (m map[string]bool) {
Expand Down
16 changes: 9 additions & 7 deletions src/apps/chifra/internal/chunks/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,15 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultChunksOptions = ChunksOptions{}
globals.SetDefaults(&defaultChunksOptions.Globals)
defaultChunksOptions.Globals.TestMode = testMode
defaultChunksOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultChunksOptions.Globals.Caps = getCaps()
opts := ChunksOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
opts.Truncate = base.NOPOSN
opts.LastBlock = base.NOPOSN
opts.MaxAddrs = base.NOPOS
defaultChunksOptions = opts
}

func (opts *ChunksOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultConfigOptions = ConfigOptions{}
globals.SetDefaults(&defaultConfigOptions.Globals)
defaultConfigOptions.Globals.TestMode = testMode
defaultConfigOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultConfigOptions.Globals.Caps = getCaps()
opts := ConfigOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultConfigOptions = opts
}

func (opts *ConfigOptions) getCaches() (m map[string]bool) {
Expand Down
16 changes: 9 additions & 7 deletions src/apps/chifra/internal/daemon/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,15 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultDaemonOptions = DaemonOptions{}
globals.SetDefaults(&defaultDaemonOptions.Globals)
defaultDaemonOptions.Globals.TestMode = testMode
defaultDaemonOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultDaemonOptions.Globals.Caps = getCaps()
opts := DaemonOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
opts.Url = "localhost:8080"
opts.Api = "on"
opts.Port = ":8080"
defaultDaemonOptions = opts
}

func (opts *DaemonOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/explore/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultExploreOptions = ExploreOptions{}
globals.SetDefaults(&defaultExploreOptions.Globals)
defaultExploreOptions.Globals.TestMode = testMode
defaultExploreOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultExploreOptions.Globals.Caps = getCaps()
opts := ExploreOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultExploreOptions = opts
}

func (opts *ExploreOptions) getCaches() (m map[string]bool) {
Expand Down
15 changes: 8 additions & 7 deletions src/apps/chifra/internal/export/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,14 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultExportOptions = ExportOptions{}
globals.SetDefaults(&defaultExportOptions.Globals)
defaultExportOptions.Globals.TestMode = testMode
defaultExportOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultExportOptions.Globals.Caps = getCaps()
opts := ExportOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
opts.MaxRecords = 250
opts.LastBlock = base.NOPOSN
defaultExportOptions = opts
}

func (opts *ExportOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/init/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultInitOptions = InitOptions{}
globals.SetDefaults(&defaultInitOptions.Globals)
defaultInitOptions.Globals.TestMode = testMode
defaultInitOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultInitOptions.Globals.Caps = getCaps()
opts := InitOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultInitOptions = opts
}

func (opts *InitOptions) getCaches() (m map[string]bool) {
Expand Down
15 changes: 8 additions & 7 deletions src/apps/chifra/internal/list/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,14 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultListOptions = ListOptions{}
globals.SetDefaults(&defaultListOptions.Globals)
defaultListOptions.Globals.TestMode = testMode
defaultListOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultListOptions.Globals.Caps = getCaps()
opts := ListOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
opts.MaxRecords = 250
opts.LastBlock = base.NOPOSN
defaultListOptions = opts
}

func (opts *ListOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/logs/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultLogsOptions = LogsOptions{}
globals.SetDefaults(&defaultLogsOptions.Globals)
defaultLogsOptions.Globals.TestMode = testMode
defaultLogsOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultLogsOptions.Globals.Caps = getCaps()
opts := LogsOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultLogsOptions = opts
}

func (opts *LogsOptions) getCaches() (m map[string]bool) {
Expand Down
15 changes: 8 additions & 7 deletions src/apps/chifra/internal/monitors/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,14 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultMonitorsOptions = MonitorsOptions{}
globals.SetDefaults(&defaultMonitorsOptions.Globals)
defaultMonitorsOptions.Globals.TestMode = testMode
defaultMonitorsOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultMonitorsOptions.Globals.Caps = getCaps()
opts := MonitorsOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
opts.BatchSize = 8
opts.Sleep = 14
defaultMonitorsOptions = opts
}

func (opts *MonitorsOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/names/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultNamesOptions = NamesOptions{}
globals.SetDefaults(&defaultNamesOptions.Globals)
defaultNamesOptions.Globals.TestMode = testMode
defaultNamesOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultNamesOptions.Globals.Caps = getCaps()
opts := NamesOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultNamesOptions = opts
}

func (opts *NamesOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/receipts/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultReceiptsOptions = ReceiptsOptions{}
globals.SetDefaults(&defaultReceiptsOptions.Globals)
defaultReceiptsOptions.Globals.TestMode = testMode
defaultReceiptsOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultReceiptsOptions.Globals.Caps = getCaps()
opts := ReceiptsOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultReceiptsOptions = opts
}

func (opts *ReceiptsOptions) getCaches() (m map[string]bool) {
Expand Down
20 changes: 13 additions & 7 deletions src/apps/chifra/internal/scrape/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,19 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultScrapeOptions = ScrapeOptions{}
globals.SetDefaults(&defaultScrapeOptions.Globals)
defaultScrapeOptions.Globals.TestMode = testMode
defaultScrapeOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultScrapeOptions.Globals.Caps = getCaps()
opts := ScrapeOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
opts.BlockCnt = 2000
opts.Sleep = 14
opts.Settings.AppsPerChunk = 2000000
opts.Settings.SnapToGrid = 250000
opts.Settings.FirstSnap = 2000000
opts.Settings.UnripeDist = 28
opts.Settings.ChannelCount = 20
defaultScrapeOptions = opts
}

func (opts *ScrapeOptions) getCaches() (m map[string]bool) {
Expand Down
16 changes: 9 additions & 7 deletions src/apps/chifra/internal/slurp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,15 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultSlurpOptions = SlurpOptions{}
globals.SetDefaults(&defaultSlurpOptions.Globals)
defaultSlurpOptions.Globals.TestMode = testMode
defaultSlurpOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultSlurpOptions.Globals.Caps = getCaps()
opts := SlurpOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
opts.Source = "etherscan"
opts.PerPage = 1000
opts.Sleep = .25
defaultSlurpOptions = opts
}

func (opts *SlurpOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/state/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultStateOptions = StateOptions{}
globals.SetDefaults(&defaultStateOptions.Globals)
defaultStateOptions.Globals.TestMode = testMode
defaultStateOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultStateOptions.Globals.Caps = getCaps()
opts := StateOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultStateOptions = opts
}

func (opts *StateOptions) getCaches() (m map[string]bool) {
Expand Down
14 changes: 7 additions & 7 deletions src/apps/chifra/internal/status/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultStatusOptions = StatusOptions{}
globals.SetDefaults(&defaultStatusOptions.Globals)
defaultStatusOptions.Globals.TestMode = testMode
defaultStatusOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultStatusOptions.Globals.Caps = getCaps()
opts := StatusOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
opts.MaxRecords = 10000
defaultStatusOptions = opts
}

func (opts *StatusOptions) getCaches() (m map[string]bool) {
Expand Down
13 changes: 6 additions & 7 deletions src/apps/chifra/internal/tokens/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,12 @@ func getCaps() caps.Capability {
func ResetOptions(testMode bool) {
// We want to keep writer between command file calls
w := GetOptions().Globals.Writer
defaultTokensOptions = TokensOptions{}
globals.SetDefaults(&defaultTokensOptions.Globals)
defaultTokensOptions.Globals.TestMode = testMode
defaultTokensOptions.Globals.Writer = w
// EXISTING_CODE
// EXISTING_CODE
defaultTokensOptions.Globals.Caps = getCaps()
opts := TokensOptions{}
globals.SetDefaults(&opts.Globals)
opts.Globals.TestMode = testMode
opts.Globals.Writer = w
opts.Globals.Caps = getCaps()
defaultTokensOptions = opts
}

func (opts *TokensOptions) getCaches() (m map[string]bool) {
Expand Down
Loading
Loading