mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-10 08:51:38 +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.
|
// SetCodeAuthorization is an authorization from an account to deploy code at its address.
|
||||||
type SetCodeAuthorization struct {
|
type SetCodeAuthorization struct {
|
||||||
ChainID uint256.Int `json:"chainId" gencodec:"required"`
|
ChainID uint256.Int `json:"chainId" gencodec:"required"`
|
||||||
Address common.Address `json:"address" gencodec:"required"`
|
Address common.Address `json:"address" gencodec:"required"`
|
||||||
Nonce uint64 `json:"nonce" gencodec:"required"`
|
Nonce uint64 `json:"nonce" gencodec:"required"`
|
||||||
V uint8 `json:"yParity" gencodec:"required"`
|
V uint8 `json:"yParity" gencodec:"required"`
|
||||||
R uint256.Int `json:"r" gencodec:"required"`
|
R uint256.Int `json:"r" gencodec:"required"`
|
||||||
S uint256.Int `json:"s" gencodec:"required"`
|
S uint256.Int `json:"s" gencodec:"required"`
|
||||||
|
authority common.Address `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// field type overrides for gencodec
|
// field type overrides for gencodec
|
||||||
|
|
@ -135,6 +136,7 @@ func (a *SetCodeAuthorization) Authority() (common.Address, error) {
|
||||||
}
|
}
|
||||||
var addr common.Address
|
var addr common.Address
|
||||||
copy(addr[:], crypto.Keccak256(pub[1:])[12:])
|
copy(addr[:], crypto.Keccak256(pub[1:])[12:])
|
||||||
|
a.authority = addr
|
||||||
return addr, nil
|
return addr, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue