mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
d58d3f2c57
* rewrite/refactor deposit testing code keep track of sent deposits so that they can be compared in detail with the validator set retreived from the API. * fix bugs in evaluator and retry * lint + deepsource appeasement * typo s/Sprintf/Printf/ * gosec, more like nosec * fix gosec number - 204->304 * type switch to get signed block from container * improve comments * centralizing constants and adding comments * lock around Depositor to avoid future races Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
18 lines
496 B
Go
18 lines
496 B
Go
package helpers
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/ethereum/go-ethereum/accounts/keystore"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
// KeyFromPath should only be used in endtoend tests. It is a simple helper to init a geth keystore.Key from a file.
|
|
func KeyFromPath(path, pw string) (*keystore.Key, error) {
|
|
jsonb, err := os.ReadFile(path) // #nosec G304 -- for endtoend use only
|
|
if err != nil {
|
|
return nil, errors.Wrapf(err, "couldn't read keystore file %s", path)
|
|
}
|
|
return keystore.DecryptKey(jsonb, pw)
|
|
}
|