mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
add cache for authority
This commit is contained in:
parent
17e5222997
commit
f5d6ea1805
1 changed files with 8 additions and 6 deletions
|
|
@ -76,6 +76,7 @@ type SetCodeAuthorization struct {
|
|||
V uint8 `json:"yParity" gencodec:"required"`
|
||||
R uint256.Int `json:"r" gencodec:"required"`
|
||||
S uint256.Int `json:"s" gencodec:"required"`
|
||||
authority common.Address `json:"-"`
|
||||
}
|
||||
|
||||
// field type overrides for gencodec
|
||||
|
|
@ -135,6 +136,7 @@ func (a *SetCodeAuthorization) Authority() (common.Address, error) {
|
|||
}
|
||||
var addr common.Address
|
||||
copy(addr[:], crypto.Keccak256(pub[1:])[12:])
|
||||
a.authority = addr
|
||||
return addr, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue