[#466] adm: Allow to download contracts from Gitea
All checks were successful
DCO action / DCO (pull_request) Successful in 2m25s
Vulncheck / Vulncheck (pull_request) Successful in 1m58s
Tests and linters / Staticcheck (pull_request) Successful in 5m31s
Tests and linters / Tests (1.21) (pull_request) Successful in 5m53s
Tests and linters / Tests (1.20) (pull_request) Successful in 6m6s
Tests and linters / Lint (pull_request) Successful in 6m22s
Tests and linters / Tests with -race (pull_request) Successful in 6m41s
Build / Build Components (1.21) (pull_request) Successful in 1m40s
Build / Build Components (1.20) (pull_request) Successful in 1m56s

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 {