mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 03:47:18 +00:00
Merge pull request #3361 from nspcc-dev/fix-rpc-511
rpcsrv: fix insufficient funds use
This commit is contained in:
commit
7e12cc11e4
2 changed files with 2 additions and 2 deletions
|
@ -2657,7 +2657,7 @@ func getRelayResult(err error, hash util.Uint256) (any, *neorpc.Error) {
|
||||||
return nil, neorpc.WrapErrorWithData(neorpc.ErrInsufficientNetworkFee, err.Error())
|
return nil, neorpc.WrapErrorWithData(neorpc.ErrInsufficientNetworkFee, err.Error())
|
||||||
case errors.Is(err, core.ErrInvalidAttribute):
|
case errors.Is(err, core.ErrInvalidAttribute):
|
||||||
return nil, neorpc.WrapErrorWithData(neorpc.ErrInvalidAttribute, err.Error())
|
return nil, neorpc.WrapErrorWithData(neorpc.ErrInvalidAttribute, err.Error())
|
||||||
case errors.Is(err, core.ErrMemPoolConflict):
|
case errors.Is(err, core.ErrInsufficientFunds), errors.Is(err, core.ErrMemPoolConflict):
|
||||||
return nil, neorpc.WrapErrorWithData(neorpc.ErrInsufficientFunds, err.Error())
|
return nil, neorpc.WrapErrorWithData(neorpc.ErrInsufficientFunds, err.Error())
|
||||||
case errors.Is(err, core.ErrInvalidSignature):
|
case errors.Is(err, core.ErrInvalidSignature):
|
||||||
return nil, neorpc.WrapErrorWithData(neorpc.ErrInvalidSignature, err.Error())
|
return nil, neorpc.WrapErrorWithData(neorpc.ErrInvalidSignature, err.Error())
|
||||||
|
|
|
@ -2659,7 +2659,7 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) []
|
||||||
t.Run("insufficient funds", func(t *testing.T) {
|
t.Run("insufficient funds", func(t *testing.T) {
|
||||||
b := testchain.NewBlock(t, chain, 1, 0, newTxWithParams(t, chain, opcode.PUSH1, 10, 899999999999, 1, false))
|
b := testchain.NewBlock(t, chain, 1, 0, newTxWithParams(t, chain, opcode.PUSH1, 10, 899999999999, 1, false))
|
||||||
body := doRPCCall(fmt.Sprintf(rpc, encodeBinaryToString(t, b)), httpSrv.URL, t)
|
body := doRPCCall(fmt.Sprintf(rpc, encodeBinaryToString(t, b)), httpSrv.URL, t)
|
||||||
checkErrGetResult(t, body, true, neorpc.ErrVerificationFailedCode)
|
checkErrGetResult(t, body, true, neorpc.ErrInsufficientFundsCode)
|
||||||
})
|
})
|
||||||
t.Run("positive", func(t *testing.T) {
|
t.Run("positive", func(t *testing.T) {
|
||||||
b := testchain.NewBlock(t, chain, 1, 0, newTxWithParams(t, chain, opcode.PUSH1, 10, 0, 1, false))
|
b := testchain.NewBlock(t, chain, 1, 0, newTxWithParams(t, chain, opcode.PUSH1, 10, 0, 1, false))
|
||||||
|
|
Loading…
Reference in a new issue