core: move CalculateNetworkFee to a separate package

This commit is contained in:
Evgenii Stratonikov 2020-09-28 17:56:16 +03:00
parent d6a1a22afa
commit 9733a6f394
10 changed files with 66 additions and 55 deletions

View file

@ -7,6 +7,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/core"
"github.com/nspcc-dev/neo-go/pkg/core/block"
"github.com/nspcc-dev/neo-go/pkg/core/fee"
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
@ -552,7 +553,7 @@ func (c *Client) AddNetworkFee(tx *transaction.Transaction, extraFee int64, accs
size += io.GetVarSize([]byte{}) * 2 // both scripts are empty
continue
}
netFee, sizeDelta := core.CalculateNetworkFee(accs[i].Contract.Script)
netFee, sizeDelta := fee.Calculate(accs[i].Contract.Script)
tx.NetworkFee += netFee
size += sizeDelta
}