Skip to content

[Improve] CalculateNetworkFee #3481

@cschuchardt88

Description

@cschuchardt88

Summary or problem description
The way that CalculateNetworkFee parameters are and using extension method is not the easy nor the best way of getting the networkFee. It requires WAY to much overhead. Same calculating for TransactionAttribute.CalculateNetworkFee.

        public static long CalculateNetworkFee(
            this Transaction tx,
            DataCache snapshot,
            ProtocolSettings settings,
            Func<UInt160, byte[]> accountScript,
            long maxExecutionCost = ApplicationEngine.TestModeGas);

Do you have any solution you want to propose?
Create different ambiguous methods for CalculateNetworkFee.

Recommended Methods:

// Throw exception when 'contract' is signer
public static long CalculateNetworkFee(this Transaction tx, long exec_fee_factor);
// Does what it does now
public static long CalculateNetworkFee(this Transaction tx, DataCache snapshot, ProtocolSettings settings);

Where in the software does this update applies to?

  • Core

Metadata

Metadata

Assignees

No one assigned

    Labels

    DiscussionInitial issue state - proposed but not yet accepted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions