Skip to content

Commit

Permalink
Merge branch 'fixes' into 'main'
Browse files Browse the repository at this point in the history
Fixes

See merge request flarenetwork/flare-system-client!53
  • Loading branch information
GrePod committed Dec 9, 2024
2 parents 7550d51 + 2eea083 commit 90498b9
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 32 deletions.
1 change: 0 additions & 1 deletion client/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func BuildContext() (ClientContext, error) {
if err != nil {
return nil, err
}
globalConfig.GlobalConfigCallback.Call(cfg)

db, err := database.Connect(&cfg.DB)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions client/main/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ func main() {
return
}

logger.Set(clientCtx.Config().Logger)

// Prometheus metrics
shared.InitMetricsServer(&clientCtx.Config().Metrics)

Expand Down
2 changes: 1 addition & 1 deletion client/protocol/submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (s *SignatureSubmitter) RunEpochBeforeDeadline(currentEpoch int64, deadline
}

func (s *SignatureSubmitter) RunEpochAfterDeadline(currentEpoch int64, protocolsToQuery map[int]bool) {
channels := make([]<-chan shared.ExecuteStatus[*SubProtocolResponse], len(protocolsToQuery))
channels := make([]<-chan shared.ExecuteStatus[*SubProtocolResponse], len(s.subProtocols))

ticker := time.NewTicker(s.cycleDuration)

Expand Down
15 changes: 0 additions & 15 deletions config/callback.go

This file was deleted.

10 changes: 0 additions & 10 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,13 @@ import (
"github.com/BurntSushi/toml"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/flare-foundation/go-flare-common/pkg/logger"
"github.com/kelseyhightower/envconfig"
)

const (
ConfigFile string = "config.toml" // name of config file
)

var (
GlobalConfigCallback ConfigCallback[Global] = ConfigCallback[Global]{}
)

type Global interface {
LoggerConfig() logger.Config
ChainConfig() Chain
}

type Chain struct {
ChainID int `toml:"chain_id" envconfig:"CHAIN_ID"`
EthRPCURL string `toml:"eth_rpc_url" envconfig:"ETH_RPC_URL"`
Expand Down
6 changes: 1 addition & 5 deletions tests/mock/server_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import (
"net/http"
"time"

"github.com/flare-foundation/flare-system-client/client/config"

globalConfig "github.com/flare-foundation/flare-system-client/config"

"github.com/gorilla/mux"

"github.com/flare-foundation/go-flare-common/pkg/logger"
Expand Down Expand Up @@ -114,7 +110,7 @@ func buildMessageForSigning(protocolID uint8, roundID uint32, merkleRoot []byte)
}

func main() {
globalConfig.GlobalConfigCallback.Call(config.Client{Logger: logger.Config{Console: true}})
logger.Set(logger.Config{Console: true})

port := 3100
protocolID := uint8(101)
Expand Down

0 comments on commit 90498b9

Please sign in to comment.