rename to authority

This commit is contained in:
maskpp 2025-06-30 14:54:20 +08:00
parent d63f36c1ed
commit 2fcbfa4045

View file

@ -80,7 +80,7 @@ type SetCodeAuthorization struct {
// caches // caches
hash atomic.Pointer[common.Hash] hash atomic.Pointer[common.Hash]
from atomic.Pointer[common.Address] authority atomic.Pointer[common.Address]
} }
// field type overrides for gencodec // field type overrides for gencodec
@ -125,7 +125,7 @@ func (a *SetCodeAuthorization) sigHash() common.Hash {
// Authority recovers the authorizing account of an authorization. // Authority recovers the authorizing account of an authorization.
func (a *SetCodeAuthorization) Authority() (common.Address, error) { func (a *SetCodeAuthorization) Authority() (common.Address, error) {
if addr := a.from.Load(); addr != nil { if addr := a.authority.Load(); addr != nil {
return *addr, nil return *addr, nil
} }
sighash := a.sigHash() sighash := a.sigHash()
@ -147,7 +147,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.from.Store(&addr) a.authority.Store(&addr)
return addr, nil return addr, nil
} }