forked from TrueCloudLab/neoneo-go
rpc/server: rework submitblock empty test
The original intention here was to check for server reaction in presence of validation errors (response.ErrValidationFailed) and it was very easy to make validation fail for block without transactions in Neo 2. But in Neo 3 transactionless blocks are perfectly valid (see29d321b5e1
) which broke this test even though we didn't see it until websocket addition (which required8cec6694ae
to make this test work initially). So make a valid block and then spoil its verification script.
This commit is contained in:
parent
fd72f0635e
commit
7287c01bd0
1 changed files with 2 additions and 1 deletions
|
@ -860,8 +860,9 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) []
|
|||
|
||||
t.Run("submit", func(t *testing.T) {
|
||||
rpc := `{"jsonrpc": "2.0", "id": 1, "method": "submitblock", "params": ["%s"]}`
|
||||
t.Run("empty", func(t *testing.T) {
|
||||
t.Run("invalid signature", func(t *testing.T) {
|
||||
s := newBlock(t, chain, 1)
|
||||
s.Script.VerificationScript[8] ^= 0xff
|
||||
body := doRPCCall(fmt.Sprintf(rpc, encodeBlock(t, s)), httpSrv.URL, t)
|
||||
checkErrGetResult(t, body, true)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue