Skip to content

Commit

Permalink
chore: format/golines (#151)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
  • Loading branch information
wolf31o2 committed May 8, 2024
1 parent df1e09e commit d51c544
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ type IndexerConfig struct {
ScriptAddress string `yaml:"scriptAddress" envconfig:"INDEXER_SCRIPT_ADDRESS"`
InterceptHash string `yaml:"interceptHash" envconfig:"INDEXER_INTERCEPT_HASH"`
InterceptSlot uint64 `yaml:"interceptSlot" envconfig:"INDEXER_INTERCEPT_SLOT"`
Tld string `yaml:"tld" envconfig:"INDEXER_TLD"`
PolicyId string `yaml:"policyId" envconfig:"INDEXER_POLICY_ID"`
Verify bool `yaml:"verify" envconfig:"INDEXER_VERIFY"`
Tld string `yaml:"tld" envconfig:"INDEXER_TLD"`
PolicyId string `yaml:"policyId" envconfig:"INDEXER_POLICY_ID"`
Verify bool `yaml:"verify" envconfig:"INDEXER_VERIFY"`
}

type StateConfig struct {
Expand Down Expand Up @@ -140,7 +140,8 @@ func Load(configFile string) (*Config, error) {
}
}
// Provide default intercept point from profile
if globalConfig.Indexer.InterceptSlot == 0 || globalConfig.Indexer.InterceptHash == "" {
if globalConfig.Indexer.InterceptSlot == 0 ||
globalConfig.Indexer.InterceptHash == "" {
if profile.InterceptHash != "" && profile.InterceptSlot > 0 {
globalConfig.Indexer.InterceptHash = profile.InterceptHash
globalConfig.Indexer.InterceptSlot = profile.InterceptSlot
Expand Down
5 changes: 4 additions & 1 deletion internal/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ func (s *State) compareFingerprint() error {
}
err = item.Value(func(v []byte) error {
if string(v) != fingerprint {
return fmt.Errorf("config fingerprint in DB doesn't match current config: %s", v)
return fmt.Errorf(
"config fingerprint in DB doesn't match current config: %s",
v,
)
}
return nil
})
Expand Down

0 comments on commit d51c544

Please sign in to comment.