rpc: check for error responses in tests

sendrawtransaction_negative was actually wrong in trying to get
SendTXResponse, it received an error.
This commit is contained in:
Roman Khimov 2019-09-24 18:47:23 +03:00
parent dac1f9367c
commit 2daff0957a
2 changed files with 39 additions and 4 deletions

View file

@ -18,6 +18,16 @@ import (
"github.com/stretchr/testify/require"
)
// ErrorResponse struct represents JSON-RPC error.
type ErrorResponse struct {
Jsonrpc string `json:"jsonrpc"`
Error struct {
Code int `json:"code"`
Message string `json:"message"`
} `json:"error"`
ID int `json:"id"`
}
// SendTXResponse struct for testing.
type SendTXResponse struct {
Jsonrpc string `json:"jsonrpc"`