[#932] adm: Move DomainOf to util package

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2024-02-01 09:58:12 +03:00
parent 34fcab3498
commit fdeb99c52f
19 changed files with 36 additions and 38 deletions

View file

@ -25,11 +25,6 @@ import (
"golang.org/x/sync/errgroup"
)
const (
singleAccountName = "single"
committeeAccountName = "committee"
)
func generateAlphabetCreds(cmd *cobra.Command, _ []string) error {
// alphabet size is not part of the config
size, err := cmd.Flags().GetUint(alphabetSizeFlag)
@ -87,7 +82,7 @@ func initializeWallets(v *viper.Viper, walletDir string, size int) ([]string, er
if err != nil {
return nil, fmt.Errorf("can't create wallet: %w", err)
}
if err := w.CreateAccount(singleAccountName, password); err != nil {
if err := w.CreateAccount(morphUtil.SingleAccountName, password); err != nil {
return nil, fmt.Errorf("can't create account: %w", err)
}
@ -106,7 +101,7 @@ func initializeWallets(v *viper.Viper, walletDir string, size int) ([]string, er
i := i
ps := pubs.Copy()
errG.Go(func() error {
if err := addMultisigAccount(wallets[i], majCount, committeeAccountName, passwords[i], ps); err != nil {
if err := addMultisigAccount(wallets[i], majCount, morphUtil.CommitteeAccountName, passwords[i], ps); err != nil {
return fmt.Errorf("can't create committee account: %w", err)
}
if err := addMultisigAccount(wallets[i], bftCount, morphUtil.ConsensusAccountName, passwords[i], ps); err != nil {
@ -182,7 +177,7 @@ func refillGas(cmd *cobra.Command, gasFlag string, createWallet bool) (err error
}
if label == "" {
label = singleAccountName
label = morphUtil.SingleAccountName
}
if err := w.CreateAccount(label, password); err != nil {