Skip to content

Commit

Permalink
chore: fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Nov 22, 2024
1 parent 75c02d3 commit fdc155e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
14 changes: 5 additions & 9 deletions cmd/stakercli/daemon/daemoncommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand All @@ -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)
Expand Down
7 changes: 1 addition & 6 deletions itest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down

0 comments on commit fdc155e

Please sign in to comment.