permissions: code clean up based on review comments

This commit is contained in:
vsmk98 2019-05-13 15:29:47 +08:00
parent 38c1682ca4
commit cbad8d7b5d
6 changed files with 5 additions and 25 deletions

View File

@ -137,7 +137,6 @@ var (
utils.EVMInterpreterFlag,
configFileFlag,
utils.EnableNodePermissionFlag,
utils.PermissionContractAddressFlag,
utils.RaftModeFlag,
utils.RaftBlockTimeFlag,
utils.RaftJoinExistingFlag,

View File

@ -607,13 +607,6 @@ var (
Usage: "If enabled, the node will allow only a defined list of nodes to connect",
}
// Quorum permission contract
PermissionContractAddressFlag = cli.StringFlag{
Name: "permission.contract",
Usage: "If passed, the node will use this contract to bootstrap permission instead of contract from genesis.json",
Value: "0x",
}
// Istanbul settings
IstanbulRequestTimeoutFlag = cli.Uint64Flag{
Name: "istanbul.requesttimeout",

View File

@ -293,10 +293,8 @@ func (s *QuorumControlsAPI) validateOrg(orgId, pOrgId string) (ExecStatus, error
if types.OrgInfoMap.GetOrg(locOrgId) != nil {
return ErrOrgExists, errors.New("org exists")
}
} else {
if types.OrgInfoMap.GetOrg(orgId) != nil {
return ErrOrgExists, errors.New("org exists")
}
} else if types.OrgInfoMap.GetOrg(orgId) != nil {
return ErrOrgExists, errors.New("org exists")
}
return ExecSuccess, nil
}
@ -334,10 +332,8 @@ func (s *QuorumControlsAPI) valNodeStatusChange(orgId, url string, op int64) (Ex
if len(url) == 0 {
return ErrInvalidNode, errors.New("invalid node id")
}
if execStatus, err := s.valNodeDetails(url); err != nil {
if execStatus != ErrNodePresent {
return execStatus, errors.New("node not found")
}
if execStatus, err := s.valNodeDetails(url); err != nil && execStatus != ErrNodePresent {
return execStatus, errors.New("node not found")
}
node := types.NodeInfoMap.GetNodeByUrl(url)

View File

@ -1333,8 +1333,6 @@ func checkAccount(fromAcct common.Address, toAcct *common.Address) error {
case types.Transact:
if toAcct == nil {
return errors.New("account does not have contract create permissions")
} else {
return nil
}
}
return nil

View File

@ -195,7 +195,7 @@ When an organization is in suspended status, no transactions or contract deploy
#### quorumPermission.addSubOrg
This api can be executed by a organization admin account to create a sub organization under the master org.
* Input: parent org id, sub organization id, enode id (not mandatory and can be null), account id (not mandatory and can be 0x0)
* Input: parent org id, alphanumeric sub organization id, enode id (not mandatory and can be null), account id (not mandatory and can be 0x0)
* Output: Status of the operation
* Example:
```

View File

@ -343,12 +343,6 @@ func (s *Ethereum) APIs() []rpc.API {
Service: quorum.NewQuorumControlsAPI(s.txPool, s.accountManager),
Public: true,
},
{
Namespace: "quorumOrgMgmt",
Version: "1.0",
Service: quorum.NewQuorumControlsAPI(s.txPool, s.accountManager),
Public: true,
},
}...)
return apis
}