[#1514] adm/nns: Do not return hash from getRPCClient()
All checks were successful
DCO action / DCO (pull_request) Successful in 2m28s
Tests and linters / Staticcheck (pull_request) Successful in 4m42s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m56s
Tests and linters / Tests with -race (pull_request) Successful in 5m27s
Vulncheck / Vulncheck (pull_request) Successful in 8m53s
Tests and linters / gopls check (pull_request) Successful in 10m2s
Build / Build Components (pull_request) Successful in 10m26s
Tests and linters / Run gofumpt (pull_request) Successful in 10m36s
Tests and linters / Lint (pull_request) Successful in 12m9s
Tests and linters / Tests (pull_request) Successful in 13m48s
All checks were successful
DCO action / DCO (pull_request) Successful in 2m28s
Tests and linters / Staticcheck (pull_request) Successful in 4m42s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m56s
Tests and linters / Tests with -race (pull_request) Successful in 5m27s
Vulncheck / Vulncheck (pull_request) Successful in 8m53s
Tests and linters / gopls check (pull_request) Successful in 10m2s
Build / Build Components (pull_request) Successful in 10m26s
Tests and linters / Run gofumpt (pull_request) Successful in 10m36s
Tests and linters / Lint (pull_request) Successful in 12m9s
Tests and linters / Tests (pull_request) Successful in 13m48s
It was unused and we employ better abstractions now. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
8de3c2f706
commit
a2e1b2cf43
5 changed files with 9 additions and 10 deletions
|
@ -24,7 +24,7 @@ func initRegisterCmd() {
|
|||
}
|
||||
|
||||
func registerDomain(cmd *cobra.Command, _ []string) {
|
||||
c, actor, _ := getRPCClient(cmd)
|
||||
c, actor := getRPCClient(cmd)
|
||||
|
||||
name, _ := cmd.Flags().GetString(nnsNameFlag)
|
||||
email, _ := cmd.Flags().GetString(nnsEmailFlag)
|
||||
|
@ -53,7 +53,7 @@ func initDeleteCmd() {
|
|||
}
|
||||
|
||||
func deleteDomain(cmd *cobra.Command, _ []string) {
|
||||
c, actor, _ := getRPCClient(cmd)
|
||||
c, actor := getRPCClient(cmd)
|
||||
|
||||
name, _ := cmd.Flags().GetString(nnsNameFlag)
|
||||
h, vub, err := c.DeleteDomain(name)
|
||||
|
|
|
@ -7,12 +7,11 @@ import (
|
|||
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpcclient/invoker"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpcclient/management"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func getRPCClient(cmd *cobra.Command) (*client.Contract, *helper.LocalActor, util.Uint160) {
|
||||
func getRPCClient(cmd *cobra.Command) (*client.Contract, *helper.LocalActor) {
|
||||
v := viper.GetViper()
|
||||
c, err := helper.GetN3Client(v)
|
||||
commonCmd.ExitOnErr(cmd, "unable to create NEO rpc client: %w", err)
|
||||
|
@ -23,7 +22,7 @@ func getRPCClient(cmd *cobra.Command) (*client.Contract, *helper.LocalActor, uti
|
|||
r := management.NewReader(ac.Invoker)
|
||||
nnsCs, err := helper.GetContractByID(r, 1)
|
||||
commonCmd.ExitOnErr(cmd, "can't get NNS contract state: %w", err)
|
||||
return client.New(ac, nnsCs.Hash), ac, nnsCs.Hash
|
||||
return client.New(ac, nnsCs.Hash), ac
|
||||
}
|
||||
|
||||
func nnsReader(cmd *cobra.Command) (*client.ContractReader, *invoker.Invoker) {
|
||||
|
|
|
@ -59,7 +59,7 @@ func initDelRecordCmd() {
|
|||
}
|
||||
|
||||
func addRecord(cmd *cobra.Command, _ []string) {
|
||||
c, actor, _ := getRPCClient(cmd)
|
||||
c, actor := getRPCClient(cmd)
|
||||
name, _ := cmd.Flags().GetString(nnsNameFlag)
|
||||
data, _ := cmd.Flags().GetString(nnsRecordDataFlag)
|
||||
recordType, _ := cmd.Flags().GetString(nnsRecordTypeFlag)
|
||||
|
@ -112,7 +112,7 @@ func getRecords(cmd *cobra.Command, _ []string) {
|
|||
}
|
||||
|
||||
func delRecords(cmd *cobra.Command, _ []string) {
|
||||
c, actor, _ := getRPCClient(cmd)
|
||||
c, actor := getRPCClient(cmd)
|
||||
name, _ := cmd.Flags().GetString(nnsNameFlag)
|
||||
recordType, _ := cmd.Flags().GetString(nnsRecordTypeFlag)
|
||||
typ, err := getRecordType(recordType)
|
||||
|
@ -127,7 +127,7 @@ func delRecords(cmd *cobra.Command, _ []string) {
|
|||
}
|
||||
|
||||
func delRecord(cmd *cobra.Command, _ []string) {
|
||||
c, actor, _ := getRPCClient(cmd)
|
||||
c, actor := getRPCClient(cmd)
|
||||
name, _ := cmd.Flags().GetString(nnsNameFlag)
|
||||
data, _ := cmd.Flags().GetString(nnsRecordDataFlag)
|
||||
recordType, _ := cmd.Flags().GetString(nnsRecordTypeFlag)
|
||||
|
|
|
@ -14,7 +14,7 @@ func initRenewCmd() {
|
|||
}
|
||||
|
||||
func renewDomain(cmd *cobra.Command, _ []string) {
|
||||
c, actor, _ := getRPCClient(cmd)
|
||||
c, actor := getRPCClient(cmd)
|
||||
name, _ := cmd.Flags().GetString(nnsNameFlag)
|
||||
h, vub, err := c.Renew(name)
|
||||
commonCmd.ExitOnErr(cmd, "unable to renew domain: %w", err)
|
||||
|
|
|
@ -30,7 +30,7 @@ func initUpdateCmd() {
|
|||
}
|
||||
|
||||
func updateSOA(cmd *cobra.Command, _ []string) {
|
||||
c, actor, _ := getRPCClient(cmd)
|
||||
c, actor := getRPCClient(cmd)
|
||||
|
||||
name, _ := cmd.Flags().GetString(nnsNameFlag)
|
||||
email, _ := cmd.Flags().GetString(nnsEmailFlag)
|
||||
|
|
Loading…
Reference in a new issue