RpcServer: return RpcError.InsufficientNetworkFee
error where appropriate
#889
Labels
bug
Something isn't working
Describe the bug
After #815 merge,
RpcError.InsufficientFunds
(with code-511
) is returned on the incoming transaction verification when:Whereas RPC errors proposal postulates that
-511 Insufficient funds
error should be returned only in case 1, i.e. when:And all other cases of insufficient sender's balance should be covered by generic
-500
error:To Reproduce
Steps to reproduce the behavior:
neo-modules/src/RpcServer/RpcServer.Node.cs
Lines 97 to 100 in 253a77e
Expected behavior
TransactionVerificationContext.CheckTransaction
so that it returns some new special error, this error should be detached fromVerifyResult.InsufficientFunds
and ported to other components (ref. https://github.com/neo-project/neo/blob/b05501af882a0d1f2a1a7841c6ddc4d0504e5fc1/src/Neo/Network/P2P/Payloads/Transaction.cs#L368.). This special error should be converted toRpcError
with-511
code on the RPC server side whereas the rest ofVerifyResult.InsufficientFunds
cases should be converted toRpcError
with-500
code.RpcError.ExpiredTransaction
to make it more precise to reflect the proposal intention. Currently it's:neo-modules/src/RpcServer/RpcError.cs
Line 63 in 253a77e
Platform:
Additional context
The same problem was recently fixed in NeoGo, see nspcc-dev/neo-go#3360. This issue is not critical, but eventually it should be fixed.
The text was updated successfully, but these errors were encountered: