Disable things in notary disabled environment

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-09-27 18:05:48 +03:00 committed by Evgenii Stratonikov
parent 4e361e2ab4
commit a01b05a09c
5 changed files with 12 additions and 12 deletions

View file

@ -38,7 +38,7 @@ const (
// notaryEnabled signifies whether contracts were deployed in a notary-enabled environment. // notaryEnabled signifies whether contracts were deployed in a notary-enabled environment.
// The setting is here to simplify testing and building the command for testnet (notary currently disabled). // The setting is here to simplify testing and building the command for testnet (notary currently disabled).
// It will be removed eventually. // It will be removed eventually.
notaryEnabled = true notaryEnabled = false
) )
func dumpBalances(cmd *cobra.Command, _ []string) error { func dumpBalances(cmd *cobra.Command, _ []string) error {

View file

@ -7,7 +7,6 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/core/state" "github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/core/transaction" "github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/crypto/keys"
@ -414,16 +413,16 @@ func getNativeHashes(c Client) (map[string]util.Uint160, error) {
return nil, fmt.Errorf("can't get native contract hashes: %w", err) return nil, fmt.Errorf("can't get native contract hashes: %w", err)
} }
notaryEnabled := false //notaryEnabled := false
nativeHashes := make(map[string]util.Uint160, len(ns)) nativeHashes := make(map[string]util.Uint160, len(ns))
for i := range ns { for i := range ns {
if ns[i].Manifest.Name == nativenames.Notary { //if ns[i].Manifest.Name == nativenames.Notary {
notaryEnabled = len(ns[i].UpdateHistory) > 0 // notaryEnabled = len(ns[i].UpdateHistory) > 0
} //}
nativeHashes[ns[i].Manifest.Name] = ns[i].Hash nativeHashes[ns[i].Manifest.Name] = ns[i].Hash
} }
if !notaryEnabled { //if !notaryEnabled {
return nil, errors.New("notary contract must be enabled") // return nil, errors.New("notary contract must be enabled")
} //}
return nativeHashes, nil return nativeHashes, nil
} }

View file

@ -70,7 +70,6 @@ var (
containerContract, containerContract,
neofsIDContract, neofsIDContract,
netmapContract, netmapContract,
proxyContract,
reputationContract, reputationContract,
subnetContract, subnetContract,
} }
@ -521,7 +520,7 @@ func getContractDeployParameters(cs *contractState, deployData []interface{}) []
func (c *initializeContext) getContractDeployData(ctrName string, keysParam []interface{}) []interface{} { func (c *initializeContext) getContractDeployData(ctrName string, keysParam []interface{}) []interface{} {
items := make([]interface{}, 1, 6) items := make([]interface{}, 1, 6)
items[0] = false // notaryDisabled is false items[0] = true // notaryDisabled is false
switch ctrName { switch ctrName {
case neofsContract: case neofsContract:
@ -588,7 +587,7 @@ func (c *initializeContext) getAlphabetDeployItems(i, n int) []interface{} {
items := make([]interface{}, 6) items := make([]interface{}, 6)
items[0] = false items[0] = false
items[1] = c.Contracts[netmapContract].Hash items[1] = c.Contracts[netmapContract].Hash
items[2] = c.Contracts[proxyContract].Hash items[2] = util.Uint160{}
items[3] = innerring.GlagoliticLetter(i).String() items[3] = innerring.GlagoliticLetter(i).String()
items[4] = int64(i) items[4] = int64(i)
items[5] = int64(n) items[5] = int64(n)

View file

@ -9,6 +9,7 @@ import (
) )
func (c *initializeContext) setNotaryAndAlphabetNodes() error { func (c *initializeContext) setNotaryAndAlphabetNodes() error {
return nil
if ok, err := c.setRolesFinished(); ok || err != nil { if ok, err := c.setRolesFinished(); ok || err != nil {
if err == nil { if err == nil {
c.Command.Println("Stage 2: already performed.") c.Command.Println("Stage 2: already performed.")

View file

@ -135,6 +135,7 @@ func (c *initializeContext) multiSign(tx *transaction.Transaction, accType strin
} }
func (c *initializeContext) transferGASToProxy() error { func (c *initializeContext) transferGASToProxy() error {
return nil
gasHash := c.nativeHash(nativenames.Gas) gasHash := c.nativeHash(nativenames.Gas)
proxyCs := c.getContract(proxyContract) proxyCs := c.getContract(proxyContract)