[#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

@ -87,7 +87,7 @@ func (c *initializeContext) deployNNS() error {
Scopes: transaction.CalledByEntry,
}
mgmtHash, _ := c.Client.GetNativeContractHash(nativenames.Management)
mgmtHash := c.nativeHash(nativenames.Management)
res, err := c.Client.InvokeFunction(mgmtHash, "deploy", params, []transaction.Signer{signer})
if err != nil {
return fmt.Errorf("can't deploy contract: %w", err)
@ -109,7 +109,7 @@ func (c *initializeContext) deployNNS() error {
}
func (c *initializeContext) deployContracts() error {
mgmtHash, _ := c.Client.GetNativeContractHash(nativenames.Management)
mgmtHash := c.nativeHash(nativenames.Management)
sender := c.CommitteeAcc.Contract.ScriptHash()
for _, ctrName := range contractList {
cs, err := c.readContract(ctrName)