[#466] adm: Allow to download contracts from Gitea

Signed-off-by: Olga Konstantinova <kola43843@gmail.com>
This commit is contained in:
Olga Konstantinova 2024-02-03 20:17:12 +03:00 committed by okonstantinova
parent 805862f4b7
commit 80b581d499
6 changed files with 129 additions and 7 deletions

View file

@ -50,6 +50,7 @@ type initializeContext struct {
Contracts map[string]*contractState
Command *cobra.Command
ContractPath string
ContractURL string
}
var ErrTooManyAlphabetNodes = fmt.Errorf("too many alphabet nodes (maximum allowed is %d)", maxAlphabetNodes)
@ -152,6 +153,11 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex
return nil, err
}
var ctrURL string
if needContracts {
ctrURL, _ = cmd.Flags().GetString(contractsURLFlag)
}
if err := checkNotaryEnabled(c); err != nil {
return nil, err
}
@ -176,6 +182,7 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex
Command: cmd,
Contracts: make(map[string]*contractState),
ContractPath: ctrPath,
ContractURL: ctrURL,
}
if needContracts {