mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-21 19:20:38 +00:00
Add PulseChain exit info
This commit is contained in:
parent
b9cd981f28
commit
938133153e
@ -171,11 +171,15 @@ func displayExitInfo(rawExitedKeys [][]byte, trimmedExitedKeys []string) {
|
||||
}
|
||||
|
||||
func formatBeaconChaURL(key []byte) string {
|
||||
// TODO: Add URLs for PulseChain explorer.
|
||||
baseURL := "https://%sbeaconcha.in/validator/%s"
|
||||
pulseChainURL := "https://%s.pulsechain.com/validator/%s"
|
||||
keyWithout0x := hexutil.Encode(key)[2:]
|
||||
|
||||
switch env := params.BeaconConfig().ConfigName; env {
|
||||
case params.PulseChainName:
|
||||
return fmt.Sprintf(pulseChainURL, "beacon", keyWithout0x)
|
||||
case params.PulseChainTestnetV4Name:
|
||||
return fmt.Sprintf(pulseChainURL, "beacon.v4.testnet", keyWithout0x)
|
||||
case params.PraterName, params.GoerliName:
|
||||
return fmt.Sprintf(baseURL, "prater.", keyWithout0x)
|
||||
case params.HoleskyName:
|
||||
|
@ -39,6 +39,14 @@ func TestDisplayExitInfo(t *testing.T) {
|
||||
params.BeaconConfig().ConfigName = params.SepoliaName
|
||||
displayExitInfo([][]byte{key}, []string{string(key)})
|
||||
assert.LogsContain(t, logHook, "https://sepolia.beaconcha.in/validator/3078313233343536")
|
||||
|
||||
params.BeaconConfig().ConfigName = params.PulseChainName
|
||||
displayExitInfo([][]byte{key}, []string{string(key)})
|
||||
assert.LogsContain(t, logHook, "https://beacon.pulsechain.com/validator/3078313233343536")
|
||||
|
||||
params.BeaconConfig().ConfigName = params.PulseChainTestnetV4Name
|
||||
displayExitInfo([][]byte{key}, []string{string(key)})
|
||||
assert.LogsContain(t, logHook, "https://beacon.v4.testnet.pulsechain.com/validator/3078313233343536")
|
||||
}
|
||||
|
||||
func TestDisplayExitInfo_NoKeys(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user