From 3354dc3f97e780c6d285f42acb8653d4c25d8e7d Mon Sep 17 00:00:00 2001 From: yongkangchia Date: Wed, 19 Jun 2024 15:30:03 +0800 Subject: [PATCH] using *bool type for aptos enabled --- core/services/chainlink/config_general.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/core/services/chainlink/config_general.go b/core/services/chainlink/config_general.go index a07dfcac87c..ffdb70b30dd 100644 --- a/core/services/chainlink/config_general.go +++ b/core/services/chainlink/config_general.go @@ -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 + } } } }