github.com/core-coin/go-core/v2@v2.1.9/rpc/testdata/invalid-batch.js (about)

     1  // This test checks the behavior of batches with invalid elements.
     2  // Empty batches are not allowed. Batches may contain junk.
     3  
     4  --> []
     5  <-- {"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"empty batch"}}
     6  
     7  --> [1]
     8  <-- [{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}}]
     9  
    10  --> [1,2,3]
    11  <-- [{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}},{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}},{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}}]
    12  
    13  --> [null]
    14  <-- [{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}}]
    15  
    16  --> [{"jsonrpc":"2.0","id":1,"method":"test_echo","params":["foo",1]},55,{"jsonrpc":"2.0","id":2,"method":"unknown_method"},{"foo":"bar"}]
    17  <-- [{"jsonrpc":"2.0","id":1,"result":{"String":"foo","Int":1,"Args":null}},{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}},{"jsonrpc":"2.0","id":2,"error":{"code":-32601,"message":"the method unknown_method does not exist/is not available"}},{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}}]