diff --git a/cmd/geth/main.go b/cmd/geth/main.go index d16f2a8ce..aed12b594 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -33,7 +33,6 @@ import ( "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/controls/permission" "github.com/ethereum/go-ethereum/core/quorum" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethclient" @@ -41,6 +40,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/permission" "gopkg.in/urfave/cli.v1" ) diff --git a/controls/bind/cluster/clusterkey_binding.go b/controls/bind/cluster/clusterkey_binding.go deleted file mode 100644 index 0e9155544..000000000 --- a/controls/bind/cluster/clusterkey_binding.go +++ /dev/null @@ -1,1662 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package cluster - -import ( - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// ClusterABI is the input ABI used to generate the binding from. -const ClusterABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"},{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"checkIfVoterExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"},{\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"getVoter\",\"outputs\":[{\"name\":\"_addr\",\"type\":\"address\"},{\"name\":\"_active\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_morgId\",\"type\":\"string\"}],\"name\":\"addSubOrg\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"getOrgKeyCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"getOrgPendingOp\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"approvePendingOp\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"checkIfKeyExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"deleteOrgKey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_keyIndex\",\"type\":\"uint256\"}],\"name\":\"getOrgKey\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"},{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"addVoter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"},{\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"deleteVoter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgIndex\",\"type\":\"uint256\"}],\"name\":\"getOrgInfo\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberOfOrgs\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_key\",\"type\":\"string\"}],\"name\":\"checkKeyClash\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"}],\"name\":\"getNumberOfVoters\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isVoter\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"}],\"name\":\"addMasterOrg\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"checkVotingAccountExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"},{\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"addOrgKey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_morgId\",\"type\":\"string\"}],\"name\":\"checkMasterOrgExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"getOrgVoteCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"checkOrgContractExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"getPendingOp\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"checkOrgPendingOp\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"checkOrgExists\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"MasterOrgAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"}],\"name\":\"SubOrgAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"OrgKeyAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"OrgKeyDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_pendingOp\",\"type\":\"uint8\"},{\"indexed\":false,\"name\":\"_tmKey\",\"type\":\"string\"}],\"name\":\"ItemForApproval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_orgId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"VoterDeleted\",\"type\":\"event\"}]" - -// Cluster is an auto generated Go binding around an Ethereum contract. -type Cluster struct { - ClusterCaller // Read-only binding to the contract - ClusterTransactor // Write-only binding to the contract - ClusterFilterer // Log filterer for contract events -} - -// ClusterCaller is an auto generated read-only Go binding around an Ethereum contract. -type ClusterCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ClusterTransactor is an auto generated write-only Go binding around an Ethereum contract. -type ClusterTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ClusterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ClusterFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ClusterSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ClusterSession struct { - Contract *Cluster // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ClusterCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ClusterCallerSession struct { - Contract *ClusterCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ClusterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ClusterTransactorSession struct { - Contract *ClusterTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ClusterRaw is an auto generated low-level Go binding around an Ethereum contract. -type ClusterRaw struct { - Contract *Cluster // Generic contract binding to access the raw methods on -} - -// ClusterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ClusterCallerRaw struct { - Contract *ClusterCaller // Generic read-only contract binding to access the raw methods on -} - -// ClusterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ClusterTransactorRaw struct { - Contract *ClusterTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewCluster creates a new instance of Cluster, bound to a specific deployed contract. -func NewCluster(address common.Address, backend bind.ContractBackend) (*Cluster, error) { - contract, err := bindCluster(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Cluster{ClusterCaller: ClusterCaller{contract: contract}, ClusterTransactor: ClusterTransactor{contract: contract}, ClusterFilterer: ClusterFilterer{contract: contract}}, nil -} - -// NewClusterCaller creates a new read-only instance of Cluster, bound to a specific deployed contract. -func NewClusterCaller(address common.Address, caller bind.ContractCaller) (*ClusterCaller, error) { - contract, err := bindCluster(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ClusterCaller{contract: contract}, nil -} - -// NewClusterTransactor creates a new write-only instance of Cluster, bound to a specific deployed contract. -func NewClusterTransactor(address common.Address, transactor bind.ContractTransactor) (*ClusterTransactor, error) { - contract, err := bindCluster(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ClusterTransactor{contract: contract}, nil -} - -// NewClusterFilterer creates a new log filterer instance of Cluster, bound to a specific deployed contract. -func NewClusterFilterer(address common.Address, filterer bind.ContractFilterer) (*ClusterFilterer, error) { - contract, err := bindCluster(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ClusterFilterer{contract: contract}, nil -} - -// bindCluster binds a generic wrapper to an already deployed contract. -func bindCluster(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ClusterABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Cluster *ClusterRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _Cluster.Contract.ClusterCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Cluster *ClusterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Cluster.Contract.ClusterTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Cluster *ClusterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Cluster.Contract.ClusterTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Cluster *ClusterCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _Cluster.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Cluster *ClusterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Cluster.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Cluster *ClusterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Cluster.Contract.contract.Transact(opts, method, params...) -} - -// CheckIfKeyExists is a free data retrieval call binding the contract method 0x4898598e. -// -// Solidity: function checkIfKeyExists(_orgId string, _tmKey string) constant returns(bool) -func (_Cluster *ClusterCaller) CheckIfKeyExists(opts *bind.CallOpts, _orgId string, _tmKey string) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "checkIfKeyExists", _orgId, _tmKey) - return *ret0, err -} - -// CheckIfKeyExists is a free data retrieval call binding the contract method 0x4898598e. -// -// Solidity: function checkIfKeyExists(_orgId string, _tmKey string) constant returns(bool) -func (_Cluster *ClusterSession) CheckIfKeyExists(_orgId string, _tmKey string) (bool, error) { - return _Cluster.Contract.CheckIfKeyExists(&_Cluster.CallOpts, _orgId, _tmKey) -} - -// CheckIfKeyExists is a free data retrieval call binding the contract method 0x4898598e. -// -// Solidity: function checkIfKeyExists(_orgId string, _tmKey string) constant returns(bool) -func (_Cluster *ClusterCallerSession) CheckIfKeyExists(_orgId string, _tmKey string) (bool, error) { - return _Cluster.Contract.CheckIfKeyExists(&_Cluster.CallOpts, _orgId, _tmKey) -} - -// CheckIfVoterExists is a free data retrieval call binding the contract method 0x00b813df. -// -// Solidity: function checkIfVoterExists(_morgId string, _address address) constant returns(bool) -func (_Cluster *ClusterCaller) CheckIfVoterExists(opts *bind.CallOpts, _morgId string, _address common.Address) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "checkIfVoterExists", _morgId, _address) - return *ret0, err -} - -// CheckIfVoterExists is a free data retrieval call binding the contract method 0x00b813df. -// -// Solidity: function checkIfVoterExists(_morgId string, _address address) constant returns(bool) -func (_Cluster *ClusterSession) CheckIfVoterExists(_morgId string, _address common.Address) (bool, error) { - return _Cluster.Contract.CheckIfVoterExists(&_Cluster.CallOpts, _morgId, _address) -} - -// CheckIfVoterExists is a free data retrieval call binding the contract method 0x00b813df. -// -// Solidity: function checkIfVoterExists(_morgId string, _address address) constant returns(bool) -func (_Cluster *ClusterCallerSession) CheckIfVoterExists(_morgId string, _address common.Address) (bool, error) { - return _Cluster.Contract.CheckIfVoterExists(&_Cluster.CallOpts, _morgId, _address) -} - -// CheckKeyClash is a free data retrieval call binding the contract method 0x8fde9c5e. -// -// Solidity: function checkKeyClash(_orgId string, _key string) constant returns(bool) -func (_Cluster *ClusterCaller) CheckKeyClash(opts *bind.CallOpts, _orgId string, _key string) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "checkKeyClash", _orgId, _key) - return *ret0, err -} - -// CheckKeyClash is a free data retrieval call binding the contract method 0x8fde9c5e. -// -// Solidity: function checkKeyClash(_orgId string, _key string) constant returns(bool) -func (_Cluster *ClusterSession) CheckKeyClash(_orgId string, _key string) (bool, error) { - return _Cluster.Contract.CheckKeyClash(&_Cluster.CallOpts, _orgId, _key) -} - -// CheckKeyClash is a free data retrieval call binding the contract method 0x8fde9c5e. -// -// Solidity: function checkKeyClash(_orgId string, _key string) constant returns(bool) -func (_Cluster *ClusterCallerSession) CheckKeyClash(_orgId string, _key string) (bool, error) { - return _Cluster.Contract.CheckKeyClash(&_Cluster.CallOpts, _orgId, _key) -} - -// CheckMasterOrgExists is a free data retrieval call binding the contract method 0xd912967a. -// -// Solidity: function checkMasterOrgExists(_morgId string) constant returns(bool) -func (_Cluster *ClusterCaller) CheckMasterOrgExists(opts *bind.CallOpts, _morgId string) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "checkMasterOrgExists", _morgId) - return *ret0, err -} - -// CheckMasterOrgExists is a free data retrieval call binding the contract method 0xd912967a. -// -// Solidity: function checkMasterOrgExists(_morgId string) constant returns(bool) -func (_Cluster *ClusterSession) CheckMasterOrgExists(_morgId string) (bool, error) { - return _Cluster.Contract.CheckMasterOrgExists(&_Cluster.CallOpts, _morgId) -} - -// CheckMasterOrgExists is a free data retrieval call binding the contract method 0xd912967a. -// -// Solidity: function checkMasterOrgExists(_morgId string) constant returns(bool) -func (_Cluster *ClusterCallerSession) CheckMasterOrgExists(_morgId string) (bool, error) { - return _Cluster.Contract.CheckMasterOrgExists(&_Cluster.CallOpts, _morgId) -} - -// CheckOrgContractExists is a free data retrieval call binding the contract method 0xee0c7dda. -// -// Solidity: function checkOrgContractExists() constant returns(bool) -func (_Cluster *ClusterCaller) CheckOrgContractExists(opts *bind.CallOpts) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "checkOrgContractExists") - return *ret0, err -} - -// CheckOrgContractExists is a free data retrieval call binding the contract method 0xee0c7dda. -// -// Solidity: function checkOrgContractExists() constant returns(bool) -func (_Cluster *ClusterSession) CheckOrgContractExists() (bool, error) { - return _Cluster.Contract.CheckOrgContractExists(&_Cluster.CallOpts) -} - -// CheckOrgContractExists is a free data retrieval call binding the contract method 0xee0c7dda. -// -// Solidity: function checkOrgContractExists() constant returns(bool) -func (_Cluster *ClusterCallerSession) CheckOrgContractExists() (bool, error) { - return _Cluster.Contract.CheckOrgContractExists(&_Cluster.CallOpts) -} - -// CheckOrgExists is a free data retrieval call binding the contract method 0xffe40d1d. -// -// Solidity: function checkOrgExists(_orgId string) constant returns(bool) -func (_Cluster *ClusterCaller) CheckOrgExists(opts *bind.CallOpts, _orgId string) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "checkOrgExists", _orgId) - return *ret0, err -} - -// CheckOrgExists is a free data retrieval call binding the contract method 0xffe40d1d. -// -// Solidity: function checkOrgExists(_orgId string) constant returns(bool) -func (_Cluster *ClusterSession) CheckOrgExists(_orgId string) (bool, error) { - return _Cluster.Contract.CheckOrgExists(&_Cluster.CallOpts, _orgId) -} - -// CheckOrgExists is a free data retrieval call binding the contract method 0xffe40d1d. -// -// Solidity: function checkOrgExists(_orgId string) constant returns(bool) -func (_Cluster *ClusterCallerSession) CheckOrgExists(_orgId string) (bool, error) { - return _Cluster.Contract.CheckOrgExists(&_Cluster.CallOpts, _orgId) -} - -// CheckOrgPendingOp is a free data retrieval call binding the contract method 0xfb23dedc. -// -// Solidity: function checkOrgPendingOp(_orgId string) constant returns(bool) -func (_Cluster *ClusterCaller) CheckOrgPendingOp(opts *bind.CallOpts, _orgId string) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "checkOrgPendingOp", _orgId) - return *ret0, err -} - -// CheckOrgPendingOp is a free data retrieval call binding the contract method 0xfb23dedc. -// -// Solidity: function checkOrgPendingOp(_orgId string) constant returns(bool) -func (_Cluster *ClusterSession) CheckOrgPendingOp(_orgId string) (bool, error) { - return _Cluster.Contract.CheckOrgPendingOp(&_Cluster.CallOpts, _orgId) -} - -// CheckOrgPendingOp is a free data retrieval call binding the contract method 0xfb23dedc. -// -// Solidity: function checkOrgPendingOp(_orgId string) constant returns(bool) -func (_Cluster *ClusterCallerSession) CheckOrgPendingOp(_orgId string) (bool, error) { - return _Cluster.Contract.CheckOrgPendingOp(&_Cluster.CallOpts, _orgId) -} - -// CheckVotingAccountExists is a free data retrieval call binding the contract method 0xcb2c45dc. -// -// Solidity: function checkVotingAccountExists(_orgId string) constant returns(bool) -func (_Cluster *ClusterCaller) CheckVotingAccountExists(opts *bind.CallOpts, _orgId string) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "checkVotingAccountExists", _orgId) - return *ret0, err -} - -// CheckVotingAccountExists is a free data retrieval call binding the contract method 0xcb2c45dc. -// -// Solidity: function checkVotingAccountExists(_orgId string) constant returns(bool) -func (_Cluster *ClusterSession) CheckVotingAccountExists(_orgId string) (bool, error) { - return _Cluster.Contract.CheckVotingAccountExists(&_Cluster.CallOpts, _orgId) -} - -// CheckVotingAccountExists is a free data retrieval call binding the contract method 0xcb2c45dc. -// -// Solidity: function checkVotingAccountExists(_orgId string) constant returns(bool) -func (_Cluster *ClusterCallerSession) CheckVotingAccountExists(_orgId string) (bool, error) { - return _Cluster.Contract.CheckVotingAccountExists(&_Cluster.CallOpts, _orgId) -} - -// GetNumberOfOrgs is a free data retrieval call binding the contract method 0x7755ebdd. -// -// Solidity: function getNumberOfOrgs() constant returns(uint256) -func (_Cluster *ClusterCaller) GetNumberOfOrgs(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "getNumberOfOrgs") - return *ret0, err -} - -// GetNumberOfOrgs is a free data retrieval call binding the contract method 0x7755ebdd. -// -// Solidity: function getNumberOfOrgs() constant returns(uint256) -func (_Cluster *ClusterSession) GetNumberOfOrgs() (*big.Int, error) { - return _Cluster.Contract.GetNumberOfOrgs(&_Cluster.CallOpts) -} - -// GetNumberOfOrgs is a free data retrieval call binding the contract method 0x7755ebdd. -// -// Solidity: function getNumberOfOrgs() constant returns(uint256) -func (_Cluster *ClusterCallerSession) GetNumberOfOrgs() (*big.Int, error) { - return _Cluster.Contract.GetNumberOfOrgs(&_Cluster.CallOpts) -} - -// GetNumberOfVoters is a free data retrieval call binding the contract method 0x9b904f0a. -// -// Solidity: function getNumberOfVoters(_morgId string) constant returns(uint256) -func (_Cluster *ClusterCaller) GetNumberOfVoters(opts *bind.CallOpts, _morgId string) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "getNumberOfVoters", _morgId) - return *ret0, err -} - -// GetNumberOfVoters is a free data retrieval call binding the contract method 0x9b904f0a. -// -// Solidity: function getNumberOfVoters(_morgId string) constant returns(uint256) -func (_Cluster *ClusterSession) GetNumberOfVoters(_morgId string) (*big.Int, error) { - return _Cluster.Contract.GetNumberOfVoters(&_Cluster.CallOpts, _morgId) -} - -// GetNumberOfVoters is a free data retrieval call binding the contract method 0x9b904f0a. -// -// Solidity: function getNumberOfVoters(_morgId string) constant returns(uint256) -func (_Cluster *ClusterCallerSession) GetNumberOfVoters(_morgId string) (*big.Int, error) { - return _Cluster.Contract.GetNumberOfVoters(&_Cluster.CallOpts, _morgId) -} - -// GetOrgInfo is a free data retrieval call binding the contract method 0x5c4f32ee. -// -// Solidity: function getOrgInfo(_orgIndex uint256) constant returns(string, string) -func (_Cluster *ClusterCaller) GetOrgInfo(opts *bind.CallOpts, _orgIndex *big.Int) (string, string, error) { - var ( - ret0 = new(string) - ret1 = new(string) - ) - out := &[]interface{}{ - ret0, - ret1, - } - err := _Cluster.contract.Call(opts, out, "getOrgInfo", _orgIndex) - return *ret0, *ret1, err -} - -// GetOrgInfo is a free data retrieval call binding the contract method 0x5c4f32ee. -// -// Solidity: function getOrgInfo(_orgIndex uint256) constant returns(string, string) -func (_Cluster *ClusterSession) GetOrgInfo(_orgIndex *big.Int) (string, string, error) { - return _Cluster.Contract.GetOrgInfo(&_Cluster.CallOpts, _orgIndex) -} - -// GetOrgInfo is a free data retrieval call binding the contract method 0x5c4f32ee. -// -// Solidity: function getOrgInfo(_orgIndex uint256) constant returns(string, string) -func (_Cluster *ClusterCallerSession) GetOrgInfo(_orgIndex *big.Int) (string, string, error) { - return _Cluster.Contract.GetOrgInfo(&_Cluster.CallOpts, _orgIndex) -} - -// GetOrgKey is a free data retrieval call binding the contract method 0x5002dadf. -// -// Solidity: function getOrgKey(_orgId string, _keyIndex uint256) constant returns(string, bool) -func (_Cluster *ClusterCaller) GetOrgKey(opts *bind.CallOpts, _orgId string, _keyIndex *big.Int) (string, bool, error) { - var ( - ret0 = new(string) - ret1 = new(bool) - ) - out := &[]interface{}{ - ret0, - ret1, - } - err := _Cluster.contract.Call(opts, out, "getOrgKey", _orgId, _keyIndex) - return *ret0, *ret1, err -} - -// GetOrgKey is a free data retrieval call binding the contract method 0x5002dadf. -// -// Solidity: function getOrgKey(_orgId string, _keyIndex uint256) constant returns(string, bool) -func (_Cluster *ClusterSession) GetOrgKey(_orgId string, _keyIndex *big.Int) (string, bool, error) { - return _Cluster.Contract.GetOrgKey(&_Cluster.CallOpts, _orgId, _keyIndex) -} - -// GetOrgKey is a free data retrieval call binding the contract method 0x5002dadf. -// -// Solidity: function getOrgKey(_orgId string, _keyIndex uint256) constant returns(string, bool) -func (_Cluster *ClusterCallerSession) GetOrgKey(_orgId string, _keyIndex *big.Int) (string, bool, error) { - return _Cluster.Contract.GetOrgKey(&_Cluster.CallOpts, _orgId, _keyIndex) -} - -// GetOrgKeyCount is a free data retrieval call binding the contract method 0x243cc506. -// -// Solidity: function getOrgKeyCount(_orgId string) constant returns(uint256) -func (_Cluster *ClusterCaller) GetOrgKeyCount(opts *bind.CallOpts, _orgId string) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "getOrgKeyCount", _orgId) - return *ret0, err -} - -// GetOrgKeyCount is a free data retrieval call binding the contract method 0x243cc506. -// -// Solidity: function getOrgKeyCount(_orgId string) constant returns(uint256) -func (_Cluster *ClusterSession) GetOrgKeyCount(_orgId string) (*big.Int, error) { - return _Cluster.Contract.GetOrgKeyCount(&_Cluster.CallOpts, _orgId) -} - -// GetOrgKeyCount is a free data retrieval call binding the contract method 0x243cc506. -// -// Solidity: function getOrgKeyCount(_orgId string) constant returns(uint256) -func (_Cluster *ClusterCallerSession) GetOrgKeyCount(_orgId string) (*big.Int, error) { - return _Cluster.Contract.GetOrgKeyCount(&_Cluster.CallOpts, _orgId) -} - -// GetOrgPendingOp is a free data retrieval call binding the contract method 0x33680eb7. -// -// Solidity: function getOrgPendingOp(_orgId string) constant returns(string, uint8) -func (_Cluster *ClusterCaller) GetOrgPendingOp(opts *bind.CallOpts, _orgId string) (string, uint8, error) { - var ( - ret0 = new(string) - ret1 = new(uint8) - ) - out := &[]interface{}{ - ret0, - ret1, - } - err := _Cluster.contract.Call(opts, out, "getOrgPendingOp", _orgId) - return *ret0, *ret1, err -} - -// GetOrgPendingOp is a free data retrieval call binding the contract method 0x33680eb7. -// -// Solidity: function getOrgPendingOp(_orgId string) constant returns(string, uint8) -func (_Cluster *ClusterSession) GetOrgPendingOp(_orgId string) (string, uint8, error) { - return _Cluster.Contract.GetOrgPendingOp(&_Cluster.CallOpts, _orgId) -} - -// GetOrgPendingOp is a free data retrieval call binding the contract method 0x33680eb7. -// -// Solidity: function getOrgPendingOp(_orgId string) constant returns(string, uint8) -func (_Cluster *ClusterCallerSession) GetOrgPendingOp(_orgId string) (string, uint8, error) { - return _Cluster.Contract.GetOrgPendingOp(&_Cluster.CallOpts, _orgId) -} - -// GetOrgVoteCount is a free data retrieval call binding the contract method 0xe7089a0c. -// -// Solidity: function getOrgVoteCount(_orgId string) constant returns(uint256) -func (_Cluster *ClusterCaller) GetOrgVoteCount(opts *bind.CallOpts, _orgId string) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "getOrgVoteCount", _orgId) - return *ret0, err -} - -// GetOrgVoteCount is a free data retrieval call binding the contract method 0xe7089a0c. -// -// Solidity: function getOrgVoteCount(_orgId string) constant returns(uint256) -func (_Cluster *ClusterSession) GetOrgVoteCount(_orgId string) (*big.Int, error) { - return _Cluster.Contract.GetOrgVoteCount(&_Cluster.CallOpts, _orgId) -} - -// GetOrgVoteCount is a free data retrieval call binding the contract method 0xe7089a0c. -// -// Solidity: function getOrgVoteCount(_orgId string) constant returns(uint256) -func (_Cluster *ClusterCallerSession) GetOrgVoteCount(_orgId string) (*big.Int, error) { - return _Cluster.Contract.GetOrgVoteCount(&_Cluster.CallOpts, _orgId) -} - -// GetPendingOp is a free data retrieval call binding the contract method 0xf346a3a7. -// -// Solidity: function getPendingOp(_orgId string) constant returns(string, uint8) -func (_Cluster *ClusterCaller) GetPendingOp(opts *bind.CallOpts, _orgId string) (string, uint8, error) { - var ( - ret0 = new(string) - ret1 = new(uint8) - ) - out := &[]interface{}{ - ret0, - ret1, - } - err := _Cluster.contract.Call(opts, out, "getPendingOp", _orgId) - return *ret0, *ret1, err -} - -// GetPendingOp is a free data retrieval call binding the contract method 0xf346a3a7. -// -// Solidity: function getPendingOp(_orgId string) constant returns(string, uint8) -func (_Cluster *ClusterSession) GetPendingOp(_orgId string) (string, uint8, error) { - return _Cluster.Contract.GetPendingOp(&_Cluster.CallOpts, _orgId) -} - -// GetPendingOp is a free data retrieval call binding the contract method 0xf346a3a7. -// -// Solidity: function getPendingOp(_orgId string) constant returns(string, uint8) -func (_Cluster *ClusterCallerSession) GetPendingOp(_orgId string) (string, uint8, error) { - return _Cluster.Contract.GetPendingOp(&_Cluster.CallOpts, _orgId) -} - -// GetVoter is a free data retrieval call binding the contract method 0x17a2fb72. -// -// Solidity: function getVoter(_morgId string, i uint256) constant returns(_addr address, _active bool) -func (_Cluster *ClusterCaller) GetVoter(opts *bind.CallOpts, _morgId string, i *big.Int) (struct { - Addr common.Address - Active bool -}, error) { - ret := new(struct { - Addr common.Address - Active bool - }) - out := ret - err := _Cluster.contract.Call(opts, out, "getVoter", _morgId, i) - return *ret, err -} - -// GetVoter is a free data retrieval call binding the contract method 0x17a2fb72. -// -// Solidity: function getVoter(_morgId string, i uint256) constant returns(_addr address, _active bool) -func (_Cluster *ClusterSession) GetVoter(_morgId string, i *big.Int) (struct { - Addr common.Address - Active bool -}, error) { - return _Cluster.Contract.GetVoter(&_Cluster.CallOpts, _morgId, i) -} - -// GetVoter is a free data retrieval call binding the contract method 0x17a2fb72. -// -// Solidity: function getVoter(_morgId string, i uint256) constant returns(_addr address, _active bool) -func (_Cluster *ClusterCallerSession) GetVoter(_morgId string, i *big.Int) (struct { - Addr common.Address - Active bool -}, error) { - return _Cluster.Contract.GetVoter(&_Cluster.CallOpts, _morgId, i) -} - -// IsVoter is a free data retrieval call binding the contract method 0xbd9e887a. -// -// Solidity: function isVoter(_orgId string, account address) constant returns(bool) -func (_Cluster *ClusterCaller) IsVoter(opts *bind.CallOpts, _orgId string, account common.Address) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Cluster.contract.Call(opts, out, "isVoter", _orgId, account) - return *ret0, err -} - -// IsVoter is a free data retrieval call binding the contract method 0xbd9e887a. -// -// Solidity: function isVoter(_orgId string, account address) constant returns(bool) -func (_Cluster *ClusterSession) IsVoter(_orgId string, account common.Address) (bool, error) { - return _Cluster.Contract.IsVoter(&_Cluster.CallOpts, _orgId, account) -} - -// IsVoter is a free data retrieval call binding the contract method 0xbd9e887a. -// -// Solidity: function isVoter(_orgId string, account address) constant returns(bool) -func (_Cluster *ClusterCallerSession) IsVoter(_orgId string, account common.Address) (bool, error) { - return _Cluster.Contract.IsVoter(&_Cluster.CallOpts, _orgId, account) -} - -// AddMasterOrg is a paid mutator transaction binding the contract method 0xc7304f3f. -// -// Solidity: function addMasterOrg(_morgId string) returns() -func (_Cluster *ClusterTransactor) AddMasterOrg(opts *bind.TransactOpts, _morgId string) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "addMasterOrg", _morgId) -} - -// AddMasterOrg is a paid mutator transaction binding the contract method 0xc7304f3f. -// -// Solidity: function addMasterOrg(_morgId string) returns() -func (_Cluster *ClusterSession) AddMasterOrg(_morgId string) (*types.Transaction, error) { - return _Cluster.Contract.AddMasterOrg(&_Cluster.TransactOpts, _morgId) -} - -// AddMasterOrg is a paid mutator transaction binding the contract method 0xc7304f3f. -// -// Solidity: function addMasterOrg(_morgId string) returns() -func (_Cluster *ClusterTransactorSession) AddMasterOrg(_morgId string) (*types.Transaction, error) { - return _Cluster.Contract.AddMasterOrg(&_Cluster.TransactOpts, _morgId) -} - -// AddOrgKey is a paid mutator transaction binding the contract method 0xd88ce6bb. -// -// Solidity: function addOrgKey(_orgId string, _tmKey string) returns() -func (_Cluster *ClusterTransactor) AddOrgKey(opts *bind.TransactOpts, _orgId string, _tmKey string) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "addOrgKey", _orgId, _tmKey) -} - -// AddOrgKey is a paid mutator transaction binding the contract method 0xd88ce6bb. -// -// Solidity: function addOrgKey(_orgId string, _tmKey string) returns() -func (_Cluster *ClusterSession) AddOrgKey(_orgId string, _tmKey string) (*types.Transaction, error) { - return _Cluster.Contract.AddOrgKey(&_Cluster.TransactOpts, _orgId, _tmKey) -} - -// AddOrgKey is a paid mutator transaction binding the contract method 0xd88ce6bb. -// -// Solidity: function addOrgKey(_orgId string, _tmKey string) returns() -func (_Cluster *ClusterTransactorSession) AddOrgKey(_orgId string, _tmKey string) (*types.Transaction, error) { - return _Cluster.Contract.AddOrgKey(&_Cluster.TransactOpts, _orgId, _tmKey) -} - -// AddSubOrg is a paid mutator transaction binding the contract method 0x1f953480. -// -// Solidity: function addSubOrg(_orgId string, _morgId string) returns() -func (_Cluster *ClusterTransactor) AddSubOrg(opts *bind.TransactOpts, _orgId string, _morgId string) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "addSubOrg", _orgId, _morgId) -} - -// AddSubOrg is a paid mutator transaction binding the contract method 0x1f953480. -// -// Solidity: function addSubOrg(_orgId string, _morgId string) returns() -func (_Cluster *ClusterSession) AddSubOrg(_orgId string, _morgId string) (*types.Transaction, error) { - return _Cluster.Contract.AddSubOrg(&_Cluster.TransactOpts, _orgId, _morgId) -} - -// AddSubOrg is a paid mutator transaction binding the contract method 0x1f953480. -// -// Solidity: function addSubOrg(_orgId string, _morgId string) returns() -func (_Cluster *ClusterTransactorSession) AddSubOrg(_orgId string, _morgId string) (*types.Transaction, error) { - return _Cluster.Contract.AddSubOrg(&_Cluster.TransactOpts, _orgId, _morgId) -} - -// AddVoter is a paid mutator transaction binding the contract method 0x5607395b. -// -// Solidity: function addVoter(_morgId string, _address address) returns() -func (_Cluster *ClusterTransactor) AddVoter(opts *bind.TransactOpts, _morgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "addVoter", _morgId, _address) -} - -// AddVoter is a paid mutator transaction binding the contract method 0x5607395b. -// -// Solidity: function addVoter(_morgId string, _address address) returns() -func (_Cluster *ClusterSession) AddVoter(_morgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.Contract.AddVoter(&_Cluster.TransactOpts, _morgId, _address) -} - -// AddVoter is a paid mutator transaction binding the contract method 0x5607395b. -// -// Solidity: function addVoter(_morgId string, _address address) returns() -func (_Cluster *ClusterTransactorSession) AddVoter(_morgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.Contract.AddVoter(&_Cluster.TransactOpts, _morgId, _address) -} - -// ApprovePendingOp is a paid mutator transaction binding the contract method 0x35dc4772. -// -// Solidity: function approvePendingOp(_orgId string) returns() -func (_Cluster *ClusterTransactor) ApprovePendingOp(opts *bind.TransactOpts, _orgId string) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "approvePendingOp", _orgId) -} - -// ApprovePendingOp is a paid mutator transaction binding the contract method 0x35dc4772. -// -// Solidity: function approvePendingOp(_orgId string) returns() -func (_Cluster *ClusterSession) ApprovePendingOp(_orgId string) (*types.Transaction, error) { - return _Cluster.Contract.ApprovePendingOp(&_Cluster.TransactOpts, _orgId) -} - -// ApprovePendingOp is a paid mutator transaction binding the contract method 0x35dc4772. -// -// Solidity: function approvePendingOp(_orgId string) returns() -func (_Cluster *ClusterTransactorSession) ApprovePendingOp(_orgId string) (*types.Transaction, error) { - return _Cluster.Contract.ApprovePendingOp(&_Cluster.TransactOpts, _orgId) -} - -// DeleteOrgKey is a paid mutator transaction binding the contract method 0x49379c50. -// -// Solidity: function deleteOrgKey(_orgId string, _tmKey string) returns() -func (_Cluster *ClusterTransactor) DeleteOrgKey(opts *bind.TransactOpts, _orgId string, _tmKey string) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "deleteOrgKey", _orgId, _tmKey) -} - -// DeleteOrgKey is a paid mutator transaction binding the contract method 0x49379c50. -// -// Solidity: function deleteOrgKey(_orgId string, _tmKey string) returns() -func (_Cluster *ClusterSession) DeleteOrgKey(_orgId string, _tmKey string) (*types.Transaction, error) { - return _Cluster.Contract.DeleteOrgKey(&_Cluster.TransactOpts, _orgId, _tmKey) -} - -// DeleteOrgKey is a paid mutator transaction binding the contract method 0x49379c50. -// -// Solidity: function deleteOrgKey(_orgId string, _tmKey string) returns() -func (_Cluster *ClusterTransactorSession) DeleteOrgKey(_orgId string, _tmKey string) (*types.Transaction, error) { - return _Cluster.Contract.DeleteOrgKey(&_Cluster.TransactOpts, _orgId, _tmKey) -} - -// DeleteVoter is a paid mutator transaction binding the contract method 0x59cbd6fe. -// -// Solidity: function deleteVoter(_morgId string, _address address) returns() -func (_Cluster *ClusterTransactor) DeleteVoter(opts *bind.TransactOpts, _morgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.contract.Transact(opts, "deleteVoter", _morgId, _address) -} - -// DeleteVoter is a paid mutator transaction binding the contract method 0x59cbd6fe. -// -// Solidity: function deleteVoter(_morgId string, _address address) returns() -func (_Cluster *ClusterSession) DeleteVoter(_morgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.Contract.DeleteVoter(&_Cluster.TransactOpts, _morgId, _address) -} - -// DeleteVoter is a paid mutator transaction binding the contract method 0x59cbd6fe. -// -// Solidity: function deleteVoter(_morgId string, _address address) returns() -func (_Cluster *ClusterTransactorSession) DeleteVoter(_morgId string, _address common.Address) (*types.Transaction, error) { - return _Cluster.Contract.DeleteVoter(&_Cluster.TransactOpts, _morgId, _address) -} - -// ClusterItemForApprovalIterator is returned from FilterItemForApproval and is used to iterate over the raw logs and unpacked data for ItemForApproval events raised by the Cluster contract. -type ClusterItemForApprovalIterator struct { - Event *ClusterItemForApproval // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterItemForApprovalIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterItemForApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterItemForApproval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterItemForApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterItemForApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterItemForApproval represents a ItemForApproval event raised by the Cluster contract. -type ClusterItemForApproval struct { - OrgId string - PendingOp uint8 - TmKey string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterItemForApproval is a free log retrieval operation binding the contract event 0x4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a. -// -// Solidity: e ItemForApproval(_orgId string, _pendingOp uint8, _tmKey string) -func (_Cluster *ClusterFilterer) FilterItemForApproval(opts *bind.FilterOpts) (*ClusterItemForApprovalIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "ItemForApproval") - if err != nil { - return nil, err - } - return &ClusterItemForApprovalIterator{contract: _Cluster.contract, event: "ItemForApproval", logs: logs, sub: sub}, nil -} - -// WatchItemForApproval is a free log subscription operation binding the contract event 0x4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a. -// -// Solidity: e ItemForApproval(_orgId string, _pendingOp uint8, _tmKey string) -func (_Cluster *ClusterFilterer) WatchItemForApproval(opts *bind.WatchOpts, sink chan<- *ClusterItemForApproval) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "ItemForApproval") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterItemForApproval) - if err := _Cluster.contract.UnpackLog(event, "ItemForApproval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ClusterMasterOrgAddedIterator is returned from FilterMasterOrgAdded and is used to iterate over the raw logs and unpacked data for MasterOrgAdded events raised by the Cluster contract. -type ClusterMasterOrgAddedIterator struct { - Event *ClusterMasterOrgAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterMasterOrgAddedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterMasterOrgAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterMasterOrgAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterMasterOrgAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterMasterOrgAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterMasterOrgAdded represents a MasterOrgAdded event raised by the Cluster contract. -type ClusterMasterOrgAdded struct { - OrgId string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterMasterOrgAdded is a free log retrieval operation binding the contract event 0xfe62f8d1508aa8ddbb57fd8a6d631f4418cfcbafa90c6ce6d4b8105da5609729. -// -// Solidity: e MasterOrgAdded(_orgId string) -func (_Cluster *ClusterFilterer) FilterMasterOrgAdded(opts *bind.FilterOpts) (*ClusterMasterOrgAddedIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "MasterOrgAdded") - if err != nil { - return nil, err - } - return &ClusterMasterOrgAddedIterator{contract: _Cluster.contract, event: "MasterOrgAdded", logs: logs, sub: sub}, nil -} - -// WatchMasterOrgAdded is a free log subscription operation binding the contract event 0xfe62f8d1508aa8ddbb57fd8a6d631f4418cfcbafa90c6ce6d4b8105da5609729. -// -// Solidity: e MasterOrgAdded(_orgId string) -func (_Cluster *ClusterFilterer) WatchMasterOrgAdded(opts *bind.WatchOpts, sink chan<- *ClusterMasterOrgAdded) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "MasterOrgAdded") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterMasterOrgAdded) - if err := _Cluster.contract.UnpackLog(event, "MasterOrgAdded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ClusterOrgKeyAddedIterator is returned from FilterOrgKeyAdded and is used to iterate over the raw logs and unpacked data for OrgKeyAdded events raised by the Cluster contract. -type ClusterOrgKeyAddedIterator struct { - Event *ClusterOrgKeyAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterOrgKeyAddedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterOrgKeyAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterOrgKeyAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterOrgKeyAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterOrgKeyAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterOrgKeyAdded represents a OrgKeyAdded event raised by the Cluster contract. -type ClusterOrgKeyAdded struct { - OrgId string - TmKey string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOrgKeyAdded is a free log retrieval operation binding the contract event 0x6f4d370520782587dabc737a258f46de81ad45d733a42cd5a0045cff1e46deb4. -// -// Solidity: e OrgKeyAdded(_orgId string, _tmKey string) -func (_Cluster *ClusterFilterer) FilterOrgKeyAdded(opts *bind.FilterOpts) (*ClusterOrgKeyAddedIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "OrgKeyAdded") - if err != nil { - return nil, err - } - return &ClusterOrgKeyAddedIterator{contract: _Cluster.contract, event: "OrgKeyAdded", logs: logs, sub: sub}, nil -} - -// WatchOrgKeyAdded is a free log subscription operation binding the contract event 0x6f4d370520782587dabc737a258f46de81ad45d733a42cd5a0045cff1e46deb4. -// -// Solidity: e OrgKeyAdded(_orgId string, _tmKey string) -func (_Cluster *ClusterFilterer) WatchOrgKeyAdded(opts *bind.WatchOpts, sink chan<- *ClusterOrgKeyAdded) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "OrgKeyAdded") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterOrgKeyAdded) - if err := _Cluster.contract.UnpackLog(event, "OrgKeyAdded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ClusterOrgKeyDeletedIterator is returned from FilterOrgKeyDeleted and is used to iterate over the raw logs and unpacked data for OrgKeyDeleted events raised by the Cluster contract. -type ClusterOrgKeyDeletedIterator struct { - Event *ClusterOrgKeyDeleted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterOrgKeyDeletedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterOrgKeyDeleted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterOrgKeyDeleted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterOrgKeyDeletedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterOrgKeyDeletedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterOrgKeyDeleted represents a OrgKeyDeleted event raised by the Cluster contract. -type ClusterOrgKeyDeleted struct { - OrgId string - TmKey string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOrgKeyDeleted is a free log retrieval operation binding the contract event 0x2e0a2dc845dce9ef7206b8fe38f3dacaad17ba74d7be9fba469c9858ae16a5d6. -// -// Solidity: e OrgKeyDeleted(_orgId string, _tmKey string) -func (_Cluster *ClusterFilterer) FilterOrgKeyDeleted(opts *bind.FilterOpts) (*ClusterOrgKeyDeletedIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "OrgKeyDeleted") - if err != nil { - return nil, err - } - return &ClusterOrgKeyDeletedIterator{contract: _Cluster.contract, event: "OrgKeyDeleted", logs: logs, sub: sub}, nil -} - -// WatchOrgKeyDeleted is a free log subscription operation binding the contract event 0x2e0a2dc845dce9ef7206b8fe38f3dacaad17ba74d7be9fba469c9858ae16a5d6. -// -// Solidity: e OrgKeyDeleted(_orgId string, _tmKey string) -func (_Cluster *ClusterFilterer) WatchOrgKeyDeleted(opts *bind.WatchOpts, sink chan<- *ClusterOrgKeyDeleted) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "OrgKeyDeleted") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterOrgKeyDeleted) - if err := _Cluster.contract.UnpackLog(event, "OrgKeyDeleted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ClusterSubOrgAddedIterator is returned from FilterSubOrgAdded and is used to iterate over the raw logs and unpacked data for SubOrgAdded events raised by the Cluster contract. -type ClusterSubOrgAddedIterator struct { - Event *ClusterSubOrgAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterSubOrgAddedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterSubOrgAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterSubOrgAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterSubOrgAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterSubOrgAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterSubOrgAdded represents a SubOrgAdded event raised by the Cluster contract. -type ClusterSubOrgAdded struct { - OrgId string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSubOrgAdded is a free log retrieval operation binding the contract event 0xd734c07873f32f0735016e51dc718e21a48a3bec999d5be38cf3af363fbfedab. -// -// Solidity: e SubOrgAdded(_orgId string) -func (_Cluster *ClusterFilterer) FilterSubOrgAdded(opts *bind.FilterOpts) (*ClusterSubOrgAddedIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "SubOrgAdded") - if err != nil { - return nil, err - } - return &ClusterSubOrgAddedIterator{contract: _Cluster.contract, event: "SubOrgAdded", logs: logs, sub: sub}, nil -} - -// WatchSubOrgAdded is a free log subscription operation binding the contract event 0xd734c07873f32f0735016e51dc718e21a48a3bec999d5be38cf3af363fbfedab. -// -// Solidity: e SubOrgAdded(_orgId string) -func (_Cluster *ClusterFilterer) WatchSubOrgAdded(opts *bind.WatchOpts, sink chan<- *ClusterSubOrgAdded) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "SubOrgAdded") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterSubOrgAdded) - if err := _Cluster.contract.UnpackLog(event, "SubOrgAdded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ClusterVoterAddedIterator is returned from FilterVoterAdded and is used to iterate over the raw logs and unpacked data for VoterAdded events raised by the Cluster contract. -type ClusterVoterAddedIterator struct { - Event *ClusterVoterAdded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterVoterAddedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterVoterAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterVoterAdded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterVoterAddedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterVoterAddedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterVoterAdded represents a VoterAdded event raised by the Cluster contract. -type ClusterVoterAdded struct { - OrgId string - Address common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterVoterAdded is a free log retrieval operation binding the contract event 0x424f3ad05c61ea35cad66f22b70b1fad7250d8229921238078c401db36d34574. -// -// Solidity: e VoterAdded(_orgId string, _address address) -func (_Cluster *ClusterFilterer) FilterVoterAdded(opts *bind.FilterOpts) (*ClusterVoterAddedIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "VoterAdded") - if err != nil { - return nil, err - } - return &ClusterVoterAddedIterator{contract: _Cluster.contract, event: "VoterAdded", logs: logs, sub: sub}, nil -} - -// WatchVoterAdded is a free log subscription operation binding the contract event 0x424f3ad05c61ea35cad66f22b70b1fad7250d8229921238078c401db36d34574. -// -// Solidity: e VoterAdded(_orgId string, _address address) -func (_Cluster *ClusterFilterer) WatchVoterAdded(opts *bind.WatchOpts, sink chan<- *ClusterVoterAdded) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "VoterAdded") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterVoterAdded) - if err := _Cluster.contract.UnpackLog(event, "VoterAdded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ClusterVoterDeletedIterator is returned from FilterVoterDeleted and is used to iterate over the raw logs and unpacked data for VoterDeleted events raised by the Cluster contract. -type ClusterVoterDeletedIterator struct { - Event *ClusterVoterDeleted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *ClusterVoterDeletedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(ClusterVoterDeleted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ClusterVoterDeleted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ClusterVoterDeletedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ClusterVoterDeletedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ClusterVoterDeleted represents a VoterDeleted event raised by the Cluster contract. -type ClusterVoterDeleted struct { - OrgId string - Address common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterVoterDeleted is a free log retrieval operation binding the contract event 0x654cd85d9b2abaf3affef0a047625d088e6e4d0448935c9b5016b5f5aa0ca3b6. -// -// Solidity: e VoterDeleted(_orgId string, _address address) -func (_Cluster *ClusterFilterer) FilterVoterDeleted(opts *bind.FilterOpts) (*ClusterVoterDeletedIterator, error) { - - logs, sub, err := _Cluster.contract.FilterLogs(opts, "VoterDeleted") - if err != nil { - return nil, err - } - return &ClusterVoterDeletedIterator{contract: _Cluster.contract, event: "VoterDeleted", logs: logs, sub: sub}, nil -} - -// WatchVoterDeleted is a free log subscription operation binding the contract event 0x654cd85d9b2abaf3affef0a047625d088e6e4d0448935c9b5016b5f5aa0ca3b6. -// -// Solidity: e VoterDeleted(_orgId string, _address address) -func (_Cluster *ClusterFilterer) WatchVoterDeleted(opts *bind.WatchOpts, sink chan<- *ClusterVoterDeleted) (event.Subscription, error) { - - logs, sub, err := _Cluster.contract.WatchLogs(opts, "VoterDeleted") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(ClusterVoterDeleted) - if err := _Cluster.contract.UnpackLog(event, "VoterDeleted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} diff --git a/controls/cluster/Clusterkeys.sol b/controls/cluster/Clusterkeys.sol deleted file mode 100644 index 4652b7bac..000000000 --- a/controls/cluster/Clusterkeys.sol +++ /dev/null @@ -1,407 +0,0 @@ -pragma solidity ^0.5.3; - -contract Clusterkeys { - // Struct for managing the org details - enum Operation {None, Add, Delete} - struct OrgKeyDetails { - string tmKey; - bool active; - } - struct OrgDetails { - string orgId; - string morgId; - string pendingKey; - Operation pendingOp; - uint keyCount; - OrgKeyDetails []orgKeys; - mapping (bytes32 => uint) orgKeyIndex; - } - OrgDetails [] private orgList; - mapping(bytes32 => uint) private OrgIndex; - - // Struct for managing the voter accounst for the org - // voter struct which will be part of Master org - struct VoterDetails { - address vAccount; - bool active; - } - struct MasterOrgDetails { - string orgId; - uint voterCount; - uint validVoterCount; - VoterDetails []voterList; - mapping (address => uint) voterIndex; - } - MasterOrgDetails [] private masterOrgList; - mapping(bytes32 => uint) private MasterOrgIndex; - - // Struct to monitor the key usage - struct KeyUsageDetails { - string tmKey; - string morgId; - uint count; - bool pending; - } - KeyUsageDetails [] private keyUsage; - mapping (bytes32 => uint) KeyIndex; - - // mapping to monitor the voting status for each acount and - // overall voting count - mapping (uint => mapping (address => bool)) private voteStatus; - mapping (uint => uint) private voteCount; - - uint private orgNum = 0; - uint private morgNum = 0; - uint private keyNum = 0; - - // events related to Master Org add - event MasterOrgAdded(string _orgId); - event SubOrgAdded(string _orgId); - - // events related to Org level key management - event OrgKeyAdded(string _orgId, string _tmKey); - event OrgKeyDeleted(string _orgId, string _tmKey); - - // events related to org level approval process - event ItemForApproval(string _orgId, Operation _pendingOp, string _tmKey); - - // events related to managing voting accounts for the org - event VoterAdded(string _orgId, address _address); - event VoterDeleted(string _orgId, address _address); - - - /* public and external functions */ - // view functions - - // dummy function called from geth interface to check of the contract is deployed - function checkOrgContractExists() external pure returns (bool){ - return true; - } - - // returns voter count for a given org - function getOrgVoteCount(string calldata _orgId) external view returns (uint) { - return voteCount[getOrgIndex(_orgId)]; - } - - // returns pending operation details - function getPendingOp(string calldata _orgId) external view returns (string memory, Operation) { - uint i = getOrgIndex(_orgId); - return (orgList[i].pendingKey, orgList[i].pendingOp); - } - - // All internal functions - - // returns the voter index - function getVoterIndex(string memory _morgId, address _vAccount) internal view returns (uint) - { - uint morgIndex = getMasterOrgIndex(_morgId); - return masterOrgList[morgIndex].voterIndex[_vAccount] - 1; - - } - - // returns the org index for the org list - function getOrgIndex(string memory _orgId) internal view returns (uint) - { - return OrgIndex[keccak256(abi.encodePacked(_orgId))] - 1; - } - - // returns the master org index for the org from voter list - function getMasterOrgIndex(string memory _orgId) internal view returns (uint) - { - return MasterOrgIndex[keccak256(abi.encodePacked(_orgId))] - 1; - } - - // returns the key index from org key list - function getOrgKeyIndex(uint _orgIndex, string memory _tmKey) internal view returns (uint) - { - return orgList[_orgIndex].orgKeyIndex[keccak256(abi.encodePacked(_tmKey))] - 1; - } - - // returns the key index for the key usage list - function getKeyIndex(string memory _tmKey) internal view returns (uint) - { - return KeyIndex[keccak256(abi.encodePacked(_tmKey))] - 1; - } - - // initialize the voter account votes to false. This will be called - // when a new item is initiated for approval - function voterInit(string memory _orgId) internal { - uint orgIndex = getOrgIndex(_orgId); - uint morgIndex = getMasterOrgIndex(orgList[orgIndex].morgId); - for (uint i = 0; i < masterOrgList[morgIndex].voterList.length; i++){ - if (masterOrgList[morgIndex].voterList[i].active){ - voteStatus[orgIndex][masterOrgList[morgIndex].voterList[i].vAccount] = false; - } - } - voteCount[orgIndex] = 0; - } - - // processes the vote from the voter account. - function processVote (string memory _orgId) internal { - uint orgIndex = getOrgIndex(_orgId); - if (voteStatus[orgIndex][msg.sender] == false ){ - voteStatus[orgIndex][msg.sender] = true; - voteCount[orgIndex]++; - } - } - - // checks if enough votes have been cast for the pending operation. - // If yes returns true - function checkEnoughVotes (string memory _orgId, string memory _morgId) internal view returns (bool) { - uint orgIndex = getOrgIndex(_orgId); - uint morgIndex = getMasterOrgIndex(_morgId); - - return (voteCount[orgIndex] > masterOrgList[morgIndex].validVoterCount / 2 ); - } - - // function to update key usage details at master org level for a key - function updateKeyUsage(string memory _tmKey, string memory _morgId, Operation op) internal { - uint keyIndex = getKeyIndex(_tmKey); - keyUsage[keyIndex].pending = false; - if (op == Operation.Add){ - keyUsage[keyIndex].count++; - keyUsage[keyIndex].morgId = _morgId; - } - else { - keyUsage[keyIndex].count--; - } - } - - // function to process the approavl for add or delete - function processApproval(uint _orgIndex) internal { - if(checkEnoughVotes(orgList[_orgIndex].orgId, orgList[_orgIndex].morgId)){ - string storage locKey = orgList[_orgIndex].pendingKey; - if (orgList[_orgIndex].pendingOp == Operation.Add){ - if (checkIfKeyExists(orgList[_orgIndex].orgId, locKey)){ - uint keyIndex = getOrgKeyIndex(_orgIndex, locKey); - orgList[_orgIndex].orgKeys[keyIndex].active = true; - } - else { - orgList[_orgIndex].keyCount++; - orgList[_orgIndex].orgKeyIndex[keccak256(abi.encodePacked(locKey))] = orgList[_orgIndex].keyCount; - orgList[_orgIndex].orgKeys.push(OrgKeyDetails(locKey, true)); - updateKeyUsage(orgList[_orgIndex].pendingKey, orgList[_orgIndex].morgId, orgList[_orgIndex].pendingOp); - } - emit OrgKeyAdded(orgList[_orgIndex].orgId, locKey); - } - else { - if (checkIfKeyExists (orgList[_orgIndex].orgId, locKey)){ - uint keyIndex = getOrgKeyIndex(_orgIndex, locKey); - orgList[_orgIndex].orgKeys[keyIndex].active = false; - emit OrgKeyDeleted(orgList[_orgIndex].orgId, locKey); - } - } - orgList[_orgIndex].pendingOp = Operation.None; - orgList[_orgIndex].pendingKey = ""; - } - } - // All public functions - - // checks if the org has any voter accounts set up or not - function checkIfVoterExists(string memory _morgId, address _address) public view returns (bool){ - uint morgIndex = getMasterOrgIndex(_morgId); - if (masterOrgList[morgIndex].voterIndex[_address] == 0){ - return false; - } - uint voterIndex = getVoterIndex(_morgId, _address); - return masterOrgList[morgIndex].voterList[voterIndex].active; - } - - // checks if there the key is already in the list of private keys for the org - function checkIfKeyExists(string memory _orgId, string memory _tmKey) public view returns (bool){ - uint orgIndex = getOrgIndex(_orgId); - if (orgList[orgIndex].orgKeyIndex[keccak256(abi.encodePacked(_tmKey))] == 0){ - return false; - } - uint keyIndex = getOrgKeyIndex(orgIndex, _tmKey); - return orgList[orgIndex].orgKeys[keyIndex].active; - } - // All extenal view functions - - // Get number of voters - function getNumberOfVoters(string calldata _morgId) external view returns (uint) - { - return masterOrgList[getMasterOrgIndex(_morgId)].voterCount; - } - - // Get voter details - function getVoter(string calldata _morgId, uint i) external view returns (address _addr, bool _active) - { - uint morgIndex = getMasterOrgIndex(_morgId); - return (masterOrgList[morgIndex].voterList[i].vAccount, masterOrgList[morgIndex].voterList[i].active); - } - - // returns the number of orgs - function getNumberOfOrgs() external view returns (uint){ - return orgNum; - } - - // returns the total number of keys for a given org - function getOrgKeyCount(string calldata _orgId) external view returns (uint){ - return orgList[getOrgIndex(_orgId)].orgKeys.length; - } - - // returns org key details based on org id and key index - function getOrgKey(string calldata _orgId, uint _keyIndex) external view returns (string memory, bool){ - uint orgIndex = getOrgIndex(_orgId); - return (orgList[orgIndex].orgKeys[_keyIndex].tmKey,orgList[orgIndex].orgKeys[_keyIndex].active); - } - - // returns org and master org details based on org index - function getOrgInfo(uint _orgIndex) external view returns (string memory, string memory){ - return (orgList[_orgIndex].orgId, orgList[_orgIndex].morgId); - } - - // checks if the sender is one of the registered voter account for the org - function isVoter (string calldata _orgId, address account) external view returns (bool){ - uint orgIndex = getOrgIndex(_orgId); - uint morgIndex = getMasterOrgIndex(orgList[orgIndex].morgId); - return (!(masterOrgList[morgIndex].voterIndex[account] == 0)); - } - - // checks if the voting accounts exists for the org - function checkVotingAccountExists(string calldata _orgId) external view returns (bool) - { - uint orgIndex = getOrgIndex(_orgId); - uint morgIndex = getMasterOrgIndex(orgList[orgIndex].morgId); - return (masterOrgList[morgIndex].validVoterCount > 0); - } - - // function to check if morg exists - function checkMasterOrgExists (string calldata _morgId) external view returns (bool) { - return (!(MasterOrgIndex[keccak256(abi.encodePacked(_morgId))] == 0)); - } - - // function to check if morg exists - function checkOrgExists (string calldata _orgId) external view returns (bool) { - return(!(OrgIndex[keccak256(abi.encodePacked(_orgId))] == 0)); - } - - // function for checking if org exists and if there are any pending ops - function checkOrgPendingOp (string calldata _orgId) external view returns (bool) { - uint orgIndex = getOrgIndex(_orgId); - return (orgList[orgIndex].pendingOp != Operation.None); - } - - // function for checking if org exists and if there are any pending ops - function getOrgPendingOp (string calldata _orgId) external view returns (string memory, Operation) { - uint orgIndex = getOrgIndex(_orgId); - return (orgList[orgIndex].pendingKey, orgList[orgIndex].pendingOp); - } - - // this function checks of the key proposed is in use in another master org - function checkKeyClash (string calldata _orgId, string calldata _key) external view returns (bool) { - uint orgIndex = getOrgIndex(_orgId); - - uint keyIndex = getKeyIndex(_key); - if ((KeyIndex[keccak256(abi.encodePacked(_key))] != 0) && - (keccak256(abi.encodePacked (keyUsage[keyIndex].morgId)) != keccak256(abi.encodePacked(orgList[orgIndex].morgId)))){ - // check the count if count is greather than zero, key already in use - if ((keyUsage[keyIndex].count > 0) || (keyUsage[keyIndex].pending)){ - return true; - } - } - return false; - } - - // All extenal update functions - - // function for adding a new master org - function addMasterOrg(string calldata _morgId) external - { - morgNum++; - MasterOrgIndex[keccak256(abi.encodePacked(_morgId))] = morgNum; - - uint id = masterOrgList.length++; - masterOrgList[id].orgId = _morgId; - masterOrgList[id].voterCount = 0; - masterOrgList[id].validVoterCount = 0; - emit MasterOrgAdded(_morgId); - } - - // function for adding a new master org - function addSubOrg(string calldata _orgId, string calldata _morgId) external - { - orgNum++; - OrgIndex[keccak256(abi.encodePacked(_orgId))] = orgNum; - uint id = orgList.length++; - orgList[id].orgId = _orgId; - orgList[id].morgId = _morgId; - orgList[id].keyCount = 0; - orgList[id].pendingKey = ""; - orgList[id].pendingOp = Operation.None; - emit SubOrgAdded(_morgId); - } - - // function for adding a voter account to a master org - function addVoter(string calldata _morgId, address _address) external - { - uint morgIndex = getMasterOrgIndex(_morgId); - masterOrgList[morgIndex].voterCount++; - masterOrgList[morgIndex].validVoterCount++; - masterOrgList[morgIndex].voterIndex[_address] = masterOrgList[morgIndex].voterCount; - masterOrgList[morgIndex].voterList.push(VoterDetails(_address, true)); - emit VoterAdded(_morgId, _address); - } - - // function for deleting a voter account to a master org - function deleteVoter(string calldata _morgId, address _address) external - { - uint morgIndex = getMasterOrgIndex(_morgId); - if(checkIfVoterExists(_morgId, _address)){ - uint vIndex = getVoterIndex(_morgId, _address); - masterOrgList[morgIndex].validVoterCount --; - masterOrgList[morgIndex].voterList[vIndex].active = false; - emit VoterDeleted(_morgId, _address); - } - - } - - // function for adding a private key for the org. Thsi will be added once - // approval process is complete - function addOrgKey(string calldata _orgId, string calldata _tmKey) external - { - uint orgIndex = getOrgIndex(_orgId); - if (!checkIfKeyExists (_orgId, _tmKey)){ - orgList[orgIndex].pendingKey = _tmKey; - orgList[orgIndex].pendingOp = Operation.Add; - voterInit(_orgId); - // add key to key usage list for tracking - uint keyIndex = getKeyIndex(_tmKey); - if (KeyIndex[keccak256(abi.encodePacked(_tmKey))] == 0){ - keyNum ++; - KeyIndex[keccak256(abi.encodePacked(_tmKey))] = keyNum; - keyUsage.push(KeyUsageDetails(_tmKey, orgList[orgIndex].morgId, 0, true)); - } - else { - keyUsage[keyIndex].pending = true; - } - - emit ItemForApproval(_orgId,Operation.Add, _tmKey); - } - } - - // function for deleting a private key for the org. Thsi will be deleted once - // approval process is complete - function deleteOrgKey(string calldata _orgId, string calldata _tmKey) external - { - uint orgIndex = getOrgIndex(_orgId); - if (checkIfKeyExists(_orgId, _tmKey)) { - orgList[orgIndex].pendingKey = _tmKey; - orgList[orgIndex].pendingOp = Operation.Delete; - voterInit(_orgId); - uint keyIndex = getKeyIndex(_tmKey); - keyUsage[keyIndex].pending = true; - emit ItemForApproval(_orgId, Operation.Delete, _tmKey); - } - } - - // function for approving key add or delete operations - function approvePendingOp(string calldata _orgId) external - { - uint orgIndex = getOrgIndex(_orgId); - processVote(_orgId); - processApproval(orgIndex); - } - -} diff --git a/controls/cluster/abi/Clusterkeys.abi b/controls/cluster/abi/Clusterkeys.abi deleted file mode 100644 index 3555b3906..000000000 --- a/controls/cluster/abi/Clusterkeys.abi +++ /dev/null @@ -1 +0,0 @@ -[{"constant":true,"inputs":[{"name":"_morgId","type":"string"},{"name":"_address","type":"address"}],"name":"checkIfVoterExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_morgId","type":"string"},{"name":"i","type":"uint256"}],"name":"getVoter","outputs":[{"name":"_addr","type":"address"},{"name":"_active","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_morgId","type":"string"}],"name":"addSubOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"getOrgKeyCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"getOrgPendingOp","outputs":[{"name":"","type":"string"},{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"}],"name":"approvePendingOp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"},{"name":"_tmKey","type":"string"}],"name":"checkIfKeyExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_tmKey","type":"string"}],"name":"deleteOrgKey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"},{"name":"_keyIndex","type":"uint256"}],"name":"getOrgKey","outputs":[{"name":"","type":"string"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_morgId","type":"string"},{"name":"_address","type":"address"}],"name":"addVoter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_morgId","type":"string"},{"name":"_address","type":"address"}],"name":"deleteVoter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgIndex","type":"uint256"}],"name":"getOrgInfo","outputs":[{"name":"","type":"string"},{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getNumberOfOrgs","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"},{"name":"_key","type":"string"}],"name":"checkKeyClash","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_morgId","type":"string"}],"name":"getNumberOfVoters","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"},{"name":"account","type":"address"}],"name":"isVoter","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_morgId","type":"string"}],"name":"addMasterOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"checkVotingAccountExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_tmKey","type":"string"}],"name":"addOrgKey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_morgId","type":"string"}],"name":"checkMasterOrgExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"getOrgVoteCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"checkOrgContractExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"getPendingOp","outputs":[{"name":"","type":"string"},{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"checkOrgPendingOp","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"checkOrgExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"MasterOrgAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"}],"name":"SubOrgAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_tmKey","type":"string"}],"name":"OrgKeyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_tmKey","type":"string"}],"name":"OrgKeyDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_pendingOp","type":"uint8"},{"indexed":false,"name":"_tmKey","type":"string"}],"name":"ItemForApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_address","type":"address"}],"name":"VoterDeleted","type":"event"}] \ No newline at end of file diff --git a/controls/cluster/abi/Clusterkeys.bin-runtime b/controls/cluster/abi/Clusterkeys.bin-runtime deleted file mode 100644 index 9b31b8834..000000000 --- a/controls/cluster/abi/Clusterkeys.bin-runtime +++ /dev/null @@ -1 +0,0 @@ -608060405234801561001057600080fd5b506004361061018f576000357c0100000000000000000000000000000000000000000000000000000000900480637755ebdd116100fb578063d88ce6bb116100b4578063ee0c7dda1161008e578063ee0c7dda14610e66578063f346a3a714610432578063fb23dedc14610e6e578063ffe40d1d14610ede5761018f565b8063d88ce6bb14610cc4578063d912967a14610d86578063e7089a0c14610df65761018f565b80637755ebdd14610a315780638fde9c5e14610a395780639b904f0a14610afb578063bd9e887a14610b6b578063c7304f3f14610be4578063cb2c45dc14610c545761018f565b80634898598e1161014d5780634898598e1461059f57806349379c50146106cc5780635002dadf1461078e5780635607395b1461084457806359cbd6fe146108bd5780635c4f32ee146109365761018f565b8062b813df1461019457806317a2fb72146102595780631f953480146102ec578063243cc506146103b057806333680eb71461043257806335dc47721461052f575b600080fd5b610245600480360360408110156101aa57600080fd5b8101906020810181356401000000008111156101c557600080fd5b8201836020820111156101d757600080fd5b803590602001918460018302840111640100000000831117156101f957600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050509035600160a060020a03169150610f4e9050565b604080519115158252519081900360200190f35b6102c96004803603604081101561026f57600080fd5b81019060208101813564010000000081111561028a57600080fd5b82018360208201111561029c57600080fd5b803590602001918460018302840111640100000000831117156102be57600080fd5b919350915035611011565b60408051600160a060020a03909316835290151560208301528051918290030190f35b6103ae6004803603604081101561030257600080fd5b81019060208101813564010000000081111561031d57600080fd5b82018360208201111561032f57600080fd5b8035906020019184600183028401116401000000008311171561035157600080fd5b91939092909160208101903564010000000081111561036f57600080fd5b82018360208201111561038157600080fd5b803590602001918460018302840111640100000000831117156103a357600080fd5b5090925090506110fc565b005b610420600480360360208110156103c657600080fd5b8101906020810181356401000000008111156103e157600080fd5b8201836020820111156103f357600080fd5b8035906020019184600183028401116401000000008311171561041557600080fd5b5090925090506112d0565b60408051918252519081900360200190f35b6104a26004803603602081101561044857600080fd5b81019060208101813564010000000081111561046357600080fd5b82018360208201111561047557600080fd5b8035906020019184600183028401116401000000008311171561049757600080fd5b509092509050611337565b60405180806020018360028111156104b657fe5b60ff168152602001828103825284818151815260200191508051906020019080838360005b838110156104f35781810151838201526020016104db565b50505050905090810190601f1680156105205780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b6103ae6004803603602081101561054557600080fd5b81019060208101813564010000000081111561056057600080fd5b82018360208201111561057257600080fd5b8035906020019184600183028401116401000000008311171561059457600080fd5b50909250905061145e565b610245600480360360408110156105b557600080fd5b8101906020810181356401000000008111156105d057600080fd5b8201836020820111156105e257600080fd5b8035906020019184600183028401116401000000008311171561060457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561065757600080fd5b82018360208201111561066957600080fd5b8035906020019184600183028401116401000000008311171561068b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506114ee945050505050565b6103ae600480360360408110156106e257600080fd5b8101906020810181356401000000008111156106fd57600080fd5b82018360208201111561070f57600080fd5b8035906020019184600183028401116401000000008311171561073157600080fd5b91939092909160208101903564010000000081111561074f57600080fd5b82018360208201111561076157600080fd5b8035906020019184600183028401116401000000008311171561078357600080fd5b509092509050611608565b6107fe600480360360408110156107a457600080fd5b8101906020810181356401000000008111156107bf57600080fd5b8201836020820111156107d157600080fd5b803590602001918460018302840111640100000000831117156107f357600080fd5b919350915035611897565b60405180806020018315151515815260200182810382528481815181526020019150805190602001908083836000838110156104f35781810151838201526020016104db565b6103ae6004803603604081101561085a57600080fd5b81019060208101813564010000000081111561087557600080fd5b82018360208201111561088757600080fd5b803590602001918460018302840111640100000000831117156108a957600080fd5b919350915035600160a060020a03166119fb565b6103ae600480360360408110156108d357600080fd5b8101906020810181356401000000008111156108ee57600080fd5b82018360208201111561090057600080fd5b8035906020019184600183028401116401000000008311171561092257600080fd5b919350915035600160a060020a0316611c06565b6109536004803603602081101561094c57600080fd5b5035611dce565b604051808060200180602001838103835285818151815260200191508051906020019080838360005b8381101561099457818101518382015260200161097c565b50505050905090810190601f1680156109c15780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156109f45781810151838201526020016109dc565b50505050905090810190601f168015610a215780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b610420611f44565b61024560048036036040811015610a4f57600080fd5b810190602081018135640100000000811115610a6a57600080fd5b820183602082011115610a7c57600080fd5b80359060200191846001830284011164010000000083111715610a9e57600080fd5b919390929091602081019035640100000000811115610abc57600080fd5b820183602082011115610ace57600080fd5b80359060200191846001830284011164010000000083111715610af057600080fd5b509092509050611f4b565b61042060048036036020811015610b1157600080fd5b810190602081018135640100000000811115610b2c57600080fd5b820183602082011115610b3e57600080fd5b80359060200191846001830284011164010000000083111715610b6057600080fd5b5090925090506121c8565b61024560048036036040811015610b8157600080fd5b810190602081018135640100000000811115610b9c57600080fd5b820183602082011115610bae57600080fd5b80359060200191846001830284011164010000000083111715610bd057600080fd5b919350915035600160a060020a031661222f565b6103ae60048036036020811015610bfa57600080fd5b810190602081018135640100000000811115610c1557600080fd5b820183602082011115610c2757600080fd5b80359060200191846001830284011164010000000083111715610c4957600080fd5b50909250905061237d565b61024560048036036020811015610c6a57600080fd5b810190602081018135640100000000811115610c8557600080fd5b820183602082011115610c9757600080fd5b80359060200191846001830284011164010000000083111715610cb957600080fd5b5090925090506124c7565b6103ae60048036036040811015610cda57600080fd5b810190602081018135640100000000811115610cf557600080fd5b820183602082011115610d0757600080fd5b80359060200191846001830284011164010000000083111715610d2957600080fd5b919390929091602081019035640100000000811115610d4757600080fd5b820183602082011115610d5957600080fd5b80359060200191846001830284011164010000000083111715610d7b57600080fd5b50909250905061254f565b61024560048036036020811015610d9c57600080fd5b810190602081018135640100000000811115610db757600080fd5b820183602082011115610dc957600080fd5b80359060200191846001830284011164010000000083111715610deb57600080fd5b50909250905061298f565b61042060048036036020811015610e0c57600080fd5b810190602081018135640100000000811115610e2757600080fd5b820183602082011115610e3957600080fd5b80359060200191846001830284011164010000000083111715610e5b57600080fd5b5090925090506129e0565b610245612a3c565b61024560048036036020811015610e8457600080fd5b810190602081018135640100000000811115610e9f57600080fd5b820183602082011115610eb157600080fd5b80359060200191846001830284011164010000000083111715610ed357600080fd5b509092509050612a41565b61024560048036036020811015610ef457600080fd5b810190602081018135640100000000811115610f0f57600080fd5b820183602082011115610f2157600080fd5b80359060200191846001830284011164010000000083111715610f4357600080fd5b509092509050612ac0565b600080610f5a84612b11565b9050600281815481101515610f6b57fe5b60009182526020808320600160a060020a0387168452600460059093020191909101905260409020541515610fa457600091505061100b565b6000610fb08585612b9e565b9050600282815481101515610fc157fe5b906000526020600020906005020160030181815481101515610fdf57fe5b60009182526020909120015474010000000000000000000000000000000000000000900460ff16925050505b92915050565b600080600061105586868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612b1192505050565b905060028181548110151561106657fe5b90600052602060002090600502016003018481548110151561108457fe5b60009182526020909120015460028054600160a060020a0390921691839081106110aa57fe5b9060005260206000209060050201600301858154811015156110c857fe5b60009182526020909120015490977401000000000000000000000000000000000000000090910460ff169650945050505050565b60088054600190810191829055604051600090879087906020018083838082843780830192505050925050506040516020818303038152906040528051906020012081526020019081526020016000208190555060008080548091906001016111659190613b6b565b9050848460008381548110151561117857fe5b600091825260209091206111929360079092020191613b97565b5082826000838154811015156111a457fe5b906000526020600020906007020160010191906111c2929190613b97565b50600080828154811015156111d357fe5b906000526020600020906007020160040181905550602060405190810160405280600081525060008281548110151561120857fe5b9060005260206000209060070201600201908051906020019061122c929190613c15565b506000808281548110151561123d57fe5b60009182526020909120600360079092020101805460ff1916600183600281111561126457fe5b02179055507fd734c07873f32f0735016e51dc718e21a48a3bec999d5be38cf3af363fbfedab838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a15050505050565b60008061131284848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b8154811061131c57fe5b60009182526020909120600560079092020101549392505050565b606060008061137b85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b905060008181548110151561138c57fe5b90600052602060002090600702016002016000828154811015156113ac57fe5b600091825260209182902060036007909202010154825460408051601f6002600019600186161561010002019094169390930492830185900485028101850190915281815260ff9092169284919083018282801561144b5780601f106114205761010080835404028352916020019161144b565b820191906000526020600020905b81548152906001019060200180831161142e57829003601f168201915b5050505050915092509250509250929050565b600061149f83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b90506114e083838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612c2992505050565b6114e981612c98565b505050565b6000806114fa84612bf0565b905060008181548110151561150b57fe5b90600052602060002090600702016006016000846040516020018082805190602001908083835b602083106115515780518252601f199092019160209182019101611532565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120815260200190815260200160002054600014156115ad57600091505061100b565b60006115b98285613808565b90506000828154811015156115ca57fe5b9060005260206000209060070201600501818154811015156115e857fe5b600091825260209091206002909102016001015460ff1695945050505050565b600061164985858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b90506116be85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f890181900481028201810190925287815292508791508690819084018382808284376000920191909152506114ee92505050565b156118905782826000838154811015156116d457fe5b906000526020600020906007020160020191906116f2929190613b97565b50600260008281548110151561170457fe5b60009182526020909120600360079092020101805460ff1916600183600281111561172b57fe5b021790555061176f85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506138b492505050565b60006117b084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506139ea92505050565b905060016004828154811015156117c357fe5b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055507f4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a868660028787604051808060200185600281111561182657fe5b60ff168152602001806020018381038352888882818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600083820152604051601f909101601f1916909201829003995090975050505050505050a1505b5050505050565b60606000806118db86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b90506000818154811015156118ec57fe5b90600052602060002090600702016005018481548110151561190a57fe5b906000526020600020906002020160000160008281548110151561192a57fe5b90600052602060002090600702016005018581548110151561194857fe5b600091825260209182902060029182020160019081015484546040805161010094831615949094026000190190911693909304601f810185900485028301850190935282825260ff1692909184918301828280156119e75780601f106119bc576101008083540402835291602001916119e7565b820191906000526020600020905b8154815290600101906020018083116119ca57829003601f168201915b505050505091509250925050935093915050565b6000611a3c84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612b1192505050565b9050600281815481101515611a4d57fe5b6000918252602090912060016005909202018101805490910190556002805482908110611a7657fe5b600091825260209091206002600590920201810180546001019055805482908110611a9d57fe5b906000526020600020906005020160010154600282815481101515611abe57fe5b60009182526020808320600160a060020a0387168452600460059093020191909101905260409020556002805482908110611af557fe5b60009182526020808320604080518082018252600160a060020a038881168083526001838701818152600598909802909501600301805495860181558852968590209151919093018054955173ffffffffffffffffffffffffffffffffffffffff19909616919093161774ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000009415159490940293909317905581519081019290925280825281018490527f424f3ad05c61ea35cad66f22b70b1fad7250d8229921238078c401db36d34574908590859085908060608101858580828437600083820152604051601f909101601f1916909201829003965090945050505050a150505050565b6000611c4784848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612b1192505050565b9050611c8a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250869250610f4e915050565b15611dc8576000611cd285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250612b9e915050565b9050600282815481101515611ce357fe5b600091825260208220600260059092020181018054600019019055805484908110611d0a57fe5b906000526020600020906005020160030182815481101515611d2857fe5b9060005260206000200160000160146101000a81548160ff0219169083151502179055507f654cd85d9b2abaf3affef0a047625d088e6e4d0448935c9b5016b5f5aa0ca3b6858585604051808060200183600160a060020a0316600160a060020a031681526020018281038252858582818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a1505b50505050565b606080600083815481101515611de057fe5b9060005260206000209060070201600001600084815481101515611e0057fe5b9060005260206000209060070201600101818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ea65780601f10611e7b57610100808354040283529160200191611ea6565b820191906000526020600020905b815481529060010190602001808311611e8957829003601f168201915b5050845460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815295975086945092508401905082828015611f345780601f10611f0957610100808354040283529160200191611f34565b820191906000526020600020905b815481529060010190602001808311611f1757829003601f168201915b5050505050905091509150915091565b6008545b90565b600080611f8d86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b90506000611fd085858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506139ea92505050565b9050600560008686604051602001808383808284378083019250505092505050604051602081830303815290604052805190602001208152602001908152602001600020546000141580156121545750600080548390811061202e57fe5b9060005260206000209060070201600101604051602001808280546001816001161561010002031660029004801561209d5780601f1061207b57610100808354040283529182019161209d565b820191906000526020600020905b815481529060010190602001808311612089575b5050915050604051602081830303815290604052805190602001206004828154811015156120c757fe5b906000526020600020906004020160010160405160200180828054600181600116156101000203166002900480156121365780601f10612114576101008083540402835291820191612136565b820191906000526020600020905b815481529060010190602001808311612122575b50509150506040516020818303038152906040528051906020012014155b156121b957600060048281548110151561216a57fe5b90600052602060002090600402016002015411806121a95750600480548290811061219157fe5b600091825260209091206003600490920201015460ff165b156121b9576001925050506121c0565b6000925050505b949350505050565b6000600261220b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612b1192505050565b8154811061221557fe5b906000526020600020906005020160010154905092915050565b60008061227185858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b9050600061233660008381548110151561228757fe5b90600052602060002090600702016001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561232c5780601f106123015761010080835404028352916020019161232c565b820191906000526020600020905b81548152906001019060200180831161230f57829003601f168201915b5050505050612b11565b905060028181548110151561234757fe5b60009182526020808320600160a060020a0388168452600460059093020191909101905260409020541515925050509392505050565b600980546001019081905560405160039060009085908590602001808383808284378083019250505092505050604051602081830303815290604052805190602001208152602001908152602001600020819055506000600280548091906001016123e89190613c83565b905082826002838154811015156123fb57fe5b600091825260209091206124159360059092020191613b97565b50600060028281548110151561242757fe5b906000526020600020906005020160010181905550600060028281548110151561244d57fe5b9060005260206000209060050201600201819055507ffe62f8d1508aa8ddbb57fd8a6d631f4418cfcbafa90c6ce6d4b8105da5609729838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a1505050565b60008061250984848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b9050600061251f60008381548110151561228757fe5b9050600060028281548110151561253257fe5b906000526020600020906005020160020154119250505092915050565b600061259085858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b905061260585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f890181900481028201810190925287815292508791508690819084018382808284376000920191909152506114ee92505050565b151561189057828260008381548110151561261c57fe5b9060005260206000209060070201600201919061263a929190613b97565b50600160008281548110151561264c57fe5b60009182526020909120600360079092020101805460ff1916600183600281111561267357fe5b02179055506126b785858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506138b492505050565b60006126f884848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506139ea92505050565b9050600560008585604051602001808383808284378083019250505092505050604051602081830303815290604052805190602001208152602001908152602001600020546000141561292057600a8054600101908190556040516005906000908790879060200180838380828437808301925050509250505060405160208183030381529060405280519060200120815260200190815260200160002081905550600460806040519081016040528086868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509385525050815460209093019287915081106127f257fe5b90600052602060002090600702016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128975780601f1061286c57610100808354040283529160200191612897565b820191906000526020600020905b81548152906001019060200180831161287a57829003601f168201915b50505091835250506000602080830182905260016040909301839052845492830180865594825290819020835180516004909402909101926128dc9284920190613c15565b5060208281015180516128f59260018501920190613c15565b50604082015160028201556060909101516003909101805460ff191691151591909117905550612954565b600160048281548110151561293157fe5b60009182526020909120600490910201600301805460ff19169115159190911790555b7f4475befcee492797e02530076fd7e138aa058eb3bcd028a9df5c0f2815ba9f4a868660018787604051808060200185600281111561182657fe5b60006003600084846040516020018083838082843780830192505050925050506040516020818303038152906040528051906020012081526020019081526020016000205460001415905092915050565b600060076000612a2585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b815260200190815260200160002054905092915050565b600190565b600080612a8384848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bf092505050565b9050600080805483908110612a9457fe5b600091825260209091206003600790920201015460ff166002811115612ab657fe5b1415949350505050565b60006001600084846040516020018083838082843780830192505050925050506040516020818303038152906040528051906020012081526020019081526020016000205460001415905092915050565b6000600160036000846040516020018082805190602001908083835b60208310612b4c5780518252601f199092019160209182019101612b2d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120815260200190815260200160002054039050919050565b600080612baa84612b11565b90506001600282815481101515612bbd57fe5b60009182526020808320600160a060020a0388168452600460059093020191909101905260409020540391505092915050565b600060018060008460405160200180828051906020019080838360208310612b4c5780518252601f199092019160209182019101612b2d565b6000612c3482612bf0565b600081815260066020908152604080832033845290915290205490915060ff161515612c945760008181526006602090815260408083203384528252808320805460ff191660019081179091558484526007909252909120805490910190555b5050565b612e00600082815481101515612caa57fe5b6000918252602091829020600790910201805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815292830182828015612d3d5780601f10612d1257610100808354040283529160200191612d3d565b820191906000526020600020905b815481529060010190602001808311612d2057829003601f168201915b5050505050600083815481101515612d5157fe5b90600052602060002090600702016001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612df65780601f10612dcb57610100808354040283529160200191612df6565b820191906000526020600020905b815481529060010190602001808311612dd957829003601f168201915b5050505050613a24565b156138055760008082815481101515612e1557fe5b60009182526020909120600260079092020101905060016000805484908110612e3a57fe5b600091825260209091206003600790920201015460ff166002811115612e5c57fe5b141561357457612f9c600083815481101515612e7457fe5b6000918252602091829020600790910201805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815292830182828015612f075780601f10612edc57610100808354040283529160200191612f07565b820191906000526020600020905b815481529060010190602001808311612eea57829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815294508793509150830182828015612f925780601f10612f6757610100808354040283529160200191612f92565b820191906000526020600020905b815481529060010190602001808311612f7557829003601f168201915b50505050506114ee565b15613093578054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260009261303a9286929186918301828280156130305780601f1061300557610100808354040283529160200191613030565b820191906000526020600020905b81548152906001019060200180831161301357829003601f168201915b5050505050613808565b9050600160008481548110151561304d57fe5b90600052602060002090600702016005018281548110151561306b57fe5b60009182526020909120600290910201600101805460ff191691151591909117905550613429565b60008054839081106130a157fe5b600091825260208220600460079092020101805460010190558054839081106130c657fe5b9060005260206000209060070201600401546000838154811015156130e757fe5b906000526020600020906007020160060160008360405160200180828054600181600116156101000203166002900480156131595780601f10613137576101008083540402835291820191613159565b820191906000526020600020905b815481529060010190602001808311613145575b50509150506040516020818303038152906040528051906020012081526020019081526020016000208190555060008281548110151561319557fe5b600091825260209182902060408051855460026001821615610100026000190190911604601f8101869004909502810160609081018352918101858152600794909402909201600501939192839290918691908401828280156132395780601f1061320e57610100808354040283529160200191613239565b820191906000526020600020905b81548152906001019060200180831161321c57829003601f168201915b50505091835250506001602091820181905283549081018085556000948552938290208351805160029093029091019261327892849290910190613c15565b50602091909101516001909101805460ff191691151591909117905550600080546134299190849081106132a857fe5b600091825260209182902060026007909202018101805460408051601f6000196101006001861615020190931694909404918201859004850284018501905280835291929091908301828280156133405780601f1061331557610100808354040283529160200191613340565b820191906000526020600020905b81548152906001019060200180831161332357829003601f168201915b505050505060008481548110151561335457fe5b90600052602060002090600702016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133f95780601f106133ce576101008083540402835291602001916133f9565b820191906000526020600020905b8154815290600101906020018083116133dc57829003601f168201915b505050505060008581548110151561340d57fe5b600091825260209091206003600790920201015460ff16613a87565b7f6f4d370520782587dabc737a258f46de81ad45d733a42cd5a0045cff1e46deb460008381548110151561345957fe5b60009182526020918290206040805181815260079093029091018054600260001961010060018416150201909116049183018290529285929182918201906060830190869080156134eb5780601f106134c0576101008083540402835291602001916134eb565b820191906000526020600020905b8154815290600101906020018083116134ce57829003601f168201915b505083810382528454600260001961010060018416150201909116048082526020909101908590801561355f5780601f106135345761010080835404028352916020019161355f565b820191906000526020600020905b81548152906001019060200180831161354257829003601f168201915b505094505050505060405180910390a1613789565b613586600083815481101515612e7457fe5b15613789578054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526000926135ef9286929186918301828280156130305780601f1061300557610100808354040283529160200191613030565b90506000808481548110151561360157fe5b90600052602060002090600702016005018281548110151561361f57fe5b60009182526020822060029190910201600101805460ff19169215159290921790915580547f2e0a2dc845dce9ef7206b8fe38f3dacaad17ba74d7be9fba469c9858ae16a5d691908590811061367157fe5b60009182526020918290206040805181815260079093029091018054600260001961010060018416150201909116049183018290529286929182918201906060830190869080156137035780601f106136d857610100808354040283529160200191613703565b820191906000526020600020905b8154815290600101906020018083116136e657829003601f168201915b50508381038252845460026000196101006001841615020190911604808252602090910190859080156137775780601f1061374c57610100808354040283529160200191613777565b820191906000526020600020905b81548152906001019060200180831161375a57829003601f168201915b505094505050505060405180910390a1505b6000808381548110151561379957fe5b60009182526020909120600360079092020101805460ff191660018360028111156137c057fe5b0217905550604080516020810190915260008082528054849081106137e157fe5b906000526020600020906007020160020190805190602001906114e9929190613c15565b50565b6000600160008481548110151561381b57fe5b90600052602060002090600702016006016000846040516020018082805190602001908083835b602083106138615780518252601f199092019160209182019101613842565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528051906020012081526020019081526020016000205403905092915050565b60006138bf82612bf0565b905060006138d560008381548110151561228757fe5b905060005b60028054839081106138e857fe5b9060005260206000209060050201600301805490508110156139d657600280548390811061391257fe5b90600052602060002090600502016003018181548110151561393057fe5b60009182526020909120015474010000000000000000000000000000000000000000900460ff16156139ce576000838152600660205260408120600280548391908690811061397b57fe5b90600052602060002090600502016003018481548110151561399957fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020805460ff19169115159190911790555b6001016138da565b505060009081526007602052604081205550565b60006001600560008460405160200180828051906020019080838360208310612b4c5780518252601f199092019160209182019101612b2d565b600080613a3084612bf0565b90506000613a3d84612b11565b905060028082815481101515613a4f57fe5b906000526020600020906005020160020154811515613a6a57fe5b600093845260076020526040909320549204909111949350505050565b6000613a92846139ea565b90506000600482815481101515613aa557fe5b60009182526020909120600490910201600301805460ff19169115159190911790556001826002811115613ad557fe5b1415613b3c576004805482908110613ae957fe5b6000918252602090912060049182020160020180546001019055805484919083908110613b1257fe5b90600052602060002090600402016001019080519060200190613b36929190613c15565b50611dc8565b6004805482908110613b4a57fe5b60009182526020909120600260049092020101805460001901905550505050565b8154818355818111156114e9576007028160070283600052602060002091820191016114e99190613caf565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613bd85782800160ff19823516178555613c05565b82800160010185558215613c05579182015b82811115613c05578235825591602001919060010190613bea565b50613c11929150613d11565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613c5657805160ff1916838001178555613c05565b82800160010185558215613c05579182015b82811115613c05578251825591602001919060010190613c68565b8154818355818111156114e9576005028160050283600052602060002091820191016114e99190613d2b565b611f4891905b80821115613c11576000613cc98282613d6e565b613cd7600183016000613d6e565b613ce5600283016000613d6e565b60038201805460ff19169055600060048301819055613d08906005840190613db2565b50600701613cb5565b611f4891905b80821115613c115760008155600101613d17565b611f4891905b80821115613c11576000613d458282613d6e565b60018201600090556002820160009055600382016000613d659190613dd3565b50600501613d31565b50805460018160011615610100020316600290046000825580601f10613d945750613805565b601f0160209004906000526020600020908101906138059190613d11565b50805460008255600202906000526020600020908101906138059190613df1565b50805460008255906000526020600020908101906138059190613e20565b611f4891905b80821115613c11576000613e0b8282613d6e565b5060018101805460ff19169055600201613df7565b611f4891905b80821115613c1157805474ffffffffffffffffffffffffffffffffffffffffff19168155600101613e2656fea165627a7a7230582032601c43b28c7e679254ade70c747cb34d4d056cd49186a9117c7b85935ea3410029 \ No newline at end of file diff --git a/controls/cluster/cluster.go b/controls/cluster/cluster.go deleted file mode 100644 index 3ada47891..000000000 --- a/controls/cluster/cluster.go +++ /dev/null @@ -1,188 +0,0 @@ -package cluster - -import ( - "crypto/ecdsa" - "math/big" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/controls" - pbind "github.com/ethereum/go-ethereum/controls/bind/cluster" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" -) - -type OrgKeyCtrl struct { - ethClient *ethclient.Client - key *ecdsa.PrivateKey - km *pbind.Cluster -} - -// Creates the controls structure for org key management -func NewOrgKeyCtrl(node *node.Node) (*OrgKeyCtrl, error) { - stateReader, _, err := controls.CreateEthClient(node) - if err != nil { - log.Error("Unable to create ethereum client for cluster check", "err", err) - return nil, err - } - // check if permissioning contract is there at address. If not return from here - km, err := pbind.NewCluster(params.QuorumPrivateKeyManagementContract, stateReader) - if err != nil { - log.Error("Permissions not enabled for the network", "err", err) - return nil, err - } - return &OrgKeyCtrl{stateReader, node.GetNodeKey(), km}, nil -} - -// starts the org key management services -func (k *OrgKeyCtrl) Start() error { - - _, err := pbind.NewClusterFilterer(params.QuorumPrivateKeyManagementContract, k.ethClient) - if err != nil { - log.Error("Cluster not enabled for the network", "err", err) - return nil - } - - // check if permissioning contract is there at address. If not return from here - err = k.checkIfContractExists() - if err != nil { - return err - } - - // start the service - k.manageClusterKeys() - return nil -} - -// checks if the contract is deployed for org key management -func (k *OrgKeyCtrl) checkIfContractExists() error { - auth := bind.NewKeyedTransactor(k.key) - clusterSession := &pbind.ClusterSession{ - Contract: k.km, - CallOpts: bind.CallOpts{ - Pending: true, - }, - TransactOpts: bind.TransactOpts{ - From: auth.From, - Signer: auth.Signer, - GasLimit: 4700000, - GasPrice: big.NewInt(0), - }, - } - - // dummy call to contrat to check if the contract is deployed - _, err := clusterSession.CheckOrgContractExists() - if err != nil { - return err - } - - return nil -} - -// in case of geth restart firts checks for historical key update events and -// populates the cache, then starts the key change monitoring service -func (k *OrgKeyCtrl) manageClusterKeys() { - //call populate nodes to populate the nodes into contract - if err := k.populatePrivateKeys(); err != nil { - return - } - //monitor for nodes deletiin via smart contract - k.monitorKeyChanges() -} - -// populates cache based on the historical key change events. -func (k *OrgKeyCtrl) populatePrivateKeys() error { - cluster, err := pbind.NewClusterFilterer(params.QuorumPrivateKeyManagementContract, k.ethClient) - if err != nil { - log.Error("Failed to monitor node delete", "err", err) - return err - } - - opts := &bind.FilterOpts{} - pastAddEvents, err := cluster.FilterOrgKeyAdded(opts) - - if err != nil && err.Error() == "no contract code at given address" { - return err - } - - recExists := true - for recExists { - recExists = pastAddEvents.Next() - if recExists { - types.AddOrgKey(pastAddEvents.Event.OrgId, pastAddEvents.Event.TmKey) - } - } - - opts = &bind.FilterOpts{} - pastDeleteEvents, _ := cluster.FilterOrgKeyDeleted(opts) - - recExists = true - for recExists { - recExists = pastDeleteEvents.Next() - if recExists { - types.DeleteOrgKey(pastDeleteEvents.Event.OrgId, pastDeleteEvents.Event.TmKey) - } - } - return nil -} - -// service to monitor key change events -func (k *OrgKeyCtrl) monitorKeyChanges() { - go k.monitorKeyAdd() - - go k.monitorKeyDelete() -} - -// monitors for new key added event and updates caches based on the same -func (k *OrgKeyCtrl) monitorKeyAdd() { - cluster, err := pbind.NewClusterFilterer(params.QuorumPrivateKeyManagementContract, k.ethClient) - if err != nil { - log.Error("Failed to monitor key action", "err", err) - } - ch := make(chan *pbind.ClusterOrgKeyAdded) - - opts := &bind.WatchOpts{} - var blockNumber uint64 = 1 - opts.Start = &blockNumber - var newEvent *pbind.ClusterOrgKeyAdded - - _, err = cluster.WatchOrgKeyAdded(opts, ch) - if err != nil { - log.Info("Failed WatchOrgKeyDeleted: %v", err) - } - - for { - select { - case newEvent = <-ch: - types.AddOrgKey(newEvent.OrgId, newEvent.TmKey) - } - } -} - -// monitors for new key delete event and updates caches based on the same -func (k *OrgKeyCtrl) monitorKeyDelete() { - cluster, err := pbind.NewClusterFilterer(params.QuorumPrivateKeyManagementContract, k.ethClient) - if err != nil { - log.Error("Failed to monitor key action", "err", err) - } - ch := make(chan *pbind.ClusterOrgKeyDeleted) - - opts := &bind.WatchOpts{} - var blockNumber uint64 = 1 - opts.Start = &blockNumber - var newEvent *pbind.ClusterOrgKeyDeleted - - _, err = cluster.WatchOrgKeyDeleted(opts, ch) - if err != nil { - log.Info("Failed WatchOrgKeyDeleted: %v", err) - } - - for { - select { - case newEvent = <-ch: - types.DeleteOrgKey(newEvent.OrgId, newEvent.TmKey) - } - } -} diff --git a/core/quorum/api.go b/core/quorum/api.go index 25730f829..aaf9a5390 100644 --- a/core/quorum/api.go +++ b/core/quorum/api.go @@ -7,14 +7,13 @@ import ( "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - obind "github.com/ethereum/go-ethereum/controls/bind/cluster" - pbind "github.com/ethereum/go-ethereum/controls/bind/permission" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p/enode" + pbind "github.com/ethereum/go-ethereum/permission/bind/permission" "math/big" "regexp" ) @@ -74,10 +73,8 @@ type QuorumControlsAPI struct { ethClnt *ethclient.Client acntMgr *accounts.Manager txOpt *bind.TransactOpts - clustContr *obind.Cluster key *ecdsa.PrivateKey permEnabled bool - orgEnabled bool permConfig *types.PermissionConfig permInterf *pbind.PermInterface } @@ -148,7 +145,7 @@ var ( // NewQuorumControlsAPI creates a new QuorumControlsAPI to access quorum services func NewQuorumControlsAPI(tp *core.TxPool, am *accounts.Manager) *QuorumControlsAPI { - return &QuorumControlsAPI{tp, nil, am, nil, nil, nil, false, false, nil, nil} + return &QuorumControlsAPI{tp, nil, am, nil, nil, false, nil, nil} } //Init initializes QuorumControlsAPI with eth client, permission contract and org key management control diff --git a/core/types/permissions_cache.go b/core/types/permissions_cache.go index 60720c422..5beac9b47 100644 --- a/core/types/permissions_cache.go +++ b/core/types/permissions_cache.go @@ -175,19 +175,15 @@ var DefaultAccess = FullAccess var networkAdminRole string var orgAdminRole string -const orgKeyMapLimit = 100 - const defaultMapLimit = 100 -var OrgKeyMap, _ = lru.New(orgKeyMapLimit) +//var OrgKeyMap, _ = lru.New(orgKeyMapLimit) var OrgInfoMap = NewOrgCache() var NodeInfoMap = NewNodeCache() var RoleInfoMap = NewRoleCache() var AcctInfoMap = NewAcctCache() -var orgKeyLock sync.Mutex - func (pc *PermissionConfig) IsEmpty() bool { return pc.InterfAddress == common.HexToAddress("0x0") || pc.NodeAddress == common.HexToAddress("0x0") || pc.AccountAddress == common.HexToAddress("0x0") } @@ -407,49 +403,3 @@ func ValidateNodeForTxn(enodeId string, from common.Address) bool { } return false } - -// Adds org key details to cache -func AddOrgKey(orgId string, key string) { - if OrgKeyMap.Len() != 0 { - if val, ok := OrgKeyMap.Get(orgId); ok { - orgKeyLock.Lock() - defer orgKeyLock.Unlock() - // Org record exists. Append the key only - vo := val.(*OrgStruct) - vo.Keys = append(vo.Keys, key) - return - } - } - OrgKeyMap.Add(orgId, &OrgStruct{OrgId: orgId, Keys: []string{key}}) -} - -// deletes org key details from cache -func DeleteOrgKey(orgId string, key string) { - if val, ok := OrgKeyMap.Get(orgId); ok { - orgKeyLock.Lock() - defer orgKeyLock.Unlock() - vo := val.(*OrgStruct) - for i, keyVal := range vo.Keys { - if keyVal == key { - vo.Keys = append(vo.Keys[:i], vo.Keys[i+1:]...) - break - } - } - } -} - -// Givens a orgid returns the linked keys for the org -func ResolvePrivateForKeys(orgId string) []string { - var keys []string - if val, ok := OrgKeyMap.Get(orgId); ok { - vo := val.(*OrgStruct) - if len(vo.Keys) > 0 { - keys = vo.Keys - } else { - keys = append(keys, orgId) - } - return keys - } - keys = append(keys, orgId) - return keys -} diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 1dc85143b..150ed4ce9 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -397,12 +397,11 @@ func (s *PrivateAccountAPI) SendTransaction(ctx context.Context, args SendTxArgs if isPrivate { // Resolve the PrivateFrom - if its a org which is linked multiple constellation keys, // this will fetch the linked constellation ids - privateFor := resolvePrivateFor(args.PrivateFor) data := []byte(*args.Data) if len(data) > 0 { - log.Info("sending private tx", "data", fmt.Sprintf("%x", data), "privatefrom", args.PrivateFrom, "privatefor", privateFor) + log.Info("sending private tx", "data", fmt.Sprintf("%x", data), "privatefrom", args.PrivateFrom, "privatefor", args.PrivateFor) data, err := private.P.Send(data, args.PrivateFrom, args.PrivateFor) - log.Info("sent private tx", "data", fmt.Sprintf("%x", data), "privatefrom", args.PrivateFrom, "privatefor", privateFor) + log.Info("sent private tx", "data", fmt.Sprintf("%x", data), "privatefrom", args.PrivateFrom, "privatefor", args.PrivateFor) if err != nil { return common.Hash{}, err } @@ -1383,12 +1382,11 @@ func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args Sen // Resolve the PrivateFrom - if its a org which is linked multiple constellation keys, // this will fetch the linked constellation ids - privateFor := resolvePrivateFor(args.PrivateFor) //Send private transaction to local Constellation node if len(data) > 0 { - log.Info("sending private tx", "data", fmt.Sprintf("%x", data), "privatefrom", args.PrivateFrom, "privatefor", privateFor) - data, err = private.P.Send(data, args.PrivateFrom, privateFor) - log.Info("sent private tx", "data", fmt.Sprintf("%x", data), "privatefrom", args.PrivateFrom, "privatefor", privateFor) + log.Info("sending private tx", "data", fmt.Sprintf("%x", data), "privatefrom", args.PrivateFrom, "privatefor", args.PrivateFor) + data, err = private.P.Send(data, args.PrivateFrom, args.PrivateFor) + log.Info("sent private tx", "data", fmt.Sprintf("%x", data), "privatefrom", args.PrivateFrom, "privatefor", args.PrivateFor) if err != nil { return common.Hash{}, err } @@ -1832,13 +1830,3 @@ func (s *PublicBlockChainAPI) GetQuorumPayload(digestHex string) (string, error) } //End-Quorum - -func resolvePrivateFor(privateFor []string) []string { - var newPrivateFor []string - - for _, value := range privateFor { - keys := types.ResolvePrivateForKeys(value) - newPrivateFor = append(newPrivateFor, keys...) - } - return newPrivateFor -} diff --git a/controls/bind/permission/accounts.go b/permission/bind/permission/accounts.go similarity index 100% rename from controls/bind/permission/accounts.go rename to permission/bind/permission/accounts.go diff --git a/controls/bind/permission/nodes.go b/permission/bind/permission/nodes.go similarity index 100% rename from controls/bind/permission/nodes.go rename to permission/bind/permission/nodes.go diff --git a/controls/bind/permission/org.go b/permission/bind/permission/org.go similarity index 100% rename from controls/bind/permission/org.go rename to permission/bind/permission/org.go diff --git a/controls/bind/permission/permission_impl.go b/permission/bind/permission/permission_impl.go similarity index 100% rename from controls/bind/permission/permission_impl.go rename to permission/bind/permission/permission_impl.go diff --git a/controls/bind/permission/permission_interface.go b/permission/bind/permission/permission_interface.go similarity index 100% rename from controls/bind/permission/permission_interface.go rename to permission/bind/permission/permission_interface.go diff --git a/controls/bind/permission/permission_upgr.go b/permission/bind/permission/permission_upgr.go similarity index 100% rename from controls/bind/permission/permission_upgr.go rename to permission/bind/permission/permission_upgr.go diff --git a/controls/bind/permission/roles.go b/permission/bind/permission/roles.go similarity index 100% rename from controls/bind/permission/roles.go rename to permission/bind/permission/roles.go diff --git a/controls/bind/permission/voter.go b/permission/bind/permission/voter.go similarity index 100% rename from controls/bind/permission/voter.go rename to permission/bind/permission/voter.go diff --git a/controls/client.go b/permission/client.go similarity index 96% rename from controls/client.go rename to permission/client.go index 8be67dae7..0b767c468 100644 --- a/controls/client.go +++ b/permission/client.go @@ -1,4 +1,4 @@ -package controls +package permission import ( "github.com/ethereum/go-ethereum/eth" diff --git a/controls/permission/AccountManager.sol b/permission/contract/AccountManager.sol similarity index 99% rename from controls/permission/AccountManager.sol rename to permission/contract/AccountManager.sol index 367e2f6cd..2fdaa97d0 100644 --- a/controls/permission/AccountManager.sol +++ b/permission/contract/AccountManager.sol @@ -1,4 +1,5 @@ pragma solidity ^0.5.3; + import "./PermissionsUpgradable.sol"; contract AccountManager { diff --git a/controls/permission/NodeManager.sol b/permission/contract/NodeManager.sol similarity index 94% rename from controls/permission/NodeManager.sol rename to permission/contract/NodeManager.sol index 5c11adbc7..201aec33c 100644 --- a/controls/permission/NodeManager.sol +++ b/permission/contract/NodeManager.sol @@ -1,4 +1,5 @@ pragma solidity ^0.5.3; + import "./PermissionsUpgradable.sol"; @@ -7,7 +8,7 @@ contract NodeManager { // enum and struct declaration // changing node status to integer (0-NotInList, 1- PendingApproval, 2-Approved, 3-Deactivated, 4-Blacklisted) // PendingDeactivation, Deactivated, PendingActivation, PendingBlacklisting, Blacklisted) -// enum NodeStatus {NotInList, PendingApproval, Approved, PendingDeactivation, Deactivated, PendingActivation, PendingBlacklisting, Blacklisted} + // enum NodeStatus {NotInList, PendingApproval, Approved, PendingDeactivation, Deactivated, PendingActivation, PendingBlacklisting, Blacklisted} struct NodeDetails { string enodeId; //e.g. 127.0.0.1:20005 string orgId; @@ -79,7 +80,7 @@ contract NodeManager { // Get node status by enode id function getNodeStatus(string memory _enodeId) public view returns (uint) { - if (nodeIdToIndex[keccak256(abi.encodePacked(_enodeId))] == 0){ + if (nodeIdToIndex[keccak256(abi.encodePacked(_enodeId))] == 0) { return 0; } return nodeList[getNodeIndex(_enodeId)].status; @@ -100,7 +101,7 @@ contract NodeManager { { numberOfNodes++; nodeIdToIndex[keccak256(abi.encodePacked(_enodeId))] = numberOfNodes; - nodeList.push(NodeDetails(_enodeId, _orgId, 1)); + nodeList.push(NodeDetails(_enodeId, _orgId, 1)); emit NodeProposed(_enodeId, _orgId); } @@ -110,7 +111,7 @@ contract NodeManager { { numberOfNodes++; nodeIdToIndex[keccak256(abi.encodePacked(_enodeId))] = numberOfNodes; - nodeList.push(NodeDetails(_enodeId, _orgId, 2)); + nodeList.push(NodeDetails(_enodeId, _orgId, 2)); emit NodeApproved(_enodeId, _orgId); } @@ -138,12 +139,12 @@ contract NodeManager { // operations that can be done 3-Deactivate Node, 4-ActivateNode, 5-Blacklist nodeList require((_status == 3 || _status == 4 || _status == 5), "invalid operation"); - if (_status == 3){ + if (_status == 3) { require(getNodeStatus(_enodeId) == 2, "Op cannot be performed"); nodeList[getNodeIndex(_enodeId)].status = 3; emit NodeDeactivated(_enodeId, _orgId); } - else if (_status == 4){ + else if (_status == 4) { require(getNodeStatus(_enodeId) == 3, "Op cannot be performed"); nodeList[getNodeIndex(_enodeId)].status = 2; emit NodeActivated(_enodeId, _orgId); @@ -162,7 +163,7 @@ contract NodeManager { } function checkOrg(string memory _enodeId, string memory _orgId) internal view - returns(bool) + returns (bool) { return (keccak256(abi.encodePacked(nodeList[getNodeIndex(_enodeId)].orgId)) == keccak256(abi.encodePacked(_orgId))); } diff --git a/controls/permission/OrgManager.sol b/permission/contract/OrgManager.sol similarity index 99% rename from controls/permission/OrgManager.sol rename to permission/contract/OrgManager.sol index 9812a5267..4ee5ecb2b 100644 --- a/controls/permission/OrgManager.sol +++ b/permission/contract/OrgManager.sol @@ -257,6 +257,7 @@ contract OrgManager { { return orgList[_orgIndex].subOrgIndexList.length; } + function getSubOrgIndexLength(uint _orgIndex, uint _subOrgIndex) external view returns (uint) { return orgList[_orgIndex].subOrgIndexList[_subOrgIndex]; diff --git a/controls/permission/PermissionsImplementation.sol b/permission/contract/PermissionsImplementation.sol similarity index 100% rename from controls/permission/PermissionsImplementation.sol rename to permission/contract/PermissionsImplementation.sol diff --git a/controls/permission/PermissionsInterface.sol b/permission/contract/PermissionsInterface.sol similarity index 98% rename from controls/permission/PermissionsInterface.sol rename to permission/contract/PermissionsInterface.sol index 1e30e2e2a..b581a02cd 100644 --- a/controls/permission/PermissionsInterface.sol +++ b/permission/contract/PermissionsInterface.sol @@ -24,7 +24,7 @@ contract PermissionsInterface { permImplementation = PermissionsImplementation(_permImplementation); } - function getPermissionsImpl() public view returns(address) + function getPermissionsImpl() public view returns (address) { return address(permImplementation); } diff --git a/controls/permission/PermissionsUpgradable.sol b/permission/contract/PermissionsUpgradable.sol similarity index 80% rename from controls/permission/PermissionsUpgradable.sol rename to permission/contract/PermissionsUpgradable.sol index edbfe153a..faa3d1177 100644 --- a/controls/permission/PermissionsUpgradable.sol +++ b/permission/contract/PermissionsUpgradable.sol @@ -18,7 +18,7 @@ contract PermissionsUpgradable { _; } - function init (address _permInterface, address _permImpl) external + function init(address _permInterface, address _permImpl) external onlyCustodian { permImpl = _permImpl; @@ -35,17 +35,17 @@ contract PermissionsUpgradable { setImpl(permImpl); } - function getCustodian() public view returns(address) + function getCustodian() public view returns (address) { return custodian; } - function getPermImpl() public view returns(address) + function getPermImpl() public view returns (address) { return permImpl; } - function getPermInterface() public view returns(address) + function getPermInterface() public view returns (address) { return permInterface; } diff --git a/controls/permission/RoleManager.sol b/permission/contract/RoleManager.sol similarity index 99% rename from controls/permission/RoleManager.sol rename to permission/contract/RoleManager.sol index ba5c76044..4cc87b552 100644 --- a/controls/permission/RoleManager.sol +++ b/permission/contract/RoleManager.sol @@ -1,9 +1,11 @@ pragma solidity ^0.5.3; + import "./PermissionsUpgradable.sol"; // TODO: check code comments contract RoleManager { PermissionsUpgradable private permUpgradable; + struct RoleDetails { string roleId; string orgId; @@ -75,7 +77,7 @@ contract RoleManager { } } - function removeRole(string calldata _roleId, string calldata _orgId) external{ + function removeRole(string calldata _roleId, string calldata _orgId) external { if (roleIndex[keccak256(abi.encodePacked(_roleId, _orgId))] != 0) { uint rIndex = getRoleIndex(_roleId, _orgId); roleList[rIndex].active = false; diff --git a/controls/permission/VoterManager.sol b/permission/contract/VoterManager.sol similarity index 99% rename from controls/permission/VoterManager.sol rename to permission/contract/VoterManager.sol index e9c254758..5ddb43963 100644 --- a/controls/permission/VoterManager.sol +++ b/permission/contract/VoterManager.sol @@ -1,4 +1,5 @@ pragma solidity ^0.5.3; + import "./PermissionsUpgradable.sol"; @@ -155,7 +156,7 @@ contract VoterManager { orgVoterList[id].pendingOp.enodeId = _enodeId; orgVoterList[id].pendingOp.account = _account; orgVoterList[id].pendingOp.opType = _pendingOp; -// init vote status + // init vote status for (uint i = 0; i < orgVoterList[id].voterList.length; i++) { if (orgVoterList[id].voterList[i].active) { orgVoterList[id].votingStatus[id][orgVoterList[id].voterList[i].vAccount] = false; diff --git a/controls/permission/abi/AccountManager.abi b/permission/contract/abi/AccountManager.abi similarity index 100% rename from controls/permission/abi/AccountManager.abi rename to permission/contract/abi/AccountManager.abi diff --git a/controls/permission/abi/NodeManager.abi b/permission/contract/abi/NodeManager.abi similarity index 100% rename from controls/permission/abi/NodeManager.abi rename to permission/contract/abi/NodeManager.abi diff --git a/controls/permission/abi/OrgManager.abi b/permission/contract/abi/OrgManager.abi similarity index 100% rename from controls/permission/abi/OrgManager.abi rename to permission/contract/abi/OrgManager.abi diff --git a/controls/permission/abi/PermissionsImplementation.abi b/permission/contract/abi/PermissionsImplementation.abi similarity index 100% rename from controls/permission/abi/PermissionsImplementation.abi rename to permission/contract/abi/PermissionsImplementation.abi diff --git a/controls/permission/abi/PermissionsInterface.abi b/permission/contract/abi/PermissionsInterface.abi similarity index 100% rename from controls/permission/abi/PermissionsInterface.abi rename to permission/contract/abi/PermissionsInterface.abi diff --git a/controls/permission/abi/PermissionsUpgradable.abi b/permission/contract/abi/PermissionsUpgradable.abi similarity index 100% rename from controls/permission/abi/PermissionsUpgradable.abi rename to permission/contract/abi/PermissionsUpgradable.abi diff --git a/controls/permission/abi/RoleManager.abi b/permission/contract/abi/RoleManager.abi similarity index 100% rename from controls/permission/abi/RoleManager.abi rename to permission/contract/abi/RoleManager.abi diff --git a/controls/permission/abi/VoterManager.abi b/permission/contract/abi/VoterManager.abi similarity index 100% rename from controls/permission/abi/VoterManager.abi rename to permission/contract/abi/VoterManager.abi diff --git a/controls/permission/permission.go b/permission/permission.go similarity index 99% rename from controls/permission/permission.go rename to permission/permission.go index 97ba2b4a4..0bc0559b9 100644 --- a/controls/permission/permission.go +++ b/permission/permission.go @@ -6,8 +6,6 @@ import ( "errors" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/controls" - pbind "github.com/ethereum/go-ethereum/controls/bind/permission" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethclient" @@ -16,6 +14,7 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/params" + pbind "github.com/ethereum/go-ethereum/permission/bind/permission" "github.com/ethereum/go-ethereum/raft" "io/ioutil" "math/big" @@ -146,7 +145,7 @@ func waitForSync(e *eth.Ethereum) { // Creates the controls structure for permissions func NewQuorumPermissionCtrl(stack *node.Node, permissionedMode, isRaft bool, pconfig *types.PermissionConfig) (*PermissionCtrl, error) { // Create a new ethclient to for interfacing with the contract - stateReader, e, err := controls.CreateEthClient(stack) + stateReader, e, err := CreateEthClient(stack) waitForSync(e) if err != nil { log.Error("Unable to create ethereum client for permissions check", "err", err)