Skip to content

Commit

Permalink
allow setting custom withdrawal credentials for top up deposits in `g…
Browse files Browse the repository at this point in the history
…enerate_deposits` task
  • Loading branch information
pk910 committed Oct 2, 2024
1 parent e765151 commit 8090baa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/coordinator/tasks/generate_deposits/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,11 @@ func (t *Task) generateDeposit(ctx context.Context, accountIdx uint64, onConfirm
copy(pub[:], validatorPubkey)

switch {
case t.config.WithdrawalCredentials != "":
withdrCreds = ethcommon.FromHex(t.config.WithdrawalCredentials)
case t.config.TopUpDeposit:
withdrCreds = ethcommon.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000")
case t.config.WithdrawalCredentials == "":
default:
withdrAccPath := fmt.Sprintf("m/12381/3600/%d/0", accountIdx)

withdrPrivkey, err2 := util.PrivateKeyFromSeedAndPath(t.valkeySeed, withdrAccPath)
Expand All @@ -337,8 +339,6 @@ func (t *Task) generateDeposit(ctx context.Context, accountIdx uint64, onConfirm
withdrKeyHash := hashing.Hash(withdrPubKey)
withdrCreds = withdrKeyHash[:]
withdrCreds[0] = common.BLS_WITHDRAWAL_PREFIX
default:
withdrCreds = ethcommon.FromHex(t.config.WithdrawalCredentials)
}

data := common.DepositData{
Expand Down

0 comments on commit 8090baa

Please sign in to comment.