Skip to content

Commit

Permalink
fix chain config
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouop0 committed Dec 26, 2023
1 parent 9fd5727 commit 6ab45e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bitcoin/committer.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func NewCommitter(client *rpcclient.Client, network string, destination string,
case chaincfg.RegressionNetParams.Name:
params = chaincfg.RegressionNetParams
default:
params = chaincfg.MainNetParams
params = chaincfg.TestNet3Params
}
return &Committer{
client: client,
Expand Down
23 changes: 5 additions & 18 deletions bitcoin/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@ import (
"github.com/spf13/viper"
)

const (
// MAINNET...
MAINNET = "mainnet"
// TESTNET...
TESTNET = "testnet"
// SIGNET...
SIGNET = "signet"
// SIMNET...
SIMNET = "simnet"
// REGTEST...
REGTEST = "regtest"
)

// BitconConfig defines the bitcoin config
// TODO: defined different config group eg: bitcoin, bridge, indexer, commiter
type BitconConfig struct {
Expand Down Expand Up @@ -244,15 +231,15 @@ func LoadBitcoinConfig(homePath string) (*BitconConfig, error) {
// ChainParams get chain params by network name
func ChainParams(network string) *chaincfg.Params {
switch network {
case MAINNET:
case chaincfg.MainNetParams.Name:
return &chaincfg.MainNetParams
case TESTNET:
case chaincfg.TestNet3Params.Name:
return &chaincfg.TestNet3Params
case SIGNET:
case chaincfg.SigNetParams.Name:
return &chaincfg.SigNetParams
case SIMNET:
case chaincfg.SimNetParams.Name:
return &chaincfg.SimNetParams
case REGTEST:
case chaincfg.RegressionNetParams.Name:
return &chaincfg.RegressionNetParams
default:
return &chaincfg.TestNet3Params
Expand Down

0 comments on commit 6ab45e2

Please sign in to comment.