mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Use Block Interface Across Prysm (#8918)
* commit initial work * checkpoint current work * gaz * checkpoint * req/resp changes * initial-sync * finally works * fix error * fix bugs * fix issue * fix issues * fix refs * tests * more text fixes * more text fixes * more text fixes * fix tests * fix tests * tests * finally fix builds * finally * comments * fix fuzz * share common library * fix * fix * add in more defensive nil checks * add in more defensive nil checks * imports * Apply suggestions from code review Co-authored-by: terence tsao <terence@prysmaticlabs.com> * Apply suggestions from code review Co-authored-by: terence tsao <terence@prysmaticlabs.com> * Update shared/interfaces/block_interface.go Co-authored-by: terence tsao <terence@prysmaticlabs.com> * Update shared/interfaces/block_wrapper.go Co-authored-by: terence tsao <terence@prysmaticlabs.com> * Update shared/interfaces/block_interface.go Co-authored-by: terence tsao <terence@prysmaticlabs.com> * imports * fix bad changes * fix * terence's review * terence's review * fmt * Update beacon-chain/rpc/beacon/blocks.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * fix tests * fix * fix all tests Co-authored-by: terence tsao <terence@prysmaticlabs.com> Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -15,6 +15,7 @@ go_library(
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/benchutil:go_default_library",
|
||||
"//shared/fileutil:go_default_library",
|
||||
"//shared/interfaces:go_default_library",
|
||||
"//shared/interop:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||
"github.com/prysmaticlabs/prysm/shared/benchutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/fileutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/interfaces"
|
||||
"github.com/prysmaticlabs/prysm/shared/interop"
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil"
|
||||
@@ -102,7 +103,7 @@ func generateMarshalledFullStateAndBlock() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
beaconState, err = state.ExecuteStateTransition(context.Background(), beaconState, block)
|
||||
beaconState, err = state.ExecuteStateTransition(context.Background(), beaconState, interfaces.NewWrappedSignedBeaconBlock(block))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -126,7 +127,7 @@ func generateMarshalledFullStateAndBlock() error {
|
||||
}
|
||||
block.Block.Body.Attestations = append(atts, block.Block.Body.Attestations...)
|
||||
|
||||
s, err := state.CalculateStateRoot(context.Background(), beaconState, block)
|
||||
s, err := state.CalculateStateRoot(context.Background(), beaconState, interfaces.NewWrappedSignedBeaconBlock(block))
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not calculate state root")
|
||||
}
|
||||
@@ -157,7 +158,7 @@ func generateMarshalledFullStateAndBlock() error {
|
||||
}
|
||||
|
||||
// Running a single state transition to make sure the generated files aren't broken.
|
||||
_, err = state.ExecuteStateTransition(context.Background(), beaconState, block)
|
||||
_, err = state.ExecuteStateTransition(context.Background(), beaconState, interfaces.NewWrappedSignedBeaconBlock(block))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -191,7 +192,7 @@ func generate2FullEpochState() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
beaconState, err = state.ExecuteStateTransition(context.Background(), beaconState, block)
|
||||
beaconState, err = state.ExecuteStateTransition(context.Background(), beaconState, interfaces.NewWrappedSignedBeaconBlock(block))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user