Skip to content

Commit

Permalink
provide bitcoin_chain_id when query tss address
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Feb 6, 2024
1 parent 7cb3e9b commit 54d7613
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion zetaclient/bitcoin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ func GetBtcEvent(
return nil, err
}
if wpkhAddress.EncodeAddress() != targetAddress {
return nil, err
return nil, nil
}
// deposit amount has to be no less than the minimum depositor fee
if out.Value < BtcDepositorFeeMin {
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/inbound_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (ob *BitcoinChainClient) CheckReceiptForBtcTxHash(txHash string, vote bool)
if err != nil {
return "", err
}
tss, err := ob.zetaClient.GetBtcTssAddress()
tss, err := ob.zetaClient.GetBtcTssAddress(ob.chain.ChainId)
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type ZetaCoreBridger interface {
GetCrosschainFlags() (observertypes.CrosschainFlags, error)
GetObserverList() ([]string, error)
GetKeyGen() (*observertypes.Keygen, error)
GetBtcTssAddress() (string, error)
GetBtcTssAddress(chainID int64) (string, error)
GetInboundTrackersForChain(chainID int64) ([]crosschaintypes.InTxTracker, error)
GetLogger() *zerolog.Logger
ZetaChain() common.Chain
Expand Down
6 changes: 4 additions & 2 deletions zetaclient/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,11 @@ func (b *ZetaCoreBridge) GetEthTssAddress() (string, error) {
return resp.Eth, nil
}

func (b *ZetaCoreBridge) GetBtcTssAddress() (string, error) {
func (b *ZetaCoreBridge) GetBtcTssAddress(chainID int64) (string, error) {
client := observertypes.NewQueryClient(b.grpcConn)
resp, err := client.GetTssAddress(context.Background(), &observertypes.QueryGetTssAddressRequest{})
resp, err := client.GetTssAddress(context.Background(), &observertypes.QueryGetTssAddressRequest{
BitcoinChainId: chainID,
})
if err != nil {
return "", err
}
Expand Down

0 comments on commit 54d7613

Please sign in to comment.