From 88297d944984fb0f2f4af6e45b94335830ce7126 Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 2 Dec 2024 16:52:11 +0100 Subject: [PATCH] various small fixes for validator details page --- handlers/validator.go | 7 --- .../validator/consolidationRequests.html | 6 +-- templates/validator/validator.html | 4 +- templates/validator/withdrawalRequests.html | 19 ++------ templates/validator_slots/slots.html | 2 +- templates/validators/validators.html | 2 +- types/models/debug_cache.go | 4 -- types/models/validator.go | 4 -- utils/format.go | 20 ++++++-- utils/templateFucs.go | 47 ++++++++++--------- 10 files changed, 49 insertions(+), 66 deletions(-) delete mode 100644 types/models/debug_cache.go diff --git a/handlers/validator.go b/handlers/validator.go index 8826eca0..bc1e12cd 100644 --- a/handlers/validator.go +++ b/handlers/validator.go @@ -457,16 +457,9 @@ func buildValidatorPageData(validatorIndex uint64, tabView string) (*models.Vali for _, elWithdrawal := range dbElWithdrawals { elWithdrawalData := &models.ValidatorPageDataWithdrawal{ SourceAddr: elWithdrawal.SourceAddress(), - PublicKey: elWithdrawal.ValidatorPubkey(), Amount: elWithdrawal.Amount(), } - if validatorIndex := elWithdrawal.ValidatorIndex(); validatorIndex != nil { - elWithdrawalData.ValidatorValid = true - elWithdrawalData.ValidatorIndex = *validatorIndex - elWithdrawalData.ValidatorName = services.GlobalBeaconService.GetValidatorName(*validatorIndex) - } - if request := elWithdrawal.Request; request != nil { elWithdrawalData.IsIncluded = true elWithdrawalData.SlotNumber = request.SlotNumber diff --git a/templates/validator/consolidationRequests.html b/templates/validator/consolidationRequests.html index 2ac8355f..c7d97c9a 100644 --- a/templates/validator/consolidationRequests.html +++ b/templates/validator/consolidationRequests.html @@ -29,7 +29,7 @@ {{ formatRecentTimeShort $request.Time }}
- {{ ethAddressLink $request.SourceAddr }} + {{ ethAddressLink $request.SourceAddr }}
@@ -37,7 +37,7 @@ {{- if $request.SourceValidatorValid }} - {{ formatValidator $request.SourceValidatorIndex $request.SourceValidatorName }} + {{ formatValidatorWithIndex $request.SourceValidatorIndex $request.SourceValidatorName }} {{- else }}
0x{{ printf "%x" $request.SourcePublicKey }} @@ -49,7 +49,7 @@ {{- if $request.TargetValidatorValid }} - {{ formatValidator $request.TargetValidatorIndex $request.TargetValidatorName }} + {{ formatValidatorWithIndex $request.TargetValidatorIndex $request.TargetValidatorName }} {{- else }}
0x{{ printf "%x" $request.TargetPublicKey }} diff --git a/templates/validator/validator.html b/templates/validator/validator.html index 7d8019d6..892f87fd 100644 --- a/templates/validator/validator.html +++ b/templates/validator/validator.html @@ -1,7 +1,7 @@ {{ define "page" }}
-

Validator {{ formatValidatorWithIndex .Index .Name }}

+

Validator {{ formatValidatorNameWithIndex .Index .Name }}