Skip to content

Commit

Permalink
Pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradStaniec committed Oct 9, 2024
1 parent 38e5529 commit e46ef6a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/stakercli/daemon/daemoncommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ var stakeCmd = cli.Command{
},
cli.BoolFlag{
Name: helpers.SendToBabylonFirstFlag,
Usage: "Wheter staking transaction should be first to Babylon or BTC",
Usage: "Whether staking transaction should be first to Babylon or BTC",
},
},
Action: stake,
Expand Down
2 changes: 1 addition & 1 deletion itest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ func TestStakingUnbonding(t *testing.T) {
tm.waitForStakingTxState(t, txHash, proto.TransactionState_SPENT_ON_BTC)
}

func AestUnbondingRestartWaitingForSignatures(t *testing.T) {
func TestUnbondingRestartWaitingForSignatures(t *testing.T) {
t.Parallel()
// need to have at least 300 block on testnet as only then segwit is activated.
// Mature output is out which has 100 confirmations, which means 200mature outputs
Expand Down
3 changes: 0 additions & 3 deletions staker/babylontypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ func (app *StakerApp) buildDelegation(
stakerAddress btcutil.Address,
storedTx *stakerdb.StoredTransaction) (*cl.DelegationData, error) {

// stakingTxInclusionProof := app.mustBuildInclusionProof(req)

if storedTx.Watched {
watchedData, err := app.txTracker.GetWatchedTransactionData(&req.txHash)

Expand Down Expand Up @@ -304,7 +302,6 @@ func isTransacionFullySigned(tx *wire.MsgTx) (bool, error) {
// - delegation is on babylon
// - delegation has received enough covenant signatures
func (app *StakerApp) activateVerifiedDelegation(
stakerAddress btcutil.Address,
stakingTransaction *wire.MsgTx,
stakingOutputIndex uint32,
stakingTxHash *chainhash.Hash) {
Expand Down
7 changes: 2 additions & 5 deletions staker/stakerapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ func (app *StakerApp) checkTransactionsStatus() error {
if alreadyDelegated {
app.wg.Add(1)
app.activateVerifiedDelegation(
stakerAddress,
tx.StakingTx,
tx.StakingOutputIndex,
txHashCopy,
Expand Down Expand Up @@ -858,10 +857,9 @@ func (app *StakerApp) checkTransactionsStatus() error {

for _, txHash := range transactionsVerifiedOnBabylon {
txHashCopy := *txHash
storedTx, address := app.mustGetTransactionAndStakerAddress(&txHashCopy)
storedTx, _ := app.mustGetTransactionAndStakerAddress(&txHashCopy)
app.wg.Add(1)
go app.activateVerifiedDelegation(
address,
storedTx.StakingTx,
storedTx.StakingOutputIndex,
&txHashCopy,
Expand Down Expand Up @@ -1560,13 +1558,12 @@ func (app *StakerApp) handleStakingEvents() {
}

if !ev.delegationActive {
storedTx, stakerAddress := app.mustGetTransactionAndStakerAddress(&ev.stakingTxHash)
storedTx, _ := app.mustGetTransactionAndStakerAddress(&ev.stakingTxHash)
// if the delegation is not active here, it can only mean that statking
// is going through pre-approvel flow. Fire up task to send staking tx
// to btc chain
app.wg.Add(1)
go app.activateVerifiedDelegation(
stakerAddress,
storedTx.StakingTx,
storedTx.StakingOutputIndex,
&ev.stakingTxHash,
Expand Down

0 comments on commit e46ef6a

Please sign in to comment.