common: remove zero address

This commit is contained in:
lightclient 2024-11-26 17:24:55 -07:00
parent 48ef8da9f0
commit f709826b6b
No known key found for this signature in database
GPG key ID: 75C916AFEE20183E
2 changed files with 1 additions and 4 deletions

View file

@ -45,9 +45,6 @@ var (
hashT = reflect.TypeOf(Hash{})
addressT = reflect.TypeOf(Address{})
// ZeroAddress represents the zero address value.
ZeroAddress = Address{}
// MaxAddress represents the maximum possible address value.
MaxAddress = HexToAddress("0xffffffffffffffffffffffffffffffffffffffff")

View file

@ -499,7 +499,7 @@ func (st *stateTransition) execute() (*ExecutionResult, error) {
}
st.state.SetNonce(authority, auth.Nonce+1)
delegation := types.AddressToDelegation(auth.Address)
if auth.Address == common.ZeroAddress {
if auth.Address == (common.Address{}) {
// If the delegation is for the zero address, completely clear all
// delegations from the account.
delegation = []byte{}