Skip to content

Commit

Permalink
core/types: Rename V to yParity in JsonAuthorization (#13615)
Browse files Browse the repository at this point in the history
  • Loading branch information
somnathb1 authored Jan 30, 2025
1 parent 6449a1a commit 4715102
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type JsonAuthorization struct {
ChainID hexutil.Big `json:"chainId"`
Address libcommon.Address `json:"address"`
Nonce hexutil.Uint64 `json:"nonce"`
V hexutil.Uint64 `json:"v"`
YParity hexutil.Uint64 `json:"yParity"`
R hexutil.Big `json:"r"`
S hexutil.Big `json:"s"`
}
Expand All @@ -81,7 +81,7 @@ func (a JsonAuthorization) FromAuthorization(authorization Authorization) JsonAu
a.Address = authorization.Address
a.Nonce = (hexutil.Uint64)(authorization.Nonce)

a.V = (hexutil.Uint64)(authorization.YParity)
a.YParity = (hexutil.Uint64)(authorization.YParity)
a.R = hexutil.Big(*authorization.R.ToBig())
a.S = hexutil.Big(*authorization.S.ToBig())
return a
Expand All @@ -97,7 +97,7 @@ func (a JsonAuthorization) ToAuthorization() (Authorization, error) {
return auth, errors.New("chainId in authorization does not fit in 256 bits")
}
auth.ChainID = *chainId
yParity := a.V.Uint64()
yParity := a.YParity.Uint64()
if yParity >= 1<<8 {
return auth, errors.New("y parity in authorization does not fit in 8 bits")
}
Expand Down

0 comments on commit 4715102

Please sign in to comment.