Skip to content

Commit 6ba81a5

Browse files
authored
fix error parsing on redirected calls (#83)
* fix error parsing on redirected calls * chore(release): v0.0.39
1 parent d4997e8 commit 6ba81a5

10 files changed

Lines changed: 25 additions & 25 deletions

File tree

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
],
55
"npmClient": "yarn",
66
"useWorkspaces": true,
7-
"version": "0.0.38",
7+
"version": "0.0.39",
88
"stream": "true",
99
"command": {
1010
"version": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "root",
33
"private": true,
4-
"version": "0.0.38",
4+
"version": "0.0.39",
55
"engines": {
66
"node": ">=18.0.0"
77
},

packages/api/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api",
3-
"version": "0.0.38",
3+
"version": "0.0.39",
44
"description": "The API module of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",
@@ -35,12 +35,12 @@
3535
"class-transformer": "0.5.1",
3636
"class-validator": "0.14.0",
3737
"ethers": "5.7.2",
38-
"executor": "^0.0.38",
38+
"executor": "^0.0.39",
3939
"fastify": "4.14.1",
4040
"pino": "8.11.0",
4141
"pino-pretty": "10.0.0",
4242
"reflect-metadata": "0.1.13",
43-
"types": "^0.0.38"
43+
"types": "^0.0.39"
4444
},
4545
"devDependencies": {
4646
"@types/connect": "3.4.35"

packages/api/src/app.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,10 @@ export class ApiApp {
138138

139139
if (this.redirectRpc && method in RedirectedRPCMethods) {
140140
const body = await redirectApi.redirect(method, params);
141-
return res.status(200).send({
142-
jsonrpc,
143-
id,
144-
...body,
145-
});
141+
if (body.error) {
142+
return res.status(200).send({ ...body, id });
143+
}
144+
return res.status(200).send({ jsonrpc, id, ...body });
146145
}
147146

148147
if (result === undefined) {

packages/api/src/modules/redirect.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ export class RedirectAPI {
2222

2323
/** NETHERMIND ERROR PARSING */
2424
if (
25-
body.error.data.startsWith("Reverted ") &&
26-
body.error.code == -32015
25+
body.error.data &&
26+
body.error.code == -32015 &&
27+
body.error.data.startsWith("Reverted ")
2728
) {
2829
body.error.code = 3;
2930
body.error.message = "execution reverted";

packages/cli/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cli",
3-
"version": "0.0.38",
3+
"version": "0.0.39",
44
"description": "> TODO: description",
55
"author": "zincoshine <psramanuj@gmail.com>",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",
@@ -31,13 +31,13 @@
3131
"url": "https://https://github.com/etherspot/skandha/issues"
3232
},
3333
"dependencies": {
34-
"api": "^0.0.38",
35-
"db": "^0.0.38",
36-
"executor": "^0.0.38",
34+
"api": "^0.0.39",
35+
"db": "^0.0.39",
36+
"executor": "^0.0.39",
3737
"find-up": "5.0.0",
3838
"got": "12.5.3",
3939
"js-yaml": "4.1.0",
40-
"types": "^0.0.38",
40+
"types": "^0.0.39",
4141
"yargs": "17.6.2"
4242
},
4343
"devDependencies": {

packages/db/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "db",
3-
"version": "0.0.38",
3+
"version": "0.0.39",
44
"description": "The DB module of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://github.com/etherspot/etherspot-bundler#readme",
@@ -37,6 +37,6 @@
3737
"devDependencies": {
3838
"@types/rocksdb": "3.0.1",
3939
"prettier": "^2.8.4",
40-
"types": "^0.0.38"
40+
"types": "^0.0.39"
4141
}
4242
}

packages/executor/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "executor",
3-
"version": "0.0.38",
3+
"version": "0.0.39",
44
"description": "The Relayer module of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",
@@ -33,7 +33,7 @@
3333
"dependencies": {
3434
"async-mutex": "0.4.0",
3535
"ethers": "5.7.2",
36-
"params": "^0.0.38",
37-
"types": "^0.0.38"
36+
"params": "^0.0.39",
37+
"types": "^0.0.39"
3838
}
3939
}

packages/params/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "params",
3-
"version": "0.0.38",
3+
"version": "0.0.39",
44
"description": "Various bundler parameters",
55
"author": "Etherspot",
66
"homepage": "https://github.com/etherspot/skandha#readme",
@@ -25,7 +25,7 @@
2525
"@eth-optimism/sdk": "3.0.0",
2626
"@mantleio/sdk": "0.2.1",
2727
"ethers": "5.7.2",
28-
"types": "^0.0.38"
28+
"types": "^0.0.39"
2929
},
3030
"scripts": {
3131
"clean": "rm -rf lib && rm -f *.tsbuildinfo",

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "types",
3-
"version": "0.0.38",
3+
"version": "0.0.39",
44
"description": "The types of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",

0 commit comments

Comments
 (0)