Skip to content

Commit

Permalink
feat: fix name
Browse files Browse the repository at this point in the history
  • Loading branch information
yemille committed Nov 23, 2024
1 parent 795c4da commit b75bc11
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions indexer/beacon/canonical.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (indexer *Indexer) computeCanonicalChain() bool {
}

indexer.logger.Infof(
"fork %v: votes in last 2 epochs: %v ETH (%v), head: %v (%v)",
"fork %v: votes in last 2 epochs: %v OR (%v), head: %v (%v)",
fork.ForkId,
forkVotes/EtherGweiFactor,
strings.Join(participationStr, ", "),
Expand Down Expand Up @@ -201,7 +201,7 @@ func (indexer *Indexer) computeCanonicalChain() bool {
}

indexer.logger.Infof(
"fallback fork %v votes in last %v epochs: %v ETH (%v), head: %v (%v)",
"fallback fork %v votes in last %v epochs: %v OR (%v), head: %v (%v)",
headBlock.forkId,
aggregateEpochs,
forkVotes/EtherGweiFactor,
Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/epochstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type EpochStatsPacked struct {
// EpochStatsPackedValidator holds the packed values for an active validator.
type EpochStatsPackedValidator struct {
ValidatorIndexOffset uint32 // offset to the previous index in the list (this is smaller than storing the full validator index)
EffectiveBalanceEth uint16 // effective balance in full ETH
EffectiveBalanceEth uint16 // effective balance in full OR
}

// newEpochStats creates a new EpochStats instance.
Expand Down
8 changes: 4 additions & 4 deletions indexer/beacon/finalization.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,25 +401,25 @@ func (indexer *Indexer) finalizeEpoch(epoch phase0.Epoch, justifiedRoot phase0.R
indexer.logger.Infof("completed epoch %v finalization (process: %v ms, load: %v s, write: %v ms, clean: %v ms)", epoch, t1dur.Milliseconds(), t1loading.Seconds(), t2dur.Milliseconds(), time.Since(t1).Milliseconds())
indexer.logger.Infof("epoch %v blocks: %v canonical, %v orphaned", epoch, len(canonicalBlocks), len(orphanedBlocks))
if epochStatsValues != nil {
indexer.logger.Infof("epoch %v stats: %v validators (%v ETH)", epoch, epochStatsValues.ActiveValidators, epochStatsValues.EffectiveBalance/EtherGweiFactor)
indexer.logger.Infof("epoch %v stats: %v validators (%v OR)", epoch, epochStatsValues.ActiveValidators, epochStatsValues.EffectiveBalance/EtherGweiFactor)
indexer.logger.Infof(
"epoch %v votes: target %v + %v = %v ETH (%.2f%%)",
"epoch %v votes: target %v + %v = %v OR (%.2f%%)",
epoch,
epochVotes.CurrentEpoch.TargetVoteAmount/EtherGweiFactor,
epochVotes.NextEpoch.TargetVoteAmount/EtherGweiFactor,
(epochVotes.CurrentEpoch.TargetVoteAmount+epochVotes.NextEpoch.TargetVoteAmount)/EtherGweiFactor,
epochVotes.TargetVotePercent,
)
indexer.logger.Infof(
"epoch %v votes: head %v + %v = %v ETH (%.2f%%)",
"epoch %v votes: head %v + %v = %v OR (%.2f%%)",
epoch,
epochVotes.CurrentEpoch.HeadVoteAmount/EtherGweiFactor,
epochVotes.NextEpoch.HeadVoteAmount/EtherGweiFactor,
(epochVotes.CurrentEpoch.HeadVoteAmount+epochVotes.NextEpoch.HeadVoteAmount)/EtherGweiFactor,
epochVotes.HeadVotePercent,
)
indexer.logger.Infof(
"epoch %v votes: total %v + %v = %v ETH (%.2f%%)",
"epoch %v votes: total %v + %v = %v OR (%.2f%%)",
epoch,
epochVotes.CurrentEpoch.TotalVoteAmount/EtherGweiFactor,
epochVotes.NextEpoch.TotalVoteAmount/EtherGweiFactor,
Expand Down
12 changes: 6 additions & 6 deletions templates/epoch/epoch.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ <h1 class="h4 my-3 mb-md-0 h1-pager">
<div class="col-md-3">Correct Target Votes:</div>
<div class="col-md-9">
<div>
{{ formatEthAddCommasFromGwei .TargetVoted }} ETH of
{{ formatEthAddCommasFromGwei .EligibleEther }} ETH
{{ formatEthAddCommasFromGwei .TargetVoted }} OR of
{{ formatEthAddCommasFromGwei .EligibleEther }} OR
<small class="text-muted ml-1">({{ formatFloat .TargetVoteParticipation 2 }}%)</small>
</div>
<div class="progress" style="height: 5px; width: 250px;">
Expand All @@ -86,8 +86,8 @@ <h1 class="h4 my-3 mb-md-0 h1-pager">
<div class="col-md-3">Correct Head Votes:</div>
<div class="col-md-9">
<div>
{{ formatEthAddCommasFromGwei .HeadVoted }} ETH of
{{ formatEthAddCommasFromGwei .EligibleEther }} ETH
{{ formatEthAddCommasFromGwei .HeadVoted }} OR of
{{ formatEthAddCommasFromGwei .EligibleEther }} OR
<small class="text-muted ml-1">({{ formatFloat .HeadVoteParticipation 2 }}%)</small>
</div>
<div class="progress" style="height: 5px; width: 250px;">
Expand All @@ -99,8 +99,8 @@ <h1 class="h4 my-3 mb-md-0 h1-pager">
<div class="col-md-3">Total Votes:</div>
<div class="col-md-9">
<div>
{{ formatEthAddCommasFromGwei .TotalVoted }} ETH of
{{ formatEthAddCommasFromGwei .EligibleEther }} ETH
{{ formatEthAddCommasFromGwei .TotalVoted }} OR of
{{ formatEthAddCommasFromGwei .EligibleEther }} OR
<small class="text-muted ml-1">({{ formatFloat .TotalVoteParticipation 2 }}%)</small>
</div>
<div class="progress" style="height: 5px; width: 250px;">
Expand Down
2 changes: 1 addition & 1 deletion templates/included_deposits/included_deposits.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h1 class="h4 mb-1 mb-md-0">
<input name="f.maxa" type="number" class="form-control" placeholder="Max Amount" aria-label="Max Amount" aria-describedby="basic-addon1" value="{{ if gt .FilterMaxAmount 0 }}{{ .FilterMaxAmount }}{{ end }}">
</div>
<div class="text-center filter-amount-separator">
ETH
OR
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/index/networkOverview.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ <h5 class="font-weight-normal mb-0">
<div class="p-2">
<div class="text-secondary mb-0">Staked Ether</div>
<h5 class="font-weight-normal mb-0">
<span data-bs-toggle="tooltip" data-bs-placement="top" title="The sum of all effective balances" data-bind="text: $root.formatEth(eligible()) + ' ETH'">{{ formatEthAddCommasFromGwei .TotalEligibleEther }} ETH</span>
<span data-bs-toggle="tooltip" data-bs-placement="top" title="The sum of all effective balances" data-bind="text: $root.formatEth(eligible()) + ' OR'">{{ formatEthAddCommasFromGwei .TotalEligibleEther }} OR</span>
</h5>
</div>
<div class="text-end p-2">
<div class="text-secondary mb-0">Average Balance</div>
<h5 class="font-weight-normal mb-0">
<span data-bs-toggle="tooltip" data-bs-placement="top" title="The average current balance of all validators staked" data-bind="text: $root.formatEth(avg_balance()) + ' ETH'">{{ formatEthFromGwei .AverageValidatorBalance }}</span>
<span data-bs-toggle="tooltip" data-bs-placement="top" title="The average current balance of all validators staked" data-bind="text: $root.formatEth(avg_balance()) + ' OR'">{{ formatEthFromGwei .AverageValidatorBalance }}</span>
</h5>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/index/recentEpochs.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h5 class="card-title d-flex justify-content-between align-items-center" style="
<th>Epoch</th>
<th data-timecol="duration">Time</th>
<th>Final</th>
<th>Eligible (ETH)</th>
<th>Eligible (OR)</th>
<th>Voted</th>
</tr>
</thead>
Expand Down
2 changes: 1 addition & 1 deletion templates/initiated_deposits/initiated_deposits.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1 class="h4 mb-1 mb-md-0">
<input name="f.maxa" type="number" class="form-control" placeholder="Max Amount" aria-label="Max Amount" aria-describedby="basic-addon1" value="{{ if gt .FilterMaxAmount 0 }}{{ .FilterMaxAmount }}{{ end }}">
</div>
<div class="text-center filter-amount-separator">
ETH
OR
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/slot/transactions.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<span class="badge rounded-pill text-bg-secondary" style="font-size: 12px; font-weight: 500;" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="call {{ $transaction.FuncBytes }}">{{ $transaction.FuncName }}</span>
{{ end }}
</td>
<td>{{ $transaction.Value }} ETH</td>
<td>{{ $transaction.Value }} OR</td>
<td>
{{ if gt $transaction.DataLen 0 }}
<span class="badge rounded-pill text-bg-secondary" style="font-size: 12px; font-weight: 500;">{{ $transaction.DataLen }} B</span>
Expand Down
2 changes: 1 addition & 1 deletion templates/submit_deposit/submit_deposit.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1 class="h4 mb-1 mb-md-0">
name: "{{ .NetworkName }}",
rpcUrl: "{{ .PublicRPCUrl }}",
tokenName: "Ethereum",
tokenSymbol: "ETH",
tokenSymbol: "OR",
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion templates/validator/validator.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h1 class="h4 mb-1 mb-md-0"><i class="fas fa-table mx-2"></i> Validator {{ forma
<div class="row border-bottom p-2 mx-0">
<div class="col-md-2"><span data-bs-toggle="tooltip" data-bs-placement="top" title="Represents the full balance for this validator (Epoch {{ .CurrentEpoch }})">Effective Balance:</span></div>
<div class="col-md-10">
{{ formatEthAddCommasFromGwei .EffectiveBalance }} ETH
{{ formatEthAddCommasFromGwei .EffectiveBalance }} OR
</div>
</div>
<div class="row border-bottom p-2 mx-0">
Expand Down
2 changes: 1 addition & 1 deletion templates/validators/validators.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ <h1 class="h4 mb-1 mb-md-0"><i class="fas fa-table mx-2"></i> Validators Overvie
<tr>
<td><a href="/validator/{{ $validator.Index }}">{{ formatValidatorWithIndex $validator.Index $validator.Name }}</a></td>
<td><a href="/validator/0x{{ printf "%x" $validator.PublicKey }}" class="text-truncate d-inline-block" style="max-width: 200px">0x{{ printf "%x" $validator.PublicKey }}</a></td>
<td>{{ formatEthFromGwei $validator.Balance }} ({{ formatEthAddCommasFromGwei $validator.EffectiveBalance }} ETH)</td>
<td>{{ formatEthFromGwei $validator.Balance }} ({{ formatEthAddCommasFromGwei $validator.EffectiveBalance }} OR)</td>
<td>
{{- $validator.State -}}
{{- if $validator.ShowUpcheck -}}
Expand Down
6 changes: 3 additions & 3 deletions ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const DepositEntry = (props: IDepositEntryProps): React.ReactElement => {
{formatWithdrawalHash(props.deposit.withdrawal_credentials)}
</td>
<td>
{formatAmount(props.deposit.amount, chain?.nativeCurrency?.symbol || "ETH")}
{formatAmount(props.deposit.amount, chain?.nativeCurrency?.symbol || "OR")}
{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 OR and 0x01 withdrawal credentials. Please note, that your validator will be running with a max effective balance of 32 OR. The excess Balance will almost immediatly be withdrawn.">
<i className="fa fa-exclamation-triangle"></i>
</span>
)}
Expand Down Expand Up @@ -177,7 +177,7 @@ const DepositEntry = (props: IDepositEntryProps): React.ReactElement => {
</div>
<div className="tx-details-value">
<div className="d-flex">
<span className="flex-grow-1 text-truncate">{toReadableAmount(tx.amount, 9, "ETH", 0)}</span>
<span className="flex-grow-1 text-truncate">{toReadableAmount(tx.amount, 9, "OR", 0)}</span>
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions utils/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ import (

func FormatETH(num string) string {
floatNum, _ := strconv.ParseFloat(num, 64)
return fmt.Sprintf("%.4f", floatNum/math.Pow10(18)) + " ETH"
return fmt.Sprintf("%.4f", floatNum/math.Pow10(18)) + " OR"
}

func FormatETHFromGwei(gwei uint64) string {
return fmt.Sprintf("%.4f", float64(gwei)/math.Pow10(9)) + " ETH"
return fmt.Sprintf("%.4f", float64(gwei)/math.Pow10(9)) + " OR"
}

func FormatETHFromGweiShort(gwei uint64) string {
return fmt.Sprintf("%.4f", float64(gwei)/math.Pow10(9))
}

func FormatFullETHFromGwei(gwei uint64) string {
return fmt.Sprintf("%v ETH", uint64(float64(gwei)/math.Pow10(9)))
return fmt.Sprintf("%v OR", uint64(float64(gwei)/math.Pow10(9)))
}

func FormatETHAddCommasFromGwei(gwei uint64) template.HTML {
Expand Down Expand Up @@ -172,7 +172,7 @@ func formatAmount(amount *big.Int, unit string, digits int, maxPreCommaDigitsBef
// define display unit & digits used per unit max
displayUnit := " " + unit
var unitDigits int
if unit == "ETH" || unit == "Ether" {
if unit == "OR" || unit == "Ether" {
unitDigits = 18
} else if unit == "GWei" {
unitDigits = 9
Expand Down

0 comments on commit b75bc11

Please sign in to comment.