Skip to content

Commit

Permalink
update babylon version with parameter update
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Sep 5, 2024
1 parent 0682d26 commit 47bf056
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
8 changes: 2 additions & 6 deletions clientcontroller/babylon.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,20 +556,16 @@ func (bc *BabylonController) QueryStakingParams() (*types.StakingParams, error)
}
covenantPks = append(covenantPks, covPk)
}
slashingAddress, err := btcutil.DecodeAddress(stakingParamRes.Params.SlashingAddress, bc.btcParams)
if err != nil {
return nil, err
}

return &types.StakingParams{
ComfirmationTimeBlocks: ckptParamRes.Params.BtcConfirmationDepth,
FinalizationTimeoutBlocks: ckptParamRes.Params.CheckpointFinalizationTimeout,
MinSlashingTxFeeSat: btcutil.Amount(stakingParamRes.Params.MinSlashingTxFeeSat),
CovenantPks: covenantPks,
SlashingAddress: slashingAddress,
SlashingPkScript: stakingParamRes.Params.SlashingPkScript,
CovenantQuorum: stakingParamRes.Params.CovenantQuorum,
SlashingRate: stakingParamRes.Params.SlashingRate,
MinUnbondingTime: stakingParamRes.Params.MinUnbondingTime,
MinUnbondingTime: stakingParamRes.Params.MinUnbondingTimeBlocks,
}, nil
}

Expand Down
14 changes: 7 additions & 7 deletions itest/test_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ type TestDelegationData struct {
DelegatorSig *bbntypes.BIP340Signature
FpPks []*btcec.PublicKey

SlashingAddr string
ChangeAddr string
StakingTime uint16
StakingAmount int64
SlashingPkScript []byte
ChangeAddr string
StakingTime uint16
StakingAmount int64
}

func StartManager(t *testing.T) *TestManager {
Expand Down Expand Up @@ -677,7 +677,7 @@ func (tm *TestManager) InsertBTCDelegation(t *testing.T, fpPks []*btcec.PublicKe
params.CovenantQuorum,
stakingTime,
stakingAmount,
params.SlashingAddress.String(),
params.SlashingPkScript,
params.SlashingRate,
unbondingTime,
)
Expand Down Expand Up @@ -742,7 +742,7 @@ func (tm *TestManager) InsertBTCDelegation(t *testing.T, fpPks []*btcec.PublicKe
wire.NewOutPoint(&stakingTxHash, 0),
unbondingTime,
unbondingValue,
params.SlashingAddress.String(),
params.SlashingPkScript,
params.SlashingRate,
unbondingTime,
)
Expand Down Expand Up @@ -791,7 +791,7 @@ func (tm *TestManager) InsertBTCDelegation(t *testing.T, fpPks []*btcec.PublicKe
SlashingTx: testStakingInfo.SlashingTx,
StakingTxInfo: txInfo,
DelegatorSig: delegatorSig,
SlashingAddr: params.SlashingAddress.String(),
SlashingPkScript: params.SlashingPkScript,
StakingTime: stakingTime,
StakingAmount: stakingAmount,
}
Expand Down
5 changes: 3 additions & 2 deletions types/stakingparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ type StakingParams struct {
// Bitcoin public keys of the covenant committee
CovenantPks []*btcec.PublicKey

// Address to which slashing transactions are sent
SlashingAddress btcutil.Address
// The pk_script expected in slashing output i.e., the first
// output of slashing transaction
SlashingPkScript []byte

// Minimum number of signatures needed for the covenant multisignature
CovenantQuorum uint32
Expand Down

0 comments on commit 47bf056

Please sign in to comment.