mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
b7175b3482
* Revert "Revert "Update fastssz" (#7100)"
This reverts commit b954db9704
.
* Preston's patch
* Merge branch 'master' of github.com:prysmaticlabs/prysm into revert-7100-revert-6760-update-fssz
* Update fssz, add regression test case
* more HTR with fssz
* fix some tests
* only one test left
* Make it so that HTR will work
* gofmt, imports
* gofmt, imports
* fix
* Merge branch 'master' of github.com:prysmaticlabs/prysm into revert-7100-revert-6760-update-fssz
* fix
* Merge branch 'master' into revert-7100-revert-6760-update-fssz
* Merge refs/heads/master into revert-7100-revert-6760-update-fssz
* gaz
* Merge branch 'revert-7100-revert-6760-update-fssz' of github.com:prysmaticlabs/prysm into revert-7100-revert-6760-update-fssz
* Merge refs/heads/master into revert-7100-revert-6760-update-fssz
* fix test
* Merge branch 'revert-7100-revert-6760-update-fssz' of github.com:prysmaticlabs/prysm into revert-7100-revert-6760-update-fssz
* Merge refs/heads/master into revert-7100-revert-6760-update-fssz
30 lines
730 B
Go
30 lines
730 B
Go
package testutil
|
|
|
|
import (
|
|
"context"
|
|
"reflect"
|
|
"testing"
|
|
|
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
|
)
|
|
|
|
func TestNewBeaconState(t *testing.T) {
|
|
st := NewBeaconState()
|
|
b, err := st.InnerStateUnsafe().MarshalSSZ()
|
|
require.NoError(t, err)
|
|
got := &pb.BeaconState{}
|
|
require.NoError(t, got.UnmarshalSSZ(b))
|
|
if !reflect.DeepEqual(st.InnerStateUnsafe(), got) {
|
|
t.Fatal("State did not match after round trip marshal")
|
|
}
|
|
}
|
|
|
|
func TestNewBeaconState_HashTreeRoot(t *testing.T) {
|
|
_, err := st.HashTreeRoot(context.Background())
|
|
require.NoError(t, err)
|
|
state := NewBeaconState()
|
|
_, err = state.HashTreeRoot(context.Background())
|
|
require.NoError(t, err)
|
|
}
|