fix(critical): complete execution pipeline - all blockers fixed and operational
This commit is contained in:
29
pkg/utils/address_validation.go
Normal file
29
pkg/utils/address_validation.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
)
|
||||
|
||||
// ValidateAddress ensures an address is not zero
|
||||
func ValidateAddress(addr common.Address, name string) error {
|
||||
if addr == (common.Address{}) {
|
||||
return fmt.Errorf("%s cannot be zero address", name)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidateAddresses validates multiple addresses
|
||||
func ValidateAddresses(addrs map[string]common.Address) error {
|
||||
for name, addr := range addrs {
|
||||
if err := ValidateAddress(addr, name); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsZeroAddress checks if address is zero
|
||||
func IsZeroAddress(addr common.Address) bool {
|
||||
return addr == (common.Address{})
|
||||
}
|
||||
Reference in New Issue
Block a user