mirror of
https://github.com/wealdtech/ethdo.git
synced 2026-01-09 14:07:56 -05:00
Use 0.11 style domains
This commit is contained in:
@@ -20,10 +20,10 @@ import (
|
||||
"time"
|
||||
|
||||
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
||||
ssz "github.com/prysmaticlabs/go-ssz"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/wealdtech/ethdo/grpc"
|
||||
e2types "github.com/wealdtech/go-eth2-types/v2"
|
||||
)
|
||||
|
||||
var validatorExitEpoch int64
|
||||
@@ -78,16 +78,15 @@ In quiet mode this will return 0 if the transaction has been sent, otherwise 1.`
|
||||
Epoch: currentEpoch,
|
||||
ValidatorIndex: index,
|
||||
}
|
||||
root, err := ssz.HashTreeRoot(exit)
|
||||
errCheck(err, "Failed to generate exit proposal root")
|
||||
// TODO fetch current fork version from config (currently using genesis fork version)
|
||||
// currentForkVersion := config["GenesisForkVersion"].([]byte)
|
||||
// domain := types.Domain(types.DomainVoluntaryExit, currentForkVersion)
|
||||
currentForkVersion := config["GenesisForkVersion"].([]byte)
|
||||
// TODO fetch genesis validators root from somewhere.
|
||||
//domain := e2types.Domain(e2types.DomainVoluntaryExit, currentForkVersion, genesisValidatorsRoot)
|
||||
domain := e2types.Domain(e2types.DomainVoluntaryExit, currentForkVersion, e2types.ZeroGenesisValidatorsRoot)
|
||||
|
||||
err = account.Unlock([]byte(rootAccountPassphrase))
|
||||
errCheck(err, "Failed to unlock account; please confirm passphrase is correct")
|
||||
// TODO supply domain
|
||||
signature, err := sign(account, root[:], []byte{})
|
||||
signature, err := signStruct(account, exit, domain)
|
||||
errCheck(err, "Failed to sign exit proposal")
|
||||
|
||||
proposal := ðpb.SignedVoluntaryExit{
|
||||
|
||||
Reference in New Issue
Block a user