rpcclient; deprecate more methods

They make little sense now.
This commit is contained in:
Roman Khimov 2022-09-07 19:57:54 +03:00
parent c4ddf80742
commit 3e8e6857e5
2 changed files with 14 additions and 0 deletions

View file

@ -30,6 +30,9 @@ func (c *Client) GetStoragePrice() (int64, error) {
} }
// GetMaxNotValidBeforeDelta invokes `getMaxNotValidBeforeDelta` method on a native Notary contract. // GetMaxNotValidBeforeDelta invokes `getMaxNotValidBeforeDelta` method on a native Notary contract.
//
// Deprecated: please use notary subpackage. This method will be removed
// in future versions.
func (c *Client) GetMaxNotValidBeforeDelta() (int64, error) { func (c *Client) GetMaxNotValidBeforeDelta() (int64, error) {
notaryHash, err := c.GetNativeContractHash(nativenames.Notary) notaryHash, err := c.GetNativeContractHash(nativenames.Notary)
if err != nil { if err != nil {

View file

@ -1100,6 +1100,9 @@ func (c *Client) AddNetworkFee(tx *transaction.Transaction, extraFee int64, accs
// GetNetwork returns the network magic of the RPC node the client connected to. It // GetNetwork returns the network magic of the RPC node the client connected to. It
// requires Init to be done first, otherwise an error is returned. // requires Init to be done first, otherwise an error is returned.
//
// Deprecated: please use GetVersion (it has the same data in the Protocol section)
// or actor subpackage. This method will be removed in future versions.
func (c *Client) GetNetwork() (netmode.Magic, error) { func (c *Client) GetNetwork() (netmode.Magic, error) {
c.cacheLock.RLock() c.cacheLock.RLock()
defer c.cacheLock.RUnlock() defer c.cacheLock.RUnlock()
@ -1112,6 +1115,9 @@ func (c *Client) GetNetwork() (netmode.Magic, error) {
// StateRootInHeader returns true if the state root is contained in the block header. // StateRootInHeader returns true if the state root is contained in the block header.
// You should initialize Client cache with Init() before calling StateRootInHeader. // You should initialize Client cache with Init() before calling StateRootInHeader.
//
// Deprecated: please use GetVersion (it has the same data in the Protocol section).
// This method will be removed in future versions.
func (c *Client) StateRootInHeader() (bool, error) { func (c *Client) StateRootInHeader() (bool, error) {
c.cacheLock.RLock() c.cacheLock.RLock()
defer c.cacheLock.RUnlock() defer c.cacheLock.RUnlock()
@ -1123,6 +1129,11 @@ func (c *Client) StateRootInHeader() (bool, error) {
} }
// GetNativeContractHash returns native contract hash by its name. // GetNativeContractHash returns native contract hash by its name.
//
// Deprecated: please use native contract subpackages that have hashes directly
// (gas, management, neo, notary, oracle, policy, rolemgmt) or
// GetContractStateByAddressOrName method that will return hash along with other
// data.
func (c *Client) GetNativeContractHash(name string) (util.Uint160, error) { func (c *Client) GetNativeContractHash(name string) (util.Uint160, error) {
c.cacheLock.RLock() c.cacheLock.RLock()
hash, ok := c.cache.nativeHashes[name] hash, ok := c.cache.nativeHashes[name]