Skip to content

Commit

Permalink
cleanup unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Aug 23, 2024
1 parent 8575dd1 commit 998cee9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 53 deletions.
8 changes: 2 additions & 6 deletions btcclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"go.uber.org/zap"

"github.com/babylonlabs-io/vigilante/config"
"github.com/babylonlabs-io/vigilante/types"
)

var _ BTCClient = &Client{}
Expand All @@ -25,16 +24,13 @@ var _ BTCClient = &Client{}
type Client struct {
*rpcclient.Client

Params *chaincfg.Params
Cfg *config.BTCConfig
params *chaincfg.Params
cfg *config.BTCConfig
logger *zap.SugaredLogger

// retry attributes
retrySleepTime time.Duration
maxRetrySleepTime time.Duration

// channel for notifying new BTC blocks to reporter
blockEventChan chan *types.BlockEvent
}

func (c *Client) GetTipBlockVerbose() (*btcjson.GetBlockVerboseResult, error) {
Expand Down
12 changes: 6 additions & 6 deletions btcclient/client_wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func NewWallet(cfg *config.BTCConfig, parentLogger *zap.Logger) (*Client, error)
return nil, err
}
wallet := &Client{}
wallet.Cfg = cfg
wallet.Params = params
wallet.cfg = cfg
wallet.params = params
wallet.logger = parentLogger.With(zap.String("module", "btcclient_wallet")).Sugar()

connCfg := &rpcclient.ConnConfig{}
Expand Down Expand Up @@ -69,23 +69,23 @@ func NewWallet(cfg *config.BTCConfig, parentLogger *zap.Logger) (*Client, error)
}

func (c *Client) GetWalletPass() string {
return c.Cfg.WalletPassword
return c.cfg.WalletPassword
}

func (c *Client) GetWalletLockTime() int64 {
return c.Cfg.WalletLockTime
return c.cfg.WalletLockTime
}

func (c *Client) GetNetParams() *chaincfg.Params {
net, err := netparams.GetBTCParams(c.Cfg.NetParams)
net, err := netparams.GetBTCParams(c.cfg.NetParams)
if err != nil {
panic(fmt.Errorf("failed to get BTC network params: %w", err))
}
return net
}

func (c *Client) GetBTCConfig() *config.BTCConfig {
return c.Cfg
return c.cfg
}

func (c *Client) ListUnspent() ([]btcjson.ListUnspentResult, error) {
Expand Down
1 change: 0 additions & 1 deletion btcclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type BTCWallet interface {
SendRawTransaction(tx *wire.MsgTx, allowHighFees bool) (*chainhash.Hash, error)
GetRawChangeAddress(account string) (btcutil.Address, error)
WalletPassphrase(passphrase string, timeoutSecs int64) error
DumpPrivKey(address btcutil.Address) (*btcutil.WIF, error)
GetHighUTXOAndSum() (*btcjson.ListUnspentResult, float64, error)
FundRawTransaction(tx *wire.MsgTx, opts btcjson.FundRawTransactionOpts, isWitness *bool) (*btcjson.FundRawTransactionResult, error)
SignRawTransactionWithWallet(tx *wire.MsgTx) (*wire.MsgTx, bool, error)
Expand Down
25 changes: 0 additions & 25 deletions btcclient/testutils.go

This file was deleted.

15 changes: 0 additions & 15 deletions testutil/mocks/btcclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 998cee9

Please sign in to comment.