From 3f44a0f7ab70d85321b87b3a6bbcb96648239f77 Mon Sep 17 00:00:00 2001 From: Lazar <12626340+Lazar955@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:22:36 +0200 Subject: [PATCH] chore(*): minor cleanup (#37) rm unused code --- btcclient/client_wallet.go | 11 +---------- config/config.go | 15 --------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/btcclient/client_wallet.go b/btcclient/client_wallet.go index 83f1b9e8..cc3a50a0 100644 --- a/btcclient/client_wallet.go +++ b/btcclient/client_wallet.go @@ -93,11 +93,7 @@ func (c *Client) WalletPassphrase(passphrase string, timeoutSecs int64) error { return c.Client.WalletPassphrase(passphrase, timeoutSecs) } -func (c *Client) DumpPrivKey(address btcutil.Address) (*btcutil.WIF, error) { - return c.Client.DumpPrivKey(address) -} - -// GetHighUTXO returns the UTXO that has the highest amount +// GetHighUTXOAndSum returns the UTXO that has the highest amount func (c *Client) GetHighUTXOAndSum() (*btcjson.ListUnspentResult, float64, error) { utxos, err := c.ListUnspent() if err != nil { @@ -118,11 +114,6 @@ func (c *Client) GetHighUTXOAndSum() (*btcjson.ListUnspentResult, float64, error return &highUTXO, sum, nil } -// CalculateTxFee calculates tx fee based on the given fee rate (BTC/kB) and the tx size -func CalculateTxFee(feeRateAmount btcutil.Amount, size uint64) (uint64, error) { - return uint64(feeRateAmount.MulF64(float64(size) / 1024)), nil -} - func (c *Client) FundRawTransaction(tx *wire.MsgTx, opts btcjson.FundRawTransactionOpts, isWitness *bool) (*btcjson.FundRawTransactionResult, error) { return c.Client.FundRawTransaction(tx, opts, isWitness) } diff --git a/config/config.go b/config/config.go index fa11f2ca..6ebbb979 100644 --- a/config/config.go +++ b/config/config.go @@ -10,7 +10,6 @@ import ( "github.com/btcsuite/btcd/btcutil" "github.com/spf13/viper" "go.uber.org/zap" - "gopkg.in/yaml.v2" ) const ( @@ -132,17 +131,3 @@ func New(configFile string) (Config, error) { return Config{}, err } } - -func WriteSample() error { - cfg := DefaultConfig() - d, err := yaml.Marshal(&cfg) - if err != nil { - return err - } - // write to file - err = os.WriteFile("./sample-vigilante.yml", d, 0644) - if err != nil { - return err - } - return nil -}