mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
Co-authored-by: yiweichi <yiweichi@users.noreply.github.com> Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>
18 lines
575 B
Go
18 lines
575 B
Go
package utils
|
|
|
|
import "strings"
|
|
|
|
// IsExternalProverNameMatch checks if the local and remote external prover names belong to the same provider.
|
|
// It returns true if they do, otherwise false.
|
|
func IsExternalProverNameMatch(localName, remoteName string) bool {
|
|
local := strings.Split(localName, "_")
|
|
remote := strings.Split(remoteName, "_")
|
|
|
|
if len(local) < 3 || len(remote) < 3 {
|
|
return false
|
|
}
|
|
|
|
// note the name of cloud prover is in the format of "cloud_prover_{provider-name}_index"
|
|
return local[0] == remote[0] && local[1] == remote[1] && local[2] == remote[2]
|
|
}
|