Files

22 lines
455 B
Go

package machine
import (
"fmt"
"github.com/formancehq/stack/libs/core/accounts"
)
type AccountAddress string
func (AccountAddress) GetType() Type { return TypeAccount }
func (a AccountAddress) String() string {
return fmt.Sprintf("@%v", string(a))
}
func ValidateAccountAddress(acc AccountAddress) error {
if !accounts.Regexp.MatchString(string(acc)) {
return fmt.Errorf("accounts should respect pattern %s", accounts.Pattern)
}
return nil
}