[#979] adm: Deploy missing contracts during updating

Make `nnsResolveHash` function to return declared error on `token not
found` fault exception. Catch this error in `deployContracts` method,
and switch to deployment if updating contract is missing.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-11-29 13:15:03 +03:00 committed by LeL
parent e8f8e58e90
commit 2f2ca2e0bd
3 changed files with 25 additions and 6 deletions

View file

@ -57,13 +57,13 @@ func initializeSideChainCmd(cmd *cobra.Command, args []string) error {
// 3. Deploy NNS contract.
cmd.Println("Stage 3: deploy NNS contract.")
if err := initCtx.deployNNS("deploy"); err != nil {
if err := initCtx.deployNNS(deployMethodName); err != nil {
return err
}
// 4. Deploy NeoFS contracts.
cmd.Println("Stage 4: deploy NeoFS contracts.")
if err := initCtx.deployContracts("deploy"); err != nil {
if err := initCtx.deployContracts(deployMethodName); err != nil {
return err
}