From cbdc6ba46963cf216fe51b19224ef0b42714147d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 17 Jan 2023 21:28:20 +0300 Subject: [PATCH] rpcclient/actor: Document `RPCActor.CalculateNetworkFee` method `Actor.MakeUnsignedUncheckedRun` method imposes restriction to `CalculateNetworkFee` method's implementations: `Hash` or `Size` methods must not be called on the pointer to the given transaction. Add docs to adjust described requirement. Signed-off-by: Leonard Lyubich --- pkg/rpcclient/actor/actor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/rpcclient/actor/actor.go b/pkg/rpcclient/actor/actor.go index c6ee86f92..f8926a958 100644 --- a/pkg/rpcclient/actor/actor.go +++ b/pkg/rpcclient/actor/actor.go @@ -26,6 +26,10 @@ import ( type RPCActor interface { invoker.RPCInvoke + // CalculateNetworkFee calculates network fee for the given transaction. + // + // CalculateNetworkFee MUST NOT call state-changing methods (like Hash or Size) + // of the transaction through the passed pointer: make a copy if necessary. CalculateNetworkFee(tx *transaction.Transaction) (int64, error) GetBlockCount() (uint32, error) GetVersion() (*result.Version, error)