From 9a4e53b58ebf509d554d7c95276204592c43e144 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 28 May 2020 23:04:29 +0300 Subject: [PATCH] rpc/client: no longer add UTXO GAS for fees It's already being paid with NEP5 GAS. --- pkg/rpc/client/nep5.go | 6 ------ pkg/rpc/client/rpc.go | 8 -------- 2 files changed, 14 deletions(-) diff --git a/pkg/rpc/client/nep5.go b/pkg/rpc/client/nep5.go index 063c4524b..1bdccdcb3 100644 --- a/pkg/rpc/client/nep5.go +++ b/pkg/rpc/client/nep5.go @@ -5,11 +5,9 @@ import ( "errors" "fmt" - "github.com/nspcc-dev/neo-go/pkg/core" "github.com/nspcc-dev/neo-go/pkg/core/transaction" "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/io" - "github.com/nspcc-dev/neo-go/pkg/rpc/request" "github.com/nspcc-dev/neo-go/pkg/smartcontract" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/vm/emit" @@ -137,10 +135,6 @@ func (c *Client) TransferNEP5(acc *wallet.Account, to util.Uint160, token util.U return util.Uint256{}, fmt.Errorf("can't calculate validUntilBlock: %v", err) } - if err := request.AddInputsAndUnspentsToTx(tx, acc.Address, core.UtilityTokenID(), gas, c); err != nil { - return util.Uint256{}, fmt.Errorf("can't add GAS to transaction: %v", err) - } - err = c.AddNetworkFee(tx, acc) if err != nil { return util.Uint256{}, fmt.Errorf("can't add network fee to transaction: %v", err) diff --git a/pkg/rpc/client/rpc.go b/pkg/rpc/client/rpc.go index 00f58c542..38f8219ef 100644 --- a/pkg/rpc/client/rpc.go +++ b/pkg/rpc/client/rpc.go @@ -515,14 +515,6 @@ func (c *Client) SignAndPushInvocationTx(script []byte, acc *wallet.Account, sys } tx.Sender = addr - gas := sysfee + netfee - - if gas > 0 { - if err = request.AddInputsAndUnspentsToTx(tx, acc.Address, core.UtilityTokenID(), gas, c); err != nil { - return txHash, errors.Wrap(err, "failed to add inputs and unspents to transaction") - } - } - err = c.AddNetworkFee(tx, acc) if err != nil { return txHash, errors.Wrapf(err, "failed to add network fee")