public class AuthManager
extends java.lang.Object
| 构造器和说明 |
|---|
AuthManager(Client client,
CryptoKeyPair credential) |
AuthManager(Client client,
CryptoKeyPair credential,
java.math.BigInteger blockNumberInterval) |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.Boolean |
checkDeployAuth(java.lang.String account)
check the account whether this account can deploy contract
|
java.lang.Boolean |
checkMethodAuth(java.lang.String contractAddr,
byte[] func,
java.lang.String account)
check the contract interface func whether this account can call
|
java.lang.String |
getAdmin(java.lang.String contractAddress)
get a specific contract admin
|
java.lang.String |
getCommitteeAddress() |
CommitteeInfo |
getCommitteeInfo()
get Committee info
|
java.math.BigInteger |
getDeployAuthType()
get global deploy auth type
|
ProposalInfo |
getProposalInfo(java.math.BigInteger proposalId)
get proposal info
|
java.lang.String |
getProposalManagerAddress() |
java.math.BigInteger |
modifyDeployAuth(java.lang.String account,
java.lang.Boolean openFlag)
submit a proposal of adding deploy contract auth for account, only governor can call it
|
java.math.BigInteger |
proposalCount()
get proposal count
|
java.math.BigInteger |
resetAdmin(java.lang.String newAdmin,
java.lang.String contractAddr)
submit a proposal of resetting contract admin, only governor can call it
|
TransactionReceipt |
revokeProposal(java.math.BigInteger proposalId)
revoke proposal, only governor can call it
|
java.math.BigInteger |
setDeployAuthType(AuthType deployAuthType)
submit a proposal of setting deploy contract auth type, only governor can call it
|
java.math.BigInteger |
setMethodAuth(java.lang.String contractAddr,
byte[] func,
java.lang.String account,
boolean isOpen)
set a specific contract's method ACL, only contract admin can call it
|
java.math.BigInteger |
setMethodAuthType(java.lang.String contractAddr,
byte[] func,
AuthType authType)
set a specific contract's method auth type, only contract admin can call it
|
java.math.BigInteger |
setRate(java.math.BigInteger participatesRate,
java.math.BigInteger winRate)
apply set participate rate and win rate. only governor can call it
|
java.math.BigInteger |
updateGovernor(java.lang.String account,
java.math.BigInteger weight)
apply for update governor, only governor can call it
|
TransactionReceipt |
voteProposal(java.math.BigInteger proposalId,
java.lang.Boolean agree)
unified vote, only governor can call it
|
public AuthManager(Client client, CryptoKeyPair credential) throws ContractException
public AuthManager(Client client, CryptoKeyPair credential, java.math.BigInteger blockNumberInterval) throws ContractException
public java.lang.String getCommitteeAddress()
throws ContractException
public java.lang.String getProposalManagerAddress()
throws ContractException
public java.math.BigInteger updateGovernor(java.lang.String account,
java.math.BigInteger weight)
throws ABICodecException,
TransactionException,
java.io.IOException
account - new governor addressweight, - 0-delete, bigger than 0-update or insertABICodecExceptionTransactionExceptionjava.io.IOExceptionpublic java.math.BigInteger setRate(java.math.BigInteger participatesRate,
java.math.BigInteger winRate)
throws ABICodecException,
TransactionException,
java.io.IOException
participatesRate, - [0,100]. if 0, always succeed.winRate, - [0,100].ABICodecExceptionTransactionExceptionjava.io.IOExceptionpublic java.math.BigInteger setDeployAuthType(AuthType deployAuthType) throws ABICodecException, TransactionException, java.io.IOException
deployAuthType: - 1-whitelist; 2-blacklistABICodecExceptionTransactionExceptionjava.io.IOExceptionpublic java.math.BigInteger getDeployAuthType()
throws ContractException
ContractExceptionpublic java.math.BigInteger modifyDeployAuth(java.lang.String account,
java.lang.Boolean openFlag)
throws ABICodecException,
TransactionException,
java.io.IOException
account - account address stringopenFlag: - true-open; false-closeABICodecExceptionTransactionExceptionjava.io.IOExceptionpublic java.math.BigInteger resetAdmin(java.lang.String newAdmin,
java.lang.String contractAddr)
throws ABICodecException,
TransactionException,
java.io.IOException
newAdmin - admin addresscontractAddr - the address of contract which will propose to reset adminABICodecExceptionTransactionExceptionjava.io.IOExceptionpublic TransactionReceipt revokeProposal(java.math.BigInteger proposalId)
proposalId - idpublic TransactionReceipt voteProposal(java.math.BigInteger proposalId, java.lang.Boolean agree)
proposalId - idagree - true or falsepublic ProposalInfo getProposalInfo(java.math.BigInteger proposalId) throws ContractException
proposalId - proposal idContractExceptionpublic CommitteeInfo getCommitteeInfo() throws ContractException
ContractExceptionpublic java.lang.Boolean checkDeployAuth(java.lang.String account)
throws ContractException
account - the account to checkContractExceptionpublic java.lang.Boolean checkMethodAuth(java.lang.String contractAddr,
byte[] func,
java.lang.String account)
throws ContractException
contractAddr - the contractAddressfunc - interface func selector of contract, 4 bytesaccount - the account to checkContractExceptionpublic java.lang.String getAdmin(java.lang.String contractAddress)
throws ContractException
contractAddress - the contract to get adminContractExceptionpublic java.math.BigInteger setMethodAuthType(java.lang.String contractAddr,
byte[] func,
AuthType authType)
contractAddr - the contract address to set authfunc - interface func selector of contract, 4 bytesauthType - white_list or black_listpublic java.math.BigInteger setMethodAuth(java.lang.String contractAddr,
byte[] func,
java.lang.String account,
boolean isOpen)
contractAddr - the contract address to set aclfunc - interface func selector of contract, 4 bytesaccount - the account to setisOpen - if open, then white_list type is true, black_list is false; if close, then
white_list type is false, black_list is true;public java.math.BigInteger proposalCount()
throws ContractException
ContractException