Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/types/tx_setcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ type authorizationMarshaling struct {

// SignSetCode creates a signed the SetCode authorization.
func SignSetCode(prv *ecdsa.PrivateKey, auth SetCodeAuthorization) (SetCodeAuthorization, error) {
sighash := auth.sigHash()
sighash := auth.SigHash()
sig, err := crypto.Sign(sighash[:], prv)
if err != nil {
return SetCodeAuthorization{}, err
Expand All @@ -105,7 +105,8 @@ func SignSetCode(prv *ecdsa.PrivateKey, auth SetCodeAuthorization) (SetCodeAutho
}, nil
}

func (a *SetCodeAuthorization) sigHash() common.Hash {
// SigHash returns the hash of SetCodeAuthorization for signing.
func (a *SetCodeAuthorization) SigHash() common.Hash {
return prefixedRlpHash(0x05, []any{
a.ChainID,
a.Address,
Expand All @@ -115,7 +116,7 @@ func (a *SetCodeAuthorization) sigHash() common.Hash {

// Authority recovers the the authorizing account of an authorization.
func (a *SetCodeAuthorization) Authority() (common.Address, error) {
sighash := a.sigHash()
sighash := a.SigHash()
if !crypto.ValidateSignatureValues(a.V, a.R.ToBig(), a.S.ToBig(), true) {
return common.Address{}, ErrInvalidSig
}
Expand Down