forked from TrueCloudLab/frostfs-node
[#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:
parent
6a40adcfca
commit
c81008764a
6 changed files with 26 additions and 37 deletions
|
@ -22,10 +22,7 @@ import (
|
|||
const initialAlphabetNEOAmount = native.NEOTotalSupply
|
||||
|
||||
func (c *initializeContext) registerCandidates() error {
|
||||
neoHash, err := c.Client.GetNativeContractHash(nativenames.Neo)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
neoHash := c.nativeHash(nativenames.Neo)
|
||||
|
||||
res, err := c.Client.InvokeFunction(neoHash, "getCandidates", []smartcontract.Parameter{}, nil)
|
||||
if err != nil {
|
||||
|
@ -72,10 +69,7 @@ func (c *initializeContext) registerCandidates() error {
|
|||
}
|
||||
|
||||
func (c *initializeContext) transferNEOToAlphabetContracts() error {
|
||||
neoHash, err := c.Client.GetNativeContractHash(nativenames.Neo)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
neoHash := c.nativeHash(nativenames.Neo)
|
||||
|
||||
ok, err := c.transferNEOFinished(neoHash)
|
||||
if ok || err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue