Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinssgh committed Apr 15, 2024
1 parent 140cf34 commit 6aa0d8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions zetaclient/bitcoin/bitcoin_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ func TestGetBtcEventErrors(t *testing.T) {
// load tx and leave rpc client without preloaded tx
tx := testutils.LoadBTCIntxRawResult(t, chain.ChainId, txHash, false)
rpcClient := stub.NewMockBTCRPCClient()
rpcClient.WithError(errors.New("error getting raw tx"))

// get BTC event
event, err := GetBtcEvent(rpcClient, *tx, tssAddress, blockNumber, log.Logger, net, depositorFee)
Expand Down
15 changes: 11 additions & 4 deletions zetaclient/bitcoin/bitcoin_signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package bitcoin
import (
"encoding/hex"
"fmt"
"github.com/rs/zerolog"
"math"
"math/big"
"reflect"
Expand Down Expand Up @@ -247,8 +248,14 @@ func createTestClientWithUTXOs(t *testing.T) *BTCChainClient {

func TestAddWithdrawTxOutputs(t *testing.T) {
// Create test signer and receiver address
signer, err := NewBTCSigner(config.BTCConfig{}, stub.NewTSSMainnet(), clientcommon.DefaultLoggers(), &metrics.TelemetryServer{}, nil)
require.NoError(t, err)
signer := BTCSigner{
tssSigner: stub.NewTSSMainnet(),
rpcClient: setupBTCFallbackClient(),
logger: zerolog.Logger{},
loggerCompliance: zerolog.Logger{},
ts: &metrics.TelemetryServer{},
coreContext: nil,
}

// tss address and script
tssAddr := signer.tssSigner.BTCAddressWitnessPubkeyHash()
Expand Down Expand Up @@ -626,6 +633,6 @@ func TestNewBTCSigner(t *testing.T) {
clientcommon.DefaultLoggers(),
&metrics.TelemetryServer{},
corecontext.NewZetaCoreContext(cfg))
require.NoError(t, err)
require.NotNil(t, btcSigner)
require.ErrorContains(t, err, "invalid endpoints")
require.Nil(t, btcSigner)
}

0 comments on commit 6aa0d8b

Please sign in to comment.