From fdc155ef2bad18200d34cb697d8a337f1db13a5b Mon Sep 17 00:00:00 2001 From: RafilxTenfen Date: Fri, 22 Nov 2024 17:40:24 -0300 Subject: [PATCH] chore: fix comment --- cmd/stakercli/daemon/daemoncommands.go | 14 +++++--------- itest/e2e_test.go | 7 +------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/cmd/stakercli/daemon/daemoncommands.go b/cmd/stakercli/daemon/daemoncommands.go index c3b26d6..f09bb54 100644 --- a/cmd/stakercli/daemon/daemoncommands.go +++ b/cmd/stakercli/daemon/daemoncommands.go @@ -140,10 +140,11 @@ var stakeCmd = cli.Command{ } var stakeFromPhase1Cmd = cli.Command{ - Name: "stake-from-phase1", - ShortName: "stfp1", - Usage: "stakercli stake-from-phase1 [fullpath/to/global_parameters.json]", - Description: "Creates a Babylon BTC delegation transaction from the Phase1 BTC staking tx", + Name: "stake-from-phase1", + ShortName: "stfp1", + Usage: "\nstakercli daemon stake-from-phase1 [fullpath/to/global_parameters.json]" + + " --staking-transaction-hash [txHashHex] --staker-address [btcStakerAddrHex] --tx-inclusion-height [blockHeightTxInclusion]", + Description: "Creates a Babylon BTC delegation transaction from the Phase1 BTC staking transaction", Flags: []cli.Flag{ cli.StringFlag{ Name: stakingDaemonAddressFlag, @@ -379,7 +380,6 @@ func stakeFromPhase1TxBTC(ctx *cli.Context) error { } sctx := context.Background() - stakingTransactionHash := ctx.String(stakingTransactionHashFlag) if len(stakingTransactionHash) == 0 { return errors.New("staking tx hash hex is empty") @@ -394,10 +394,6 @@ func stakeFromPhase1TxBTC(ctx *cli.Context) error { return fmt.Errorf("json file input %s does not exist", inputGlobalParamsFilePath) } - // QUEST: should the params be loaded from the chain? - // maybe it is good to still use the global as input as this is actually - // a phase1 tx being transitioned, so the user would already have the global - // params in hand to create the BTC staking tx globalParams, err := parser.NewParsedGlobalParamsFromFile(inputGlobalParamsFilePath) if err != nil { return fmt.Errorf("error parsing file %s: %w", inputGlobalParamsFilePath, err) diff --git a/itest/e2e_test.go b/itest/e2e_test.go index 7298f0b..c995f68 100644 --- a/itest/e2e_test.go +++ b/itest/e2e_test.go @@ -956,13 +956,8 @@ func TestStakeFromPhase1(t *testing.T) { tm.insertAllMinedBlocksToBabylon(t) tm.createAndRegisterFinalityProviders(t, testStakingData) - // tmBTC.WalletAddrInfo. stakerAddrStr := tmBTC.MinerAddr.String() - // stakerAddrStr := tmBTC.WalletPubKey - // stakerAddrStr := btcStakerPkHex stkTxHash := signedStkTx.TxHash().String() - - // miner address and the staker addr are the same guy, maybe not res, err := tmStakerApp.StakerClient.BtcDelegationFromBtcStakingTx(ctx, stakerAddrStr, stkTxHash, lastParamsVersioned) require.NoError(t, err) require.NotNil(t, res) @@ -978,7 +973,7 @@ func TestStakeFromPhase1(t *testing.T) { pend, err := tm.BabylonClient.QueryPendingBTCDelegations() require.NoError(t, err) require.Len(t, pend, 1) - // need to activate delegation to unbond + tm.insertCovenantSigForDelegation(t, pend[0]) tm.waitForStakingTxState(t, txHash, proto.TransactionState_DELEGATION_ACTIVE)