mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
1a27c21d9c
* load chain config from file * revert flag name change * add dependencies to image * Update shared/cmd/flags.go Co-authored-by: Victor Farazdagi <simple.square@gmail.com> * Update beacon-chain/main.go Co-authored-by: Victor Farazdagi <simple.square@gmail.com> * added test to load config file * Merge branch 'yaml_chain_config' of github.com:prysmaticlabs/prysm into yaml_chain_config # Conflicts: # beacon-chain/main.go * replace hex with yaml format of fixed byte array * fix test and check if comment * move to node package * gaz * added contract address case * fix key name issue * add tests * gaz * add 1 byte handling * change to fatal * add config printout * revert main changes * revert line removal * fix one byte handling * fix test and one byte handling * remove log * Apply suggestions from code review * change to debug * Update beacon-chain/node/node.go * move helper methods Co-authored-by: Victor Farazdagi <simple.square@gmail.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> Co-authored-by: terence tsao <terence@prysmaticlabs.com>
42 lines
794 B
Go
42 lines
794 B
Go
package fuzz
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
|
|
"github.com/prysmaticlabs/go-ssz"
|
|
stateTrie "github.com/prysmaticlabs/prysm/beacon-chain/state"
|
|
"github.com/prysmaticlabs/prysm/shared/featureconfig"
|
|
)
|
|
|
|
func init() {
|
|
featureconfig.Init(&featureconfig.Flags{
|
|
SkipBLSVerify: true,
|
|
})
|
|
}
|
|
|
|
func fail(err error) ([]byte, bool) {
|
|
shouldPanic := false
|
|
if val, ok := os.LookupEnv("PANIC_ON_ERROR"); ok {
|
|
shouldPanic = strings.ToLower(val) == "true"
|
|
}
|
|
if shouldPanic {
|
|
panic(err)
|
|
}
|
|
return nil, false
|
|
}
|
|
|
|
func success(post *stateTrie.BeaconState) ([]byte, bool) {
|
|
if val, ok := os.LookupEnv("RETURN_SSZ_POST_STATE"); ok {
|
|
if strings.ToLower(val) != "true" {
|
|
return nil, true
|
|
}
|
|
}
|
|
|
|
result, err := ssz.Marshal(post.InnerStateUnsafe())
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return result, true
|
|
}
|