native: swap oracle and role management init

Role management doesn't need oracles, but oracles do need role management. See
neo-project/neo#2187.
This commit is contained in:
Roman Khimov 2021-01-12 21:27:42 +03:00
parent ca86b78536
commit 524bf9aaa0
3 changed files with 9 additions and 9 deletions

View file

@ -73,18 +73,18 @@ func NewContracts(p2pSigExtensionsEnabled bool) *Contracts {
cs.Policy = policy cs.Policy = policy
cs.Contracts = append(cs.Contracts, policy) cs.Contracts = append(cs.Contracts, policy)
oracle := newOracle()
oracle.GAS = gas
oracle.NEO = neo
cs.Oracle = oracle
cs.Contracts = append(cs.Contracts, oracle)
desig := newDesignate(p2pSigExtensionsEnabled) desig := newDesignate(p2pSigExtensionsEnabled)
desig.NEO = neo desig.NEO = neo
cs.Designate = desig cs.Designate = desig
cs.Oracle.Desig = desig
cs.Contracts = append(cs.Contracts, desig) cs.Contracts = append(cs.Contracts, desig)
oracle := newOracle()
oracle.GAS = gas
oracle.NEO = neo
oracle.Desig = desig
cs.Oracle = oracle
cs.Contracts = append(cs.Contracts, oracle)
if p2pSigExtensionsEnabled { if p2pSigExtensionsEnabled {
notary := newNotary() notary := newNotary()
notary.GAS = gas notary.GAS = gas

View file

@ -40,7 +40,7 @@ type oraclesData struct {
} }
const ( const (
designateContractID = -5 designateContractID = -4
// maxNodeCount is the maximum number of nodes to set the role for. // maxNodeCount is the maximum number of nodes to set the role for.
maxNodeCount = 32 maxNodeCount = 32

View file

@ -38,7 +38,7 @@ type Oracle struct {
} }
const ( const (
oracleContractID = -4 oracleContractID = -5
maxURLLength = 256 maxURLLength = 256
maxFilterLength = 128 maxFilterLength = 128
maxCallbackLength = 32 maxCallbackLength = 32