-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: jailing without events. Add square size column (#154)
- Loading branch information
1 parent
35e0555
commit 3b7a45a
Showing
17 changed files
with
203 additions
and
80 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,37 @@ | ||
// SPDX-FileCopyrightText: 2024 PK Lab AG <contact@pklab.io> | ||
// SPDX-License-Identifier: MIT | ||
|
||
package parser | ||
|
||
import ( | ||
"encoding/hex" | ||
"strings" | ||
|
||
"github.com/celenium-io/celestia-indexer/internal/storage" | ||
"github.com/celenium-io/celestia-indexer/pkg/indexer/decode/context" | ||
"github.com/celenium-io/celestia-indexer/pkg/types" | ||
"github.com/shopspring/decimal" | ||
) | ||
|
||
func parseValidatorUpdates(ctx *context.Context, updates []types.ValidatorUpdate) { | ||
for i := range updates { | ||
if updates[i].Power != nil { | ||
continue | ||
} | ||
key := updates[i].PubKey.Sum.Value.Ed25519 | ||
consAddressBytes := types.GetConsAddressBytesFromPubKey(key) | ||
consAddress := strings.ToUpper(hex.EncodeToString(consAddressBytes)) | ||
|
||
jailed := true | ||
ctx.AddJail(storage.Jail{ | ||
Height: ctx.Block.Height, | ||
Time: ctx.Block.Time, | ||
Burned: decimal.Zero, | ||
Validator: &storage.Validator{ | ||
ConsAddress: consAddress, | ||
Stake: decimal.Zero, | ||
Jailed: &jailed, | ||
}, | ||
}) | ||
} | ||
} |
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.