-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d41c9fa
commit f667110
Showing
33 changed files
with
1,174 additions
and
133 deletions.
There are no files selected for viewing
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
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
32 changes: 32 additions & 0 deletions
32
beacon-chain/state/state-native/getters_balance_deposits.go
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,32 @@ | ||
package state_native | ||
|
||
import ( | ||
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" | ||
"github.com/prysmaticlabs/prysm/v5/runtime/version" | ||
) | ||
|
||
func (b *BeaconState) DepositBalanceToConsume() (uint64, error) { | ||
if b.version < version.Electra { | ||
return 0, errNotSupported("DepositBalanceToConsume", b.version) | ||
} | ||
b.lock.RLock() | ||
defer b.lock.RUnlock() | ||
return b.depositBalanceToConsume, nil | ||
} | ||
|
||
func (b *BeaconState) PendingBalanceDeposits() ([]*ethpb.PendingBalanceDeposit, error) { | ||
if b.version < version.Electra { | ||
return nil, errNotSupported("PendingBalanceDeposits", b.version) | ||
} | ||
b.lock.RLock() | ||
defer b.lock.RUnlock() | ||
return b.pendingBalanceDeposits, nil | ||
} | ||
|
||
func (b *BeaconState) pendingBalanceDepositsVal() []*ethpb.PendingBalanceDeposit { | ||
if b.pendingBalanceDeposits == nil { | ||
return nil | ||
} | ||
|
||
return ethpb.CopyPendingBalanceDeposits(b.pendingBalanceDeposits) | ||
} |
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,48 @@ | ||
package state_native | ||
|
||
import ( | ||
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" | ||
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" | ||
"github.com/prysmaticlabs/prysm/v5/runtime/version" | ||
) | ||
|
||
func (b *BeaconState) EarliestConsolidationEpoch() (primitives.Epoch, error) { | ||
if b.version < version.Electra { | ||
return 0, errNotSupported("EarliestConsolidationEpoch", b.version) | ||
} | ||
b.lock.RLock() | ||
defer b.lock.RUnlock() | ||
return b.earliestConsolidationEpoch, nil | ||
} | ||
|
||
func (b *BeaconState) ConsolidationBalanceToConsume() (uint64, error) { | ||
if b.version < version.Electra { | ||
return 0, errNotSupported("ConsolidationBalanceToConsume", b.version) | ||
} | ||
b.lock.RLock() | ||
defer b.lock.RUnlock() | ||
return b.consolidationBalanceToConsume, nil | ||
} | ||
|
||
func (b *BeaconState) PendingConsolidations() ([]*ethpb.PendingConsolidation, error) { | ||
if b.version < version.Electra { | ||
return nil, errNotSupported("PendingConsolidations", b.version) | ||
} | ||
b.lock.RLock() | ||
defer b.lock.RUnlock() | ||
return b.pendingConsolidations, nil | ||
} | ||
|
||
func (b *BeaconState) NumPendingConsolidations() uint64 { | ||
b.lock.RLock() | ||
defer b.lock.RUnlock() | ||
return uint64(len(b.pendingConsolidations)) | ||
} | ||
|
||
func (b *BeaconState) pendingConsolidationsVal() []*ethpb.PendingConsolidation { | ||
if b.pendingConsolidations == nil { | ||
return nil | ||
} | ||
|
||
return ethpb.CopyPendingConsolidations(b.pendingConsolidations) | ||
} |
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.