state: store NEF instead of script for contract

NEFs for native contracts are set statically, thus
field values are taken from the reference implementation.
This commit is contained in:
Evgeniy Stratonikov 2021-01-13 15:34:10 +03:00
parent 11191c0a08
commit 0b26b46234
17 changed files with 138 additions and 72 deletions

View file

@ -418,7 +418,7 @@ func addNetworkFee(bc *Blockchain, tx *transaction.Transaction, sender *wallet.A
for _, cosigner := range tx.Signers {
contract := bc.GetContractState(cosigner.Account)
if contract != nil {
netFee, sizeDelta = fee.Calculate(bc.GetBaseExecFee(), contract.Script)
netFee, sizeDelta = fee.Calculate(bc.GetBaseExecFee(), contract.NEF.Script)
tx.NetworkFee += netFee
size += sizeDelta
}