@@ -12,13 +12,12 @@ describe('onRpcRequest', () => {
1212 } ) ;
1313
1414 expect ( response ) . toRespondWithError ( {
15- code : - 32603 ,
16- message : 'Internal JSON-RPC error.' ,
15+ code : - 32601 ,
16+ message : 'The method does not exist / is not available.' ,
17+ stack : expect . any ( String ) ,
1718 data : {
18- cause : {
19- message : 'The method does not exist / is not available.' ,
20- stack : expect . any ( String ) ,
21- } ,
19+ method : 'foo' ,
20+ cause : null ,
2221 } ,
2322 } ) ;
2423
@@ -75,15 +74,10 @@ describe('onRpcRequest', () => {
7574 } ) ;
7675
7776 expect ( response ) . toRespondWithError ( {
78- code : - 32603 ,
79- message : 'Internal JSON-RPC error.' ,
80- data : {
81- cause : {
82- message :
83- 'The requested path is not permitted. Allowed paths must be specified in the snap manifest.' ,
84- stack : expect . any ( String ) ,
85- } ,
86- } ,
77+ code : 4100 ,
78+ message :
79+ 'The requested path is not permitted. Allowed paths must be specified in the snap manifest.' ,
80+ stack : expect . any ( String ) ,
8781 } ) ;
8882
8983 await close ( ) ;
@@ -101,15 +95,10 @@ describe('onRpcRequest', () => {
10195 } ) ;
10296
10397 expect ( response ) . toRespondWithError ( {
104- code : - 32603 ,
105- message : 'Internal JSON-RPC error.' ,
106- data : {
107- cause : {
108- message :
109- 'The requested path is not permitted. Allowed paths must be specified in the snap manifest.' ,
110- stack : expect . any ( String ) ,
111- } ,
112- } ,
98+ code : 4100 ,
99+ message :
100+ 'The requested path is not permitted. Allowed paths must be specified in the snap manifest.' ,
101+ stack : expect . any ( String ) ,
113102 } ) ;
114103
115104 await close ( ) ;
@@ -202,14 +191,9 @@ describe('onRpcRequest', () => {
202191 await ui . cancel ( ) ;
203192
204193 expect ( await response ) . toRespondWithError ( {
205- code : - 32603 ,
206- message : 'Internal JSON-RPC error.' ,
207- data : {
208- cause : {
209- message : 'User rejected the request.' ,
210- stack : expect . any ( String ) ,
211- } ,
212- } ,
194+ code : 4001 ,
195+ message : 'User rejected the request.' ,
196+ stack : expect . any ( String ) ,
213197 } ) ;
214198
215199 await close ( ) ;
0 commit comments