forked from TrueCloudLab/frostfs-node
Disable things in notary disabled environment
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
606dfa3414
commit
6daf5cc438
5 changed files with 12 additions and 12 deletions
|
@ -40,7 +40,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 {
|
||||||
|
|
|
@ -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"
|
||||||
|
@ -359,16 +358,16 @@ func getNativeHashes(c *client.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
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,6 @@ var (
|
||||||
containerContract,
|
containerContract,
|
||||||
neofsIDContract,
|
neofsIDContract,
|
||||||
netmapContract,
|
netmapContract,
|
||||||
proxyContract,
|
|
||||||
reputationContract,
|
reputationContract,
|
||||||
subnetContract,
|
subnetContract,
|
||||||
}
|
}
|
||||||
|
@ -523,7 +522,7 @@ func getContractDeployParameters(rawNef, rawManif []byte, deployData []smartcont
|
||||||
|
|
||||||
func (c *initializeContext) getContractDeployData(ctrName string, keysParam []smartcontract.Parameter) []smartcontract.Parameter {
|
func (c *initializeContext) getContractDeployData(ctrName string, keysParam []smartcontract.Parameter) []smartcontract.Parameter {
|
||||||
items := make([]smartcontract.Parameter, 1, 6)
|
items := make([]smartcontract.Parameter, 1, 6)
|
||||||
items[0] = newContractParameter(smartcontract.BoolType, false) // notaryDisabled is false
|
items[0] = newContractParameter(smartcontract.BoolType, true) // notaryDisabled is true
|
||||||
|
|
||||||
switch ctrName {
|
switch ctrName {
|
||||||
case neofsContract:
|
case neofsContract:
|
||||||
|
@ -612,7 +611,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)
|
||||||
|
|
|
@ -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.")
|
||||||
|
|
|
@ -130,6 +130,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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue