From b75bc11b131fabb301b05dedea3ddee8b93102a3 Mon Sep 17 00:00:00 2001 From: yemille Date: Sat, 23 Nov 2024 11:30:13 +0800 Subject: [PATCH] feat: fix name --- indexer/beacon/canonical.go | 4 ++-- indexer/beacon/epochstats.go | 2 +- indexer/beacon/finalization.go | 8 ++++---- templates/epoch/epoch.html | 12 ++++++------ templates/included_deposits/included_deposits.html | 2 +- templates/index/networkOverview.html | 4 ++-- templates/index/recentEpochs.html | 2 +- templates/initiated_deposits/initiated_deposits.html | 2 +- templates/slot/transactions.html | 2 +- templates/submit_deposit/submit_deposit.html | 2 +- templates/validator/validator.html | 2 +- templates/validators/validators.html | 2 +- .../components/SubmitDepositsForm/DepositEntry.tsx | 6 +++--- utils/format.go | 8 ++++---- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/indexer/beacon/canonical.go b/indexer/beacon/canonical.go index 1a68f4b..b50b6e6 100644 --- a/indexer/beacon/canonical.go +++ b/indexer/beacon/canonical.go @@ -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, ", "), @@ -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, diff --git a/indexer/beacon/epochstats.go b/indexer/beacon/epochstats.go index d83f1c6..f6319fc 100644 --- a/indexer/beacon/epochstats.go +++ b/indexer/beacon/epochstats.go @@ -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. diff --git a/indexer/beacon/finalization.go b/indexer/beacon/finalization.go index f3ea3bf..bb3a8d7 100644 --- a/indexer/beacon/finalization.go +++ b/indexer/beacon/finalization.go @@ -401,9 +401,9 @@ 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, @@ -411,7 +411,7 @@ func (indexer *Indexer) finalizeEpoch(epoch phase0.Epoch, justifiedRoot phase0.R 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, @@ -419,7 +419,7 @@ func (indexer *Indexer) finalizeEpoch(epoch phase0.Epoch, justifiedRoot phase0.R 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, diff --git a/templates/epoch/epoch.html b/templates/epoch/epoch.html index 18e02f8..e98d5d4 100644 --- a/templates/epoch/epoch.html +++ b/templates/epoch/epoch.html @@ -73,8 +73,8 @@

Correct Target Votes:
- {{ formatEthAddCommasFromGwei .TargetVoted }} ETH of - {{ formatEthAddCommasFromGwei .EligibleEther }} ETH + {{ formatEthAddCommasFromGwei .TargetVoted }} OR of + {{ formatEthAddCommasFromGwei .EligibleEther }} OR ({{ formatFloat .TargetVoteParticipation 2 }}%)
@@ -86,8 +86,8 @@

Correct Head Votes:
- {{ formatEthAddCommasFromGwei .HeadVoted }} ETH of - {{ formatEthAddCommasFromGwei .EligibleEther }} ETH + {{ formatEthAddCommasFromGwei .HeadVoted }} OR of + {{ formatEthAddCommasFromGwei .EligibleEther }} OR ({{ formatFloat .HeadVoteParticipation 2 }}%)
@@ -99,8 +99,8 @@

Total Votes:
- {{ formatEthAddCommasFromGwei .TotalVoted }} ETH of - {{ formatEthAddCommasFromGwei .EligibleEther }} ETH + {{ formatEthAddCommasFromGwei .TotalVoted }} OR of + {{ formatEthAddCommasFromGwei .EligibleEther }} OR ({{ formatFloat .TotalVoteParticipation 2 }}%)
diff --git a/templates/included_deposits/included_deposits.html b/templates/included_deposits/included_deposits.html index 1dbc792..bb49fec 100644 --- a/templates/included_deposits/included_deposits.html +++ b/templates/included_deposits/included_deposits.html @@ -74,7 +74,7 @@

- ETH + OR

diff --git a/templates/index/networkOverview.html b/templates/index/networkOverview.html index a976dae..ebc8f09 100644 --- a/templates/index/networkOverview.html +++ b/templates/index/networkOverview.html @@ -58,13 +58,13 @@
Staked Ether
- {{ formatEthAddCommasFromGwei .TotalEligibleEther }} ETH + {{ formatEthAddCommasFromGwei .TotalEligibleEther }} OR
Average Balance
- {{ formatEthFromGwei .AverageValidatorBalance }} + {{ formatEthFromGwei .AverageValidatorBalance }}
diff --git a/templates/index/recentEpochs.html b/templates/index/recentEpochs.html index c77eec7..7240fde 100644 --- a/templates/index/recentEpochs.html +++ b/templates/index/recentEpochs.html @@ -14,7 +14,7 @@

Time Final - Eligible (ETH) + Eligible (OR) Voted diff --git a/templates/initiated_deposits/initiated_deposits.html b/templates/initiated_deposits/initiated_deposits.html index 10d8b97..b04c2fb 100644 --- a/templates/initiated_deposits/initiated_deposits.html +++ b/templates/initiated_deposits/initiated_deposits.html @@ -66,7 +66,7 @@

- ETH + OR
diff --git a/templates/slot/transactions.html b/templates/slot/transactions.html index a9e6720..de27fd4 100644 --- a/templates/slot/transactions.html +++ b/templates/slot/transactions.html @@ -44,7 +44,7 @@ {{ $transaction.FuncName }} {{ end }} - {{ $transaction.Value }} ETH + {{ $transaction.Value }} OR {{ if gt $transaction.DataLen 0 }} {{ $transaction.DataLen }} B diff --git a/templates/submit_deposit/submit_deposit.html b/templates/submit_deposit/submit_deposit.html index 8a52263..6eb68a6 100644 --- a/templates/submit_deposit/submit_deposit.html +++ b/templates/submit_deposit/submit_deposit.html @@ -44,7 +44,7 @@

name: "{{ .NetworkName }}", rpcUrl: "{{ .PublicRPCUrl }}", tokenName: "Ethereum", - tokenSymbol: "ETH", + tokenSymbol: "OR", } ] }, diff --git a/templates/validator/validator.html b/templates/validator/validator.html index 04aae93..ecce2f7 100644 --- a/templates/validator/validator.html +++ b/templates/validator/validator.html @@ -134,7 +134,7 @@

Validator {{ forma
Effective Balance:
- {{ formatEthAddCommasFromGwei .EffectiveBalance }} ETH + {{ formatEthAddCommasFromGwei .EffectiveBalance }} OR
diff --git a/templates/validators/validators.html b/templates/validators/validators.html index 5757ce3..47dcbab 100644 --- a/templates/validators/validators.html +++ b/templates/validators/validators.html @@ -144,7 +144,7 @@

Validators Overvie {{ formatValidatorWithIndex $validator.Index $validator.Name }} 0x{{ printf "%x" $validator.PublicKey }} - {{ formatEthFromGwei $validator.Balance }} ({{ formatEthAddCommasFromGwei $validator.EffectiveBalance }} ETH) + {{ formatEthFromGwei $validator.Balance }} ({{ formatEthAddCommasFromGwei $validator.EffectiveBalance }} OR) {{- $validator.State -}} {{- if $validator.ShowUpcheck -}} diff --git a/ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx b/ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx index d4bacbd..5fe391b 100644 --- a/ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx +++ b/ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx @@ -39,9 +39,9 @@ const DepositEntry = (props: IDepositEntryProps): React.ReactElement => { {formatWithdrawalHash(props.deposit.withdrawal_credentials)} - {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" && ( - + )} @@ -177,7 +177,7 @@ const DepositEntry = (props: IDepositEntryProps): React.ReactElement => {

- {toReadableAmount(tx.amount, 9, "ETH", 0)} + {toReadableAmount(tx.amount, 9, "OR", 0)}
diff --git a/utils/format.go b/utils/format.go index df9888e..a91ed81 100644 --- a/utils/format.go +++ b/utils/format.go @@ -21,11 +21,11 @@ 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 { @@ -33,7 +33,7 @@ func FormatETHFromGweiShort(gwei uint64) string { } 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 { @@ -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