Skip to content

Commit

Permalink
using *bool type for aptos enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
yongkangchia committed Jun 19, 2024
1 parent 2f30693 commit 3354dc3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions core/services/chainlink/config_general.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,27 @@ func (g *generalConfig) StarkNetEnabled() bool {
return false
}

// func (g *generalConfig) AptosEnabled() bool {
// for _, c := range g.c.Aptos {
// if c != nil { // Ensure c is not nil before dereferencing
// if v, ok := (*c)["Enabled"]; ok && v.(bool) {
// return true
// }
// }
// }
// return false
// }

func (g *generalConfig) AptosEnabled() bool {
for _, c := range g.c.Aptos {
if c != nil { // Ensure c is not nil before dereferencing
if v, ok := (*c)["Enabled"]; ok && v == true {
return true
if v, ok := (*c)["Enabled"]; ok {
switch v := v.(type) {
case *bool: // Should be this
return v == nil || *v
case bool:
return v
}
}
}
}
Expand Down

0 comments on commit 3354dc3

Please sign in to comment.