From e46ef6a2a5243d9dc93650878250476c4f54f91c Mon Sep 17 00:00:00 2001 From: KonradStaniec Date: Wed, 9 Oct 2024 14:42:39 +0200 Subject: [PATCH] Pr comments --- cmd/stakercli/daemon/daemoncommands.go | 2 +- itest/e2e_test.go | 2 +- staker/babylontypes.go | 3 --- staker/stakerapp.go | 7 ++----- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/cmd/stakercli/daemon/daemoncommands.go b/cmd/stakercli/daemon/daemoncommands.go index 4abd42d..0d20d97 100644 --- a/cmd/stakercli/daemon/daemoncommands.go +++ b/cmd/stakercli/daemon/daemoncommands.go @@ -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, diff --git a/itest/e2e_test.go b/itest/e2e_test.go index fa4c200..ebc8c14 100644 --- a/itest/e2e_test.go +++ b/itest/e2e_test.go @@ -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 diff --git a/staker/babylontypes.go b/staker/babylontypes.go index f2fff8c..5bebdcd 100644 --- a/staker/babylontypes.go +++ b/staker/babylontypes.go @@ -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) @@ -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) { diff --git a/staker/stakerapp.go b/staker/stakerapp.go index fc244d2..ff6dcbd 100644 --- a/staker/stakerapp.go +++ b/staker/stakerapp.go @@ -622,7 +622,6 @@ func (app *StakerApp) checkTransactionsStatus() error { if alreadyDelegated { app.wg.Add(1) app.activateVerifiedDelegation( - stakerAddress, tx.StakingTx, tx.StakingOutputIndex, txHashCopy, @@ -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, @@ -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,