-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* replace custom type with type from babylon event
- Loading branch information
1 parent
6c93870
commit cc5f0db
Showing
29 changed files
with
612 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package bbnclient | ||
|
||
import ( | ||
"encoding/hex" | ||
|
||
checkpointtypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types" | ||
stakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" | ||
) | ||
|
||
// StakingParams represents the staking parameters of the BBN chain | ||
// Reference: https://github.com/babylonlabs-io/babylon/blob/main/proto/babylon/btcstaking/v1/params.proto | ||
type StakingParams struct { | ||
CovenantPks []string | ||
CovenantQuorum uint32 | ||
MinStakingValueSat int64 | ||
MaxStakingValueSat int64 | ||
MinStakingTimeBlocks uint32 | ||
MaxStakingTimeBlocks uint32 | ||
SlashingPkScript string | ||
MinSlashingTxFeeSat int64 | ||
SlashingRate string | ||
MinUnbondingTimeBlocks uint32 | ||
UnbondingFeeSat int64 | ||
MinCommissionRate string | ||
MaxActiveFinalityProviders uint32 | ||
DelegationCreationBaseGasFee uint64 | ||
} | ||
|
||
func FromBbnStakingParams(params stakingtypes.Params) *StakingParams { | ||
return &StakingParams{ | ||
CovenantPks: params.CovenantPksHex(), | ||
CovenantQuorum: params.CovenantQuorum, | ||
MinStakingValueSat: params.MinStakingValueSat, | ||
MaxStakingValueSat: params.MaxStakingValueSat, | ||
MinStakingTimeBlocks: params.MinStakingTimeBlocks, | ||
MaxStakingTimeBlocks: params.MaxStakingTimeBlocks, | ||
SlashingPkScript: hex.EncodeToString(params.SlashingPkScript), | ||
MinSlashingTxFeeSat: params.MinSlashingTxFeeSat, | ||
SlashingRate: params.SlashingRate.String(), | ||
MinUnbondingTimeBlocks: params.MinUnbondingTimeBlocks, | ||
UnbondingFeeSat: params.UnbondingFeeSat, | ||
MinCommissionRate: params.MinCommissionRate.String(), | ||
MaxActiveFinalityProviders: params.MaxActiveFinalityProviders, | ||
DelegationCreationBaseGasFee: params.DelegationCreationBaseGasFee, | ||
} | ||
} | ||
|
||
type CheckpointParams = checkpointtypes.Params |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.