Skip to content

Commit

Permalink
chore: removed NeedsToSign from /status
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Oct 4, 2024
1 parent b08a64f commit 26e6e1a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 32 deletions.
7 changes: 3 additions & 4 deletions pkg/reporters/discord/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ func (reporter *Reporter) GetStatusCommand() *Command {

for index, entry := range userEntries {
entries[index] = statusEntry{
IsActive: entry.IsActive,
NeedsToSign: entry.NeedsToSign,
Validator: entry.Validator,
Link: reporter.Config.ExplorerConfig.GetValidatorLink(entry.Validator),
IsActive: entry.IsActive,
Validator: entry.Validator,
Link: reporter.Config.ExplorerConfig.GetValidatorLink(entry.Validator),

Check warning on line 55 in pkg/reporters/discord/status.go

View check run for this annotation

Codecov / codecov/patch

pkg/reporters/discord/status.go#L53-L55

Added lines #L53 - L55 were not covered by tests
}

if entry.IsActive && !entry.Validator.Jailed {
Expand Down
13 changes: 1 addition & 12 deletions pkg/reporters/discord/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ type notifierRender struct {

type statusEntry struct {
IsActive bool
NeedsToSign bool
Validator *types.Validator
Error error
SigningInfo types.SignatureInto
Expand All @@ -98,17 +97,7 @@ func (s statusRender) FormatNotSignedPercent(entry statusEntry) string {
}

func (s statusRender) FormatVotingPower(entry statusEntry) string {
text := fmt.Sprintf("%.2f%% VP", entry.Validator.VotingPowerPercent*100)

if s.ChainConfig.IsConsumer.Bool {
if entry.NeedsToSign {
text += ", needs to sign blocks"
} else {
text += ", does not need to sign blocks"
}
}

return text
return fmt.Sprintf("%.2f%% VP", entry.Validator.VotingPowerPercent*100)

Check warning on line 100 in pkg/reporters/discord/types.go

View check run for this annotation

Codecov / codecov/patch

pkg/reporters/discord/types.go#L100

Added line #L100 was not covered by tests
}

type helpRender struct {
Expand Down
7 changes: 3 additions & 4 deletions pkg/reporters/telegram/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ func (reporter *Reporter) HandleStatus(c tele.Context) error {

for index, entry := range userEntries {
entries[index] = statusEntry{
Validator: entry.Validator,
Link: reporter.Config.ExplorerConfig.GetValidatorLink(entry.Validator),
IsActive: entry.IsActive,
NeedsToSign: entry.NeedsToSign,
Validator: entry.Validator,
Link: reporter.Config.ExplorerConfig.GetValidatorLink(entry.Validator),
IsActive: entry.IsActive,

Check warning on line 46 in pkg/reporters/telegram/status.go

View check run for this annotation

Codecov / codecov/patch

pkg/reporters/telegram/status.go#L44-L46

Added lines #L44 - L46 were not covered by tests
}

if entry.IsActive && !entry.Validator.Jailed {
Expand Down
13 changes: 1 addition & 12 deletions pkg/reporters/telegram/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func (r paramsRender) FormatSnapshotInterval() string {

type statusEntry struct {
IsActive bool
NeedsToSign bool
Validator *types.Validator
Error error
SigningInfo types.SignatureInto
Expand All @@ -91,15 +90,5 @@ func (s statusRender) FormatNotSignedPercent(entry statusEntry) string {
}

func (s statusRender) FormatVotingPower(entry statusEntry) string {
text := fmt.Sprintf("%.2f%% VP", entry.Validator.VotingPowerPercent*100)

if s.ChainConfig.IsConsumer.Bool {
if entry.NeedsToSign {
text += ", needs to sign blocks"
} else {
text += ", does not need to sign blocks"
}
}

return text
return fmt.Sprintf("%.2f%% VP", entry.Validator.VotingPowerPercent*100)

Check warning on line 93 in pkg/reporters/telegram/types.go

View check run for this annotation

Codecov / codecov/patch

pkg/reporters/telegram/types.go#L93

Added line #L93 was not covered by tests
}

0 comments on commit 26e6e1a

Please sign in to comment.