Add Version() method to the policy contract #68
3 changed files with 11 additions and 0 deletions
|
@ -4,3 +4,4 @@ safemethods:
|
|||
- "listChains"
|
||||
- "getChain"
|
||||
- "listChainsByPrefix"
|
||||
- "version"
|
||||
|
|
|
@ -58,6 +58,11 @@ func checkAuthorization(ctx storage.Context) {
|
|||
panic(ErrNotAuthorized)
|
||||
}
|
||||
|
||||
// Version returns the version of the contract.
|
||||
func Version() int {
|
||||
return common.Version
|
||||
}
|
||||
|
||||
func SetAdmin(addr interop.Hash160) {
|
||||
common.CheckAlphabetWitness()
|
||||
|
||||
|
|
|
@ -72,6 +72,11 @@ func (c *ContractReader) ListChainsByPrefix(entity *big.Int, entityName string,
|
|||
return unwrap.Array(c.invoker.Call(c.hash, "listChainsByPrefix", entity, entityName, prefix))
|
||||
}
|
||||
|
||||
// Version invokes `version` method of contract.
|
||||
func (c *ContractReader) Version() (*big.Int, error) {
|
||||
return unwrap.BigInt(c.invoker.Call(c.hash, "version"))
|
||||
}
|
||||
|
||||
// AddChain creates a transaction invoking `addChain` method of the contract.
|
||||
// This transaction is signed and immediately sent to the network.
|
||||
// The values returned are its hash, ValidUntilBlock value and error if any.
|
||||
|
|
Loading…
Reference in a new issue