forked from TrueCloudLab/frostfs-node
[#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:
parent
ae6ebccd9c
commit
4582b8f0d4
5 changed files with 112 additions and 76 deletions
|
@ -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(¬HaltStateError{state: r.State, exception: r.FaultException})
|
||||
}
|
||||
|
||||
t.SystemFee += add
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue