Compare commits

...

1 commit

Author SHA1 Message Date
638e9576d1 [#244] Remove --local-dump from frostfs-adm config
Some checks failed
Build / Build Components (1.19) (pull_request) Failing after 2s
Build / Build Components (1.20) (pull_request) Successful in 3m41s
Tests and linters / Tests (1.19) (pull_request) Successful in 5m2s
ci/woodpecker/pr/pre-commit Pipeline was successful
Tests and linters / Staticcheck (pull_request) Successful in 5m50s
Tests and linters / Tests with -race (pull_request) Successful in 7m58s
Tests and linters / Lint (pull_request) Successful in 16m35s
Tests and linters / Tests (1.20) (pull_request) Successful in 23m39s
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-07-18 16:32:21 +03:00
3 changed files with 4 additions and 6 deletions

View file

@ -210,11 +210,11 @@ func validateInit(cmd *cobra.Command) error {
func createClient(cmd *cobra.Command, v *viper.Viper, wallets []*wallet.Wallet) (Client, error) {
var c Client
var err error
if v.GetString(localDumpFlag) != "" {
if v.GetString(endpointFlag) != "" {
if ldf := cmd.Flags().Lookup(localDumpFlag); ldf != nil && ldf.Changed {
if cmd.Flags().Changed(endpointFlag) {
return nil, fmt.Errorf("`%s` and `%s` flags are mutually exclusive", endpointFlag, localDumpFlag)
}
c, err = newLocalClient(cmd, v, wallets)
c, err = newLocalClient(cmd, v, wallets, ldf.Value.String())
} else {
c, err = getN3Client(v)
}

View file

@ -51,7 +51,7 @@ type localClient struct {
maxGasInvoke int64
}
func newLocalClient(cmd *cobra.Command, v *viper.Viper, wallets []*wallet.Wallet) (*localClient, error) {
func newLocalClient(cmd *cobra.Command, v *viper.Viper, wallets []*wallet.Wallet, dumpPath string) (*localClient, error) {
cfg, err := config.LoadFile(v.GetString(protoConfigPath))
if err != nil {
return nil, err
@ -87,7 +87,6 @@ func newLocalClient(cmd *cobra.Command, v *viper.Viper, wallets []*wallet.Wallet
go bc.Run()
dumpPath := v.GetString(localDumpFlag)
if cmd.Name() != "init" {
f, err := os.OpenFile(dumpPath, os.O_RDONLY, 0600)
if err != nil {

View file

@ -77,7 +77,6 @@ var (
_ = viper.BindPFlag(containerAliasFeeInitFlag, cmd.Flags().Lookup(containerAliasFeeCLIFlag))
_ = viper.BindPFlag(withdrawFeeInitFlag, cmd.Flags().Lookup(withdrawFeeCLIFlag))
_ = viper.BindPFlag(protoConfigPath, cmd.Flags().Lookup(protoConfigPath))
_ = viper.BindPFlag(localDumpFlag, cmd.Flags().Lookup(localDumpFlag))
},
RunE: initializeSideChainCmd,
}