Skip to content

Commit

Permalink
SEC-334: Implement a debug mode check
Browse files Browse the repository at this point in the history
  • Loading branch information
mgthuramoemyint authored Apr 23, 2024
1 parent 4ba24eb commit 8ac95b9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3014,6 +3014,9 @@ export const methods = {
},
debug_traceTransaction: async function (args: RequestParamsLike, callback: JSONRPCCallbackTypePlain) {
const api_name = 'debug_traceTransaction'
if (!config.isDebugMode) {
callback(null, "Not in the debug mode.")
}
nestedCountersInstance.countEvent('endpoint', api_name)
if (!ensureArrayArgs(args, callback)) {
countFailedResponse(api_name, 'Invalid params: non-array args')
Expand Down Expand Up @@ -3048,6 +3051,9 @@ export const methods = {
},
debug_traceBlockByHash: async function (args: RequestParamsLike, callback: JSONRPCCallbackTypePlain) {
const api_name = 'debug_traceBlockByHash'
if (!config.isDebugMode) {
callback(null, "Not in the debug mode.")
}
nestedCountersInstance.countEvent('endpoint', api_name)
if (!ensureArrayArgs(args, callback)) {
countFailedResponse(api_name, 'Invalid params: non-array args')
Expand Down Expand Up @@ -3118,6 +3124,9 @@ export const methods = {
},
debug_traceBlockByNumber: async function (args: RequestParamsLike, callback: JSONRPCCallbackTypePlain) {
const api_name = 'debug_traceBlockByNumber'
if (!config.isDebugMode) {
callback(null, "Not in the debug mode.")
}
nestedCountersInstance.countEvent('endpoint', api_name)
if (!ensureArrayArgs(args, callback)) {
countFailedResponse(api_name, 'Invalid params: non-array args')
Expand Down Expand Up @@ -3194,6 +3203,9 @@ export const methods = {
},
debug_storageRangeAt: async function (args: RequestParamsLike, callback: JSONRPCCallbackTypePlain) {
const api_name = 'debug_storageRangeAt'
if (!config.isDebugMode) {
callback(null, "Not in the debug mode.")
}
nestedCountersInstance.countEvent('endpoint', api_name)
if (!ensureArrayArgs(args, callback)) {
countFailedResponse(api_name, 'Invalid params: non-array args')
Expand Down Expand Up @@ -3234,6 +3246,9 @@ export const methods = {
},
debug_storageRangeAt2: async function (args: RequestParamsLike, callback: JSONRPCCallbackTypePlain) {
const api_name = 'debug_storageRangeAt2'
if (!config.isDebugMode) {
callback(null, "Not in the debug mode.")
}
nestedCountersInstance.countEvent('endpoint', api_name)
if (!ensureArrayArgs(args, callback)) {
countFailedResponse(api_name, 'Invalid params: non-array args')
Expand Down

0 comments on commit 8ac95b9

Please sign in to comment.