Skip to content

Commit

Permalink
Merge pull request #244 from ethpandaops/pk910/spell-check
Browse files Browse the repository at this point in the history
add `typos` spell check workflow & fix various typos
  • Loading branch information
pk910 authored Feb 13, 2025
2 parents adb0f7d + dfd57b7 commit 63802c1
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 24 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/check-typos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check typos

on:
pull_request:
branches:
- master

jobs:
check-typos:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for typos
uses: crate-ci/[email protected]

9 changes: 9 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

[files]
extend-exclude = ["static/**/*","ui-package/node_modules/**/*", "ui-package/dist/*", "go.mod", "go.sum"]

[default]
check-filename = false

[default.extend-words]
CoSE = "CoSE"
2 changes: 1 addition & 1 deletion clients/execution/clientlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (client *Client) checkClient() error {
client.logger.Warnf("error updating node peers: %v", err)
}

// get & comare chain specs
// get & compare chain specs
specs, err := client.rpcClient.GetChainSpec(ctx)
if err != nil {
return fmt.Errorf("error while fetching specs: %v", err)
Expand Down
8 changes: 4 additions & 4 deletions db/txsignatures.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func InsertTxFunctionSignature(txFuncSig *dbtypes.TxFunctionSignature, tx *sqlx.
}

func GetUnknownFunctionSignatures(sigBytes []types.TxSignatureBytes) []*dbtypes.TxUnknownFunctionSignature {
unknwonFnSigs := []*dbtypes.TxUnknownFunctionSignature{}
unknownFnSigs := []*dbtypes.TxUnknownFunctionSignature{}
if len(sigBytes) == 0 {
return unknwonFnSigs
return unknownFnSigs
}
var sql strings.Builder
fmt.Fprintf(&sql, `
Expand All @@ -79,12 +79,12 @@ func GetUnknownFunctionSignatures(sigBytes []types.TxSignatureBytes) []*dbtypes.
argIdx += 1
}
fmt.Fprintf(&sql, ")")
err := ReaderDb.Select(&unknwonFnSigs, sql.String(), args...)
err := ReaderDb.Select(&unknownFnSigs, sql.String(), args...)
if err != nil {
logger.Errorf("Error while fetching unknown function signatures: %v", err)
return nil
}
return unknwonFnSigs
return unknownFnSigs
}

func InsertUnknownFunctionSignatures(txUnknownSigs []*dbtypes.TxUnknownFunctionSignature, tx *sqlx.Tx) error {
Expand Down
6 changes: 3 additions & 3 deletions handlers/slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,12 +741,12 @@ func getSlotPageBlockData(blockData *services.CombinedBlockResponse, epochStatsV
return pageData
}

func getSlotPageTransactions(pageData *models.SlotPageBlockData, tranactions []bellatrix.Transaction) {
func getSlotPageTransactions(pageData *models.SlotPageBlockData, transactions []bellatrix.Transaction) {
pageData.Transactions = make([]*models.SlotPageTransaction, 0)
sigLookupBytes := []types.TxSignatureBytes{}
sigLookupMap := map[types.TxSignatureBytes][]*models.SlotPageTransaction{}

for idx, txBytes := range tranactions {
for idx, txBytes := range transactions {
var tx ethtypes.Transaction

err := tx.UnmarshalBinary(txBytes)
Expand Down Expand Up @@ -800,7 +800,7 @@ func getSlotPageTransactions(pageData *models.SlotPageBlockData, tranactions []b
txData.FuncName = "transfer"
}
}
pageData.TransactionsCount = uint64(len(tranactions))
pageData.TransactionsCount = uint64(len(transactions))

if len(sigLookupBytes) > 0 {
sigLookups := services.GlobalTxSignaturesService.LookupSignatures(sigLookupBytes)
Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Block struct {
processedActivity uint8
}

// BlockBodyIndex holds important block propoerties that are used as index for cache lookups.
// BlockBodyIndex holds important block properties that are used as index for cache lookups.
// this structure should be preserved after pruning, so the block is still identifiable.
type BlockBodyIndex struct {
Graffiti [32]byte
Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/epochcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

// epochStatsKey is the primary key for EpochStats entries in cache.
// consists of dependendRoot (32 byte) and epoch (8 byte).
// consists of dependentRoot (32 byte) and epoch (8 byte).
type epochStatsKey [32 + 8]byte

// generate epochStatsKey from epoch and dependentRoot
Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/epochstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func (v *EpochStatsValues) GetEffectiveBalance(index duties.ActiveIndiceIndex) p
return phase0.Gwei(v.EffectiveBalances[index]) * EtherGweiFactor
}

// GetDbEpoch returns the database Epoch representaion for the EpochStats.
// GetDbEpoch returns the database Epoch representation for the EpochStats.
func (es *EpochStats) GetDbEpoch(indexer *Indexer, headBlock *Block) *dbtypes.Epoch {
chainState := indexer.consensusPool.GetChainState()
if headBlock == nil {
Expand Down
6 changes: 2 additions & 4 deletions indexer/beacon/epochvotes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

// epochVotesKey is the primary key for EpochVotes entries in cache.
// consists of dependendRoot (32 byte), epoch (8 byte), highestRoot (32 byte) and blockCount/hasValues (1 byte).
// consists of dependentRoot (32 byte), epoch (8 byte), highestRoot (32 byte) and blockCount/hasValues (1 byte).
type epochVotesKey [32 + 8 + 32 + 1]byte

// generate epochStatsKey from epoch and dependentRoot
Expand Down Expand Up @@ -202,9 +202,7 @@ func (indexer *Indexer) aggregateEpochVotesAndActivity(epoch phase0.Epoch, chain
} else {
votes.CurrentEpoch.TargetVoteAmount += voteAmount
}
} /*else {
indexer.logger.Infof("vote target missmatch %v != 0x%x", attData.Target.Root, targetRoot)
}*/
}
parentRoot := block.GetParentRoot()

if parentRoot != nil && bytes.Equal(attData.BeaconBlockRoot[:], parentRoot[:]) {
Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/validatorcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type validatorCache struct {
}

// validatorDiffKey is the primary key for validatorDiff entries in cache.
// consists of dependendRoot (32 byte) and epoch (8 byte).
// consists of dependentRoot (32 byte) and epoch (8 byte).
type validatorDiffKey [32 + 8]byte

// generate validatorDiffKey from epoch and dependentRoot
Expand Down
2 changes: 1 addition & 1 deletion templates/clients/clients_el.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2 class="accordion-header">
<div class="card-body px-0 peer-nodemap-menu">
<div class="btn-group btn-group-sm" role="group" aria-label="Network layouts" style="position: absolute; bottom: 5px; right: 10px;">
<button type="button" class="btn btn-secondary" disabled>Layouts</button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Cose" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.fcose(data.nodes.length))'><i class="fa-solid fa-share-alt"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="CoSE" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.fcose(data.nodes.length))'><i class="fa-solid fa-share-alt"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Circle" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.circle())'><i class="fa-solid fa-circle"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Grid" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.grid())'><i class="fa-solid fa-th"></i></button>
<button type="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Concentric" class="btn btn-secondary" onclick='$_network.fitAnimated(peerGraph,$_network.layouts.concentric(data.nodes.length))'><i class="fa-solid fa-sun"></i></button>
Expand Down
6 changes: 3 additions & 3 deletions types/models/clients_cl.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type ClientCLPageDataPeerDASWarnings struct {
MissingCGCFromENRPeers []string `json:"missing_cgc_from_enr_peers"`
// MissingSpecValues indicates that wer were unable to parse the spec values, thus using defaults
MissingSpecValues bool `json:"missing_spec_values"`
// MissingPeersOnColum
// MissingPeersOnColumn
EmptyColumns []uint64 `json:"missing_peers_on_column"`
}

Expand Down Expand Up @@ -90,10 +90,10 @@ type ClientCLPageDataNode struct {
PeerID string `json:"peer_id"`
NodeID string `json:"node_id"`
Type string `json:"type"` // "internal" or "external" . internal nodes are clients, external nodes are peers of clients
Alias string `json:"alias"` // only relevent for internal peers (clients)
Alias string `json:"alias"` // only relevant for internal peers (clients)
ENR string `json:"enr"`
ENRKeyValues []*ClientCLPageDataNodeENRValue `json:"enr_kv"`
Peers []*ClientCLPageDataNodePeers `json:"peers"` // only relevent for internal peers
Peers []*ClientCLPageDataNodePeers `json:"peers"` // only relevant for internal peers
PeerDAS *ClientCLPageDataNodePeerDAS `json:"peer_das"`
PeersIn []string `json:"peers_in"`
PeersOut []string `json:"peers_out"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const DepositEntry = (props: IDepositEntryProps): React.ReactElement => {
<td>
{formatAmount(props.deposit.amount, chain?.nativeCurrency?.symbol || "ETH")}
{props.deposit.amount > 32000000000 && props.deposit.withdrawal_credentials.substring(0, 2) === "01" && (
<span className="text-warning ms-2" style={{fontSize: "0.9em"}} data-bs-toggle="tooltip" data-bs-placement="top" title="You're trying to submit a validator key with >32 ETH and 0x01 withdrawal credentials. Please note, that your validator will be running with a max effective balance of 32 ETH. The excess Balance will almost immediatly be withdrawn.">
<span className="text-warning ms-2" style={{fontSize: "0.9em"}} data-bs-toggle="tooltip" data-bs-placement="top" title="You're trying to submit a validator key with >32 ETH and 0x01 withdrawal credentials. Please note, that your validator will be running with a max effective balance of 32 ETH. The excess Balance will almost immediately be withdrawn.">
<i className="fa fa-exclamation-triangle"></i>
</span>
)}
Expand Down
6 changes: 3 additions & 3 deletions utils/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func FormatFloat(num float64, precision int) string {
return string(r)
}

func FormatAddCommasFormated(num float64, precision uint) template.HTML {
func FormatAddCommasFormatted(num float64, precision uint) template.HTML {
p := message.NewPrinter(language.English)
s := p.Sprintf(fmt.Sprintf("%%.%vf", precision), num)
if precision > 0 {
Expand All @@ -57,8 +57,8 @@ func FormatAddCommasFormated(num float64, precision uint) template.HTML {
return template.HTML(strings.ReplaceAll(string([]rune(p.Sprintf(s, num))), ",", `<span class="thousands-separator"></span>`))
}

func FormatBigNumberAddCommasFormated(val hexutil.Big, precision uint) template.HTML {
return FormatAddCommasFormated(float64(val.ToInt().Int64()), 0)
func FormatBigNumberAddCommasFormatted(val hexutil.Big, precision uint) template.HTML {
return FormatAddCommasFormatted(float64(val.ToInt().Int64()), 0)
}

func FormatAddCommas(n uint64) template.HTML {
Expand Down

0 comments on commit 63802c1

Please sign in to comment.