mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 16:01:36 +00:00
add cache for authority
This commit is contained in:
parent
17e5222997
commit
f5d6ea1805
1 changed files with 8 additions and 6 deletions
|
|
@ -70,12 +70,13 @@ type SetCodeTx struct {
|
|||
|
||||
// SetCodeAuthorization is an authorization from an account to deploy code at its address.
|
||||
type SetCodeAuthorization struct {
|
||||
ChainID uint256.Int `json:"chainId" gencodec:"required"`
|
||||
Address common.Address `json:"address" gencodec:"required"`
|
||||
Nonce uint64 `json:"nonce" gencodec:"required"`
|
||||
V uint8 `json:"yParity" gencodec:"required"`
|
||||
R uint256.Int `json:"r" gencodec:"required"`
|
||||
S uint256.Int `json:"s" gencodec:"required"`
|
||||
ChainID uint256.Int `json:"chainId" gencodec:"required"`
|
||||
Address common.Address `json:"address" gencodec:"required"`
|
||||
Nonce uint64 `json:"nonce" gencodec:"required"`
|
||||
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