[#1711] morph: Drop deprecated neo-go calls

Does not include notary actor and does not drop the deprecated
`AddNetworkFee`.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-08-29 18:32:54 +03:00 committed by fyrchik
parent ae6ebccd9c
commit 4582b8f0d4
5 changed files with 112 additions and 76 deletions

View file

@ -4,6 +4,8 @@ import (
"fmt"
"math/big"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/neorpc/result"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
)
@ -92,3 +94,15 @@ func StringFromStackItem(param stackitem.Item) (string, error) {
return stackitem.ToString(param)
}
func addFeeCheckerModifier(add int64) func(r *result.Invoke, t *transaction.Transaction) error {
return func(r *result.Invoke, t *transaction.Transaction) error {
if r.State != HaltState {
return wrapNeoFSError(&notHaltStateError{state: r.State, exception: r.FaultException})
}
t.SystemFee += add
return nil
}
}