Skip to content

Commit

Permalink
chore: update babylon new funciton names
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Oct 15, 2024
1 parent 419cb1e commit a704f97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions babylonclient/babyloncontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ func (bc *BabylonController) Params() (*StakingParams, error) {
return nil, err
}

minUnbondingTimeU64 := sdkmath.Max[uint64](
minUnbondingTimeU64 := sdkmath.Max[uint32](
bccParams.CheckpointFinalizationTimeout,
uint64(stakingTrackerParams.MinUnbondingTime),
uint32(stakingTrackerParams.MinUnbondingTime),
)

if minUnbondingTimeU64 > math.MaxUint16 {
Expand Down Expand Up @@ -663,7 +663,7 @@ func (bc *BabylonController) QueryFinalityProvider(btcPubKey *btcec.PublicKey) (
}, nil
}

func (bc *BabylonController) QueryHeaderDepth(headerHash *chainhash.Hash) (uint64, error) {
func (bc *BabylonController) QueryHeaderDepth(headerHash *chainhash.Hash) (uint32, error) {
ctx, cancel := getQueryContext(bc.cfg.Timeout)
defer cancel()

Expand Down
6 changes: 3 additions & 3 deletions babylonclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type BabylonClient interface {
Undelegate(req *UndelegationRequest) (*pv.RelayerTxResponse, error)
QueryFinalityProviders(limit uint64, offset uint64) (*FinalityProvidersClientResponse, error)
QueryFinalityProvider(btcPubKey *btcec.PublicKey) (*FinalityProviderClientResponse, error)
QueryHeaderDepth(headerHash *chainhash.Hash) (uint64, error)
QueryHeaderDepth(headerHash *chainhash.Hash) (uint32, error)
IsTxAlreadyPartOfDelegation(stakingTxHash *chainhash.Hash) (bool, error)
QueryDelegationInfo(stakingTxHash *chainhash.Hash) (*DelegationInfo, error)
}
Expand Down Expand Up @@ -142,9 +142,9 @@ func (m *MockBabylonClient) QueryFinalityProvider(btcPubKey *btcec.PublicKey) (*
}
}

func (m *MockBabylonClient) QueryHeaderDepth(headerHash *chainhash.Hash) (uint64, error) {
func (m *MockBabylonClient) QueryHeaderDepth(headerHash *chainhash.Hash) (uint32, error) {
// return always confirmed depth
return uint64(m.ClientParams.ConfirmationTimeBlocks) + 1, nil
return m.ClientParams.ConfirmationTimeBlocks + 1, nil
}

func (m *MockBabylonClient) IsTxAlreadyPartOfDelegation(stakingTxHash *chainhash.Hash) (bool, error) {
Expand Down
4 changes: 2 additions & 2 deletions staker/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ func parseWatchStakingRequest(
}

// 2. Check wheter slashing tx match staking tx
err = staking.CheckTransactions(
err = staking.CheckSlashingTxMatchFundingTx(
slashingTx,
stakingTx,
stakingOutputIdx,
Expand Down Expand Up @@ -584,7 +584,7 @@ func parseWatchStakingRequest(
return nil, fmt.Errorf("failed to watch staking tx. Unbonding output does not match output produced from provided values")
}

err = staking.CheckTransactions(
err = staking.CheckSlashingTxMatchFundingTx(
slashUnbondingTx,
unbondingTx,
0,
Expand Down

0 comments on commit a704f97

Please sign in to comment.