Skip to content

Commit

Permalink
chore: add btc del tx hash to delegation sent to babylon
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Nov 27, 2024
1 parent 9f1f0ab commit d0a1c86
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions staker/stakerapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ func (app *App) handleSendDelegationRequest(
stakerAddress,
delegationData.Ud.UnbondingTransaction,
delegationData.Ud.UnbondingTxUnbondingTime,
resp.TxHash,
)
if err != nil {
return nil, btcDelTxHash, err
Expand Down
2 changes: 2 additions & 0 deletions stakerdb/trackedtranactionstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ func (c *TrackedTransactionStore) AddTransactionSentToBabylon(
stakerAddress btcutil.Address,
unbondingTx *wire.MsgTx,
unbondingTime uint16,
btcDelTxHash string,
) error {
txHash := btcTx.TxHash()
txHashBytes := txHash[:]
Expand Down Expand Up @@ -720,6 +721,7 @@ func (c *TrackedTransactionStore) AddTransactionSentToBabylon(
State: proto.TransactionState_SENT_TO_BABYLON,
Watched: false,
UnbondingTxData: update,
BtcDelegationTxHash: btcDelTxHash,
}

inputData, err := getInputData(btcTx)
Expand Down
1 change: 1 addition & 0 deletions stakerdb/trackedtransactionstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ func FuzzTrackInputs(f *testing.F) {
stakerAddr,
randomUnbondingTx,
unbodningTime,
"txHashBtcDelegation",
)
require.NoError(t, err)
}
Expand Down

0 comments on commit d0a1c86

Please sign in to comment.