[#732] neofs-adm: fetch native hashes once

Retrieve list of native contracts during initialization
in a single query.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-07-29 16:35:57 +03:00 committed by Alex Vanin
parent 6a40adcfca
commit c81008764a
6 changed files with 26 additions and 37 deletions

View file

@ -1,8 +1,6 @@
package morph
import (
"fmt"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
"github.com/nspcc-dev/neo-go/pkg/io"
@ -18,10 +16,7 @@ func (c *initializeContext) setNotaryAndAlphabetNodes() error {
return err
}
designateHash, err := c.Client.GetNativeContractHash(nativenames.Designation)
if err != nil {
return fmt.Errorf("can't fetch %s hash: %w", nativenames.Designation, err)
}
designateHash := c.nativeHash(nativenames.Designation)
var pubs []interface{}
for _, w := range c.Wallets {