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:
parent
dac1f9367c
commit
2daff0957a
2 changed files with 39 additions and 4 deletions
|
@ -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"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue