From 3e8e6857e593d0572d960dfc1fe9dbd193b8559c Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 7 Sep 2022 19:57:54 +0300 Subject: [PATCH] rpcclient; deprecate more methods They make little sense now. --- pkg/rpcclient/policy.go | 3 +++ pkg/rpcclient/rpc.go | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/pkg/rpcclient/policy.go b/pkg/rpcclient/policy.go index 84e386a29..4d45ffb09 100644 --- a/pkg/rpcclient/policy.go +++ b/pkg/rpcclient/policy.go @@ -30,6 +30,9 @@ func (c *Client) GetStoragePrice() (int64, error) { } // 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) { notaryHash, err := c.GetNativeContractHash(nativenames.Notary) if err != nil { diff --git a/pkg/rpcclient/rpc.go b/pkg/rpcclient/rpc.go index a2f0d02b1..c61ebb9f2 100644 --- a/pkg/rpcclient/rpc.go +++ b/pkg/rpcclient/rpc.go @@ -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 // 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) { c.cacheLock.RLock() 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. // 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) { c.cacheLock.RLock() defer c.cacheLock.RUnlock() @@ -1123,6 +1129,11 @@ func (c *Client) StateRootInHeader() (bool, error) { } // 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) { c.cacheLock.RLock() hash, ok := c.cache.nativeHashes[name]