From 77729ac7685854021f5b933d41c478bcc17bc587 Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Mon, 25 Mar 2024 14:45:11 +0000 Subject: [PATCH] update rpc errors --- .../response-incorrect-argument-length.json | 154 +++++++++--------- .../response-incorrect-argument-sort.json | 30 ++-- ..._module_with_unknown_import_fails-001.json | 1 - ...e_with_unknown_named_import_fails-002.json | 1 - .../response-if-then-else-arity-error.json | 16 +- .../response-if-then-else-sort-error.json | 16 +- .../test-subsorts/response-not-subsort.json | 60 +++---- 7 files changed, 148 insertions(+), 130 deletions(-) diff --git a/test/rpc-integration/test-internalise-symbols/response-incorrect-argument-length.json b/test/rpc-integration/test-internalise-symbols/response-incorrect-argument-length.json index 973b959ed..dbbd57a33 100644 --- a/test/rpc-integration/test-internalise-symbols/response-incorrect-argument-length.json +++ b/test/rpc-integration/test-internalise-symbols/response-incorrect-argument-length.json @@ -3,88 +3,92 @@ "id": 1, "error": { "code": 2, - "data": { - "context": [ - { - "tag": "App", - "name": "Lbl'-LT-'generatedTop'-GT-'", - "sorts": [], - "args": [ - { - "tag": "App", - "name": "Lbl'-LT-'k'-GT-'", - "sorts": [], - "args": [ - { - "tag": "App", - "name": "kseq", - "sorts": [], - "args": [ - { - "tag": "App", - "name": "LblisInt", - "sorts": [], - "args": [ - { - "tag": "App", - "name": "inj", - "sorts": [ - { - "tag": "SortApp", - "name": "SortKItem", - "args": [] - }, - { - "tag": "SortApp", - "name": "SortK", - "args": [] - } - ], - "args": [ - { - "tag": "EVar", - "name": "VarX", - "sort": { + "data": [ + { + "term": { + "format": "KORE", + "version": 1, + "term": { + "tag": "App", + "name": "Lbl'-LT-'generatedTop'-GT-'", + "sorts": [], + "args": [ + { + "tag": "App", + "name": "Lbl'-LT-'k'-GT-'", + "sorts": [], + "args": [ + { + "tag": "App", + "name": "kseq", + "sorts": [], + "args": [ + { + "tag": "App", + "name": "LblisInt", + "sorts": [], + "args": [ + { + "tag": "App", + "name": "inj", + "sorts": [ + { "tag": "SortApp", "name": "SortKItem", "args": [] + }, + { + "tag": "SortApp", + "name": "SortK", + "args": [] } - } - ] - } - ] - }, - { - "tag": "App", - "name": "dotk", - "sorts": [], + ], + "args": [ + { + "tag": "EVar", + "name": "VarX", + "sort": { + "tag": "SortApp", + "name": "SortKItem", + "args": [] + } + } + ] + } + ] + }, + { + "tag": "App", + "name": "dotk", + "sorts": [], + "args": [] + } + ] + } + ] + }, + { + "tag": "App", + "name": "Lbl'-LT-'generatedCounter'-GT-'", + "sorts": [], + "args": [ + { + "tag": "EVar", + "name": "VarGENERATEDCOUNTER'Unds'CELL'Unds'c84b0b5f", + "sort": { + "tag": "SortApp", + "name": "SortInt", "args": [] } - ] - } - ] - }, - { - "tag": "App", - "name": "Lbl'-LT-'generatedCounter'-GT-'", - "sorts": [], - "args": [ - { - "tag": "EVar", - "name": "VarGENERATEDCOUNTER'Unds'CELL'Unds'c84b0b5f", - "sort": { - "tag": "SortApp", - "name": "SortInt", - "args": [] } - } - ] - } - ] - } - ], - "error": "Inconsistent pattern. Symbol 'Lbl'-LT-'generatedTop'-GT-'' expected 3 arguments but got 2" - }, + ] + } + ] + } + }, + "error": "Inconsistent pattern. Symbol 'Lbl'-LT-'generatedTop'-GT-'' expected 3 arguments but got 2" + } + ], "message": "Could not verify pattern" } } \ No newline at end of file diff --git a/test/rpc-integration/test-internalise-symbols/response-incorrect-argument-sort.json b/test/rpc-integration/test-internalise-symbols/response-incorrect-argument-sort.json index 010e0586e..ce2876b93 100644 --- a/test/rpc-integration/test-internalise-symbols/response-incorrect-argument-sort.json +++ b/test/rpc-integration/test-internalise-symbols/response-incorrect-argument-sort.json @@ -3,20 +3,24 @@ "id": 1, "error": { "code": 2, - "data": { - "context": [ - { - "tag": "EVar", - "name": "X", - "sort": { - "tag": "SortApp", - "name": "SortBool", - "args": [] + "data": [ + { + "term": { + "format": "KORE", + "version": 1, + "term": { + "tag": "EVar", + "name": "X", + "sort": { + "tag": "SortApp", + "name": "SortBool", + "args": [] + } } - } - ], - "error": "Incorrect sort: expected SortInt{} but got SortBool{}" - }, + }, + "error": "Incorrect sort: expected SortInt{} but got SortBool{}" + } + ], "message": "Could not verify pattern" } } \ No newline at end of file diff --git a/test/rpc-integration/test-pathological-add-module/response-add_module_with_unknown_import_fails-001.json b/test/rpc-integration/test-pathological-add-module/response-add_module_with_unknown_import_fails-001.json index deae476eb..952fad8f4 100644 --- a/test/rpc-integration/test-pathological-add-module/response-add_module_with_unknown_import_fails-001.json +++ b/test/rpc-integration/test-pathological-add-module/response-add_module_with_unknown_import_fails-001.json @@ -4,7 +4,6 @@ "error": { "code": 8, "data": { - "context": null, "error": "Module UNKNOWN not found." }, "message": "Invalid module" diff --git a/test/rpc-integration/test-pathological-add-module/response-add_module_with_unknown_named_import_fails-002.json b/test/rpc-integration/test-pathological-add-module/response-add_module_with_unknown_named_import_fails-002.json index 215bdf12b..6c9d9bf13 100644 --- a/test/rpc-integration/test-pathological-add-module/response-add_module_with_unknown_named_import_fails-002.json +++ b/test/rpc-integration/test-pathological-add-module/response-add_module_with_unknown_named_import_fails-002.json @@ -4,7 +4,6 @@ "error": { "code": 8, "data": { - "context": null, "error": "Module UNKNOWN not found." }, "message": "Invalid module" diff --git a/test/rpc-integration/test-simplify/response-if-then-else-arity-error.json b/test/rpc-integration/test-simplify/response-if-then-else-arity-error.json index 166fe5655..9fe0fcd8c 100644 --- a/test/rpc-integration/test-simplify/response-if-then-else-arity-error.json +++ b/test/rpc-integration/test-simplify/response-if-then-else-arity-error.json @@ -5,8 +5,10 @@ "code": 2, "data": [ { - "context": [ - { + "term": { + "format": "KORE", + "version": 1, + "term": { "tag": "App", "name": "inj", "sorts": [ @@ -55,12 +57,14 @@ } ] } - ], + }, "error": "Expected a predicate but found a term" }, { - "context": [ - { + "term": { + "format": "KORE", + "version": 1, + "term": { "tag": "App", "name": "Lblite", "sorts": [ @@ -91,7 +95,7 @@ } ] } - ], + }, "error": "Inconsistent pattern. Symbol 'Lblite' expected 3 arguments but got 2" } ], diff --git a/test/rpc-integration/test-simplify/response-if-then-else-sort-error.json b/test/rpc-integration/test-simplify/response-if-then-else-sort-error.json index d7d54aa76..933abbfba 100644 --- a/test/rpc-integration/test-simplify/response-if-then-else-sort-error.json +++ b/test/rpc-integration/test-simplify/response-if-then-else-sort-error.json @@ -5,8 +5,10 @@ "code": 2, "data": [ { - "context": [ - { + "term": { + "format": "KORE", + "version": 1, + "term": { "tag": "App", "name": "inj", "sorts": [ @@ -64,12 +66,14 @@ } ] } - ], + }, "error": "Expected a predicate but found a term" }, { - "context": [ - { + "term": { + "format": "KORE", + "version": 1, + "term": { "tag": "DV", "sort": { "tag": "SortApp", @@ -78,7 +82,7 @@ }, "value": "42" } - ], + }, "error": "Incorrect sort: expected SortBool{} but got SortInt{}" } ], diff --git a/test/rpc-integration/test-subsorts/response-not-subsort.json b/test/rpc-integration/test-subsorts/response-not-subsort.json index 01a0696f4..cccbede6a 100644 --- a/test/rpc-integration/test-subsorts/response-not-subsort.json +++ b/test/rpc-integration/test-subsorts/response-not-subsort.json @@ -3,38 +3,42 @@ "id": 1, "error": { "code": 2, - "data": { - "context": [ - { - "tag": "App", - "name": "inj", - "sorts": [ - { - "tag": "SortApp", - "name": "SortKItem", - "args": [] - }, - { - "tag": "SortApp", - "name": "SortK", - "args": [] - } - ], - "args": [ - { - "tag": "EVar", - "name": "VarX", - "sort": { + "data": [ + { + "term": { + "format": "KORE", + "version": 1, + "term": { + "tag": "App", + "name": "inj", + "sorts": [ + { "tag": "SortApp", "name": "SortKItem", "args": [] + }, + { + "tag": "SortApp", + "name": "SortK", + "args": [] + } + ], + "args": [ + { + "tag": "EVar", + "name": "VarX", + "sort": { + "tag": "SortApp", + "name": "SortKItem", + "args": [] + } } - } - ] - } - ], - "error": "SortKItem{} is not a subsort of SortK{}" - }, + ] + } + }, + "error": "SortKItem{} is not a subsort of SortK{}" + } + ], "message": "Could not verify pattern" } } \ No newline at end of file