Skip to content

Commit

Permalink
set outputs for check_consensus_validator_status task
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Sep 12, 2024
1 parent 77e70ab commit 762efcb
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/attestantio/go-eth2-client/spec/phase0"
"github.com/ethereum/go-ethereum/common"
"github.com/ethpandaops/assertoor/pkg/coordinator/types"
"github.com/ethpandaops/assertoor/pkg/coordinator/vars"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -160,6 +161,12 @@ func (t *Task) runValidatorStatusCheck() bool {

matchingValidators++

if body, err := vars.GeneralizeData(validator); err == nil {
t.ctx.Outputs.SetVar("validator", body)
} else {
t.logger.Warnf("Failed encoding validator info for validator output: %v", err)
}

if t.config.ValidatorInfoResultVar != "" {
validatorJSON, err := json.Marshal(validator)
if err == nil {
Expand All @@ -176,6 +183,8 @@ func (t *Task) runValidatorStatusCheck() bool {
}
}

t.ctx.Outputs.SetVar("pubkey", fmt.Sprintf("0x%x", validator.Validator.PublicKey[:]))

if t.config.ValidatorPubKeyResultVar != "" {
t.ctx.Vars.SetVar(t.config.ValidatorPubKeyResultVar, fmt.Sprintf("0x%x", validator.Validator.PublicKey[:]))
}
Expand Down

0 comments on commit 762efcb

Please sign in to comment.