From a1cad19e1a5f07081ab9243f464850eb620134c2 Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Sat, 13 Apr 2019 21:29:07 +0530 Subject: [PATCH 01/13] debug-method initial commit --- packages/web3-core-method/src/index.js | 28 ++ .../src/methods/debug/BackTraceAtMethod.js | 36 ++ .../src/methods/debug/BlockProfileMethod.js | 36 ++ .../src/methods/debug/CpuProfileMethod.js | 36 ++ .../src/methods/debug/DumpBlockMethod.js | 36 ++ .../src/methods/debug/GcStatsMethod.js | 36 ++ .../src/methods/debug/GetBlockRlpMethod.js | 36 ++ .../src/methods/debug/GoTraceMethod.js | 36 ++ .../src/methods/debug/MemStatsMethod.js | 36 ++ .../src/methods/debug/SeedHashMethod.js | 36 ++ .../debug/SetBlockProfileRateMethod.js | 36 ++ .../src/methods/debug/SetHeadMethod.js | 36 ++ .../src/methods/debug/StacksMethod.js | 36 ++ .../methods/debug/StartCpuProfileMethod.js | 36 ++ .../src/methods/debug/StartGoTraceMethod.js | 36 ++ .../src/methods/debug/StopCpuProfileMethod.js | 36 ++ .../src/methods/debug/StopGoTraceMethod.js | 36 ++ .../methods/debug/TraceBlockByHashMethod.js | 36 ++ .../methods/debug/TraceBlockByNumberMethod.js | 36 ++ .../methods/debug/TraceBlockFromFileMethod.js | 36 ++ .../src/methods/debug/TraceBlockMethod.js | 36 ++ .../methods/debug/TraceTransactionMethod.js | 36 ++ .../src/methods/debug/VerbosityMethod.js | 36 ++ .../src/methods/debug/VmoduleMethod.js | 36 ++ .../methods/debug/WriteBlockProfileMethod.js | 36 ++ .../methods/debug/WriteMemProfileMethod.js | 36 ++ .../methods/debug/BackTraceAtMethodTest.js | 29 ++ .../methods/debug/BlockProfileMethodTest.js | 29 ++ .../src/methods/debug/CpuProfileMethodTes.js | 29 ++ .../src/methods/debug/DumpBlockMethodTest.js | 29 ++ .../src/methods/debug/GcStatsMethodTest.js | 29 ++ .../methods/debug/GetBlockRlpMethodTest.js | 29 ++ .../src/methods/debug/GoTraceMethodTest.js | 29 ++ .../src/methods/debug/MemStatsMethodTest.js | 29 ++ .../src/methods/debug/SeedHashMethodTest.js | 29 ++ .../debug/SetBlockProfileRateMethodTest.js | 29 ++ .../src/methods/debug/SetHeadMethodTest.js | 29 ++ .../src/methods/debug/StacksMethodTest.js | 29 ++ .../debug/StartCpuProfileMethodTest.js | 29 ++ .../methods/debug/StartGoTraceMethodTest.js | 29 ++ .../methods/debug/StopCpuProfileMethodTest.js | 29 ++ .../methods/debug/StopGoTraceMethodTest.js | 29 ++ .../debug/TraceBlockByHashMethodTest.js | 29 ++ .../debug/TraceBlockByNumberMethodTest.js | 29 ++ .../debug/TraceBlockFromFileMethodTest.js | 29 ++ .../src/methods/debug/TraceBlockMethodTest.js | 29 ++ .../debug/TraceTransactionMethodTest.js | 29 ++ .../src/methods/debug/VerbosityMethodTest.js | 29 ++ .../src/methods/debug/VmoduleMethodTest.js | 29 ++ .../debug/WriteBlockProfileMethodTest.js | 29 ++ .../debug/WriteMemProfileMethodTest.js | 29 ++ packages/web3-eth-debug/README.md | 31 ++ packages/web3-eth-debug/jest.config.js | 3 + packages/web3-eth-debug/package-lock.json | 440 ++++++++++++++++++ packages/web3-eth-debug/package.json | 37 ++ packages/web3-eth-debug/rollup.config.js | 4 + packages/web3-eth-debug/src/Debug.js | 220 +++++++++ .../src/factories/MethodFactory.js | 90 ++++ packages/web3-eth-debug/src/index.js | 53 +++ .../web3-eth-debug/tests/src/DebugTest.js | 107 +++++ .../tests/src/factories/MethodFactoryTest.js | 82 ++++ packages/web3-eth-debug/types/index.d.ts | 156 +++++++ .../web3-eth-debug/types/tests/debug-tests.ts | 191 ++++++++ packages/web3-eth-debug/types/tsconfig.json | 17 + packages/web3-eth-debug/types/tslint.json | 10 + packages/web3-eth-personal/package-lock.json | 2 +- 66 files changed, 3095 insertions(+), 1 deletion(-) create mode 100644 packages/web3-core-method/src/methods/debug/BackTraceAtMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/BlockProfileMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/CpuProfileMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/DumpBlockMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/GcStatsMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/GetBlockRlpMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/GoTraceMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/MemStatsMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/SeedHashMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/SetBlockProfileRateMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/SetHeadMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/StacksMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/StartCpuProfileMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/StartGoTraceMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/StopCpuProfileMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/StopGoTraceMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/TraceBlockByHashMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/TraceBlockByNumberMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/TraceBlockFromFileMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/TraceBlockMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/TraceTransactionMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/VerbosityMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/VmoduleMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/WriteBlockProfileMethod.js create mode 100644 packages/web3-core-method/src/methods/debug/WriteMemProfileMethod.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/BackTraceAtMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/BlockProfileMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/CpuProfileMethodTes.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/DumpBlockMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/GcStatsMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/GetBlockRlpMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/GoTraceMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/MemStatsMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/SeedHashMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/SetBlockProfileRateMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/SetHeadMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/StacksMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/StartCpuProfileMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/StartGoTraceMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/StopCpuProfileMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/StopGoTraceMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/TraceBlockByHashMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/TraceBlockByNumberMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/TraceBlockFromFileMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/TraceBlockMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/TraceTransactionMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/VerbosityMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/VmoduleMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/WriteBlockProfileMethodTest.js create mode 100644 packages/web3-core-method/tests/src/methods/debug/WriteMemProfileMethodTest.js create mode 100644 packages/web3-eth-debug/README.md create mode 100644 packages/web3-eth-debug/jest.config.js create mode 100644 packages/web3-eth-debug/package-lock.json create mode 100644 packages/web3-eth-debug/package.json create mode 100644 packages/web3-eth-debug/rollup.config.js create mode 100644 packages/web3-eth-debug/src/Debug.js create mode 100644 packages/web3-eth-debug/src/factories/MethodFactory.js create mode 100644 packages/web3-eth-debug/src/index.js create mode 100644 packages/web3-eth-debug/tests/src/DebugTest.js create mode 100644 packages/web3-eth-debug/tests/src/factories/MethodFactoryTest.js create mode 100644 packages/web3-eth-debug/types/index.d.ts create mode 100644 packages/web3-eth-debug/types/tests/debug-tests.ts create mode 100644 packages/web3-eth-debug/types/tsconfig.json create mode 100644 packages/web3-eth-debug/types/tslint.json diff --git a/packages/web3-core-method/src/index.js b/packages/web3-core-method/src/index.js index 9736f75828d..68fa4c28594 100644 --- a/packages/web3-core-method/src/index.js +++ b/packages/web3-core-method/src/index.js @@ -17,6 +17,7 @@ /** * @file index.js * @author Samuel Furter + * @author Prince Sinha * @date 2018 */ @@ -118,3 +119,30 @@ export PostMethod from './methods/shh/PostMethod'; export SetMaxMessageSizeMethod from './methods/shh/SetMaxMessageSizeMethod'; export SetMinPoWMethod from './methods/shh/SetMinPoWMethod'; export ShhVersionMethod from './methods/shh/ShhVersionMethod'; + +// Debug +export BackTraceAtMethod from './methods/debug/BackTraceAtMethod'; +export BlockProfileMethod from './methods/debug/BlockProfileMethod'; +export CpuProfileMethod from './methods/debug/CpuProfileMethod'; +export DumpBlockMethod from './methods/debug/DumpBlockMethod'; +export GcStatsMethod from './methods/debug/GcStatsMethod'; +export GetBlockRlpMethod from './methods/debug/GetBlockRlpMethod'; +export GoTraceMethod from './methods/debug/GoTraceMethod'; +export MemStatsMethod from './methods/debug/MemStatsMethod'; +export SeedHashMethod from './methods/debug/SeedHashMethod'; +export SetBlockProfileRateMethod from './methods/debug/SetBlockProfileRateMethod'; +export SetHeadMethod from './methods/debug/SetHeadMethod'; +export StacksMethod from './methods/debug/StacksMethod'; +export StartCpuProfileMethod from './methods/debug/StartCpuProfileMethod'; +export StartGoTraceMethod from './methods/debug/StartGoTraceMethod'; +export StopCpuProfileMethod from './methods/debug/StopCpuProfileMethod'; +export StopGoTraceMethod from './methods/debug/StopGoTraceMethod'; +export TraceBlockByHashMethod from './methods/debug/TraceBlockByHashMethod'; +export TraceBlockByNumberMethod from './methods/debug/TraceBlockByNumberMethod'; +export TraceBlockFromFileMethod from './methods/debug/TraceBlockFromFileMethod'; +export TraceBlockMethod from './methods/debug/TraceBlockMethod'; +export TraceTransactionMethod from './methods/debug/TraceTransactionMethod'; +export VerbosityMethod from './methods/debug/VerbosityMethod'; +export VmoduleMethod from './methods/debug/VmoduleMethod'; +export WriteBlockProfileMethod from './methods/debug/WriteBlockProfileMethod'; +export WriteMemProfileMethod from './methods/debug/WriteMemProfileMethod'; diff --git a/packages/web3-core-method/src/methods/debug/BackTraceAtMethod.js b/packages/web3-core-method/src/methods/debug/BackTraceAtMethod.js new file mode 100644 index 00000000000..0a4dafbcb41 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/BackTraceAtMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file BackTraceAtMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class BackTraceAtMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_backtraceAt', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/BlockProfileMethod.js b/packages/web3-core-method/src/methods/debug/BlockProfileMethod.js new file mode 100644 index 00000000000..56fa838f2f7 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/BlockProfileMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file BlockProfileMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class BlockProfileMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_blockProfile', 2, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/CpuProfileMethod.js b/packages/web3-core-method/src/methods/debug/CpuProfileMethod.js new file mode 100644 index 00000000000..1bc005a80f2 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/CpuProfileMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file CpuProfileMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class CpuProfileMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_cpuProfile', 2, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/DumpBlockMethod.js b/packages/web3-core-method/src/methods/debug/DumpBlockMethod.js new file mode 100644 index 00000000000..56aabf672f4 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/DumpBlockMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file DumpBlockMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class DumpBlockMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_dumpBlock', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/GcStatsMethod.js b/packages/web3-core-method/src/methods/debug/GcStatsMethod.js new file mode 100644 index 00000000000..49f1fb7ce44 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/GcStatsMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file GcStatsMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class GcStatsMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_gcStats', 0, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/GetBlockRlpMethod.js b/packages/web3-core-method/src/methods/debug/GetBlockRlpMethod.js new file mode 100644 index 00000000000..148ff0adc4d --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/GetBlockRlpMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file GetBlockRlpMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class GetBlockRlpMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_gcBlockRlp', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/GoTraceMethod.js b/packages/web3-core-method/src/methods/debug/GoTraceMethod.js new file mode 100644 index 00000000000..e21d53aa2d2 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/GoTraceMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file GoTraceMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class GoTraceMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_goTrace', 2, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/MemStatsMethod.js b/packages/web3-core-method/src/methods/debug/MemStatsMethod.js new file mode 100644 index 00000000000..787ac914463 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/MemStatsMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file MemStatsMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class MemStatsMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_memStats', 0, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/SeedHashMethod.js b/packages/web3-core-method/src/methods/debug/SeedHashMethod.js new file mode 100644 index 00000000000..7ea25ba7b7e --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/SeedHashMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file SeedHashMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class SeedHashMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_seedHash', 0, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/SetBlockProfileRateMethod.js b/packages/web3-core-method/src/methods/debug/SetBlockProfileRateMethod.js new file mode 100644 index 00000000000..b42e9580936 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/SetBlockProfileRateMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file SetBlockProfileRateMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class SetBlockProfileRateMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_setBlockProfileRate', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/SetHeadMethod.js b/packages/web3-core-method/src/methods/debug/SetHeadMethod.js new file mode 100644 index 00000000000..1d3cc9853ff --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/SetHeadMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file SetHeadMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class SetHeadMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_SetHead', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/StacksMethod.js b/packages/web3-core-method/src/methods/debug/StacksMethod.js new file mode 100644 index 00000000000..57ed7ddb316 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/StacksMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file StacksMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class StacksMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_stacks', 0, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/StartCpuProfileMethod.js b/packages/web3-core-method/src/methods/debug/StartCpuProfileMethod.js new file mode 100644 index 00000000000..190ccd12137 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/StartCpuProfileMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file StartCpuProfileMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class StartCpuProfileMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_startCPUProfile', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/StartGoTraceMethod.js b/packages/web3-core-method/src/methods/debug/StartGoTraceMethod.js new file mode 100644 index 00000000000..73e6d76d66d --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/StartGoTraceMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file StartGoTraceMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class StartGoTraceMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_startGoTrace', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/StopCpuProfileMethod.js b/packages/web3-core-method/src/methods/debug/StopCpuProfileMethod.js new file mode 100644 index 00000000000..54fe5ad5795 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/StopCpuProfileMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file StopCpuProfileMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class StopCpuProfileMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_stopCPUProfile', 0, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/StopGoTraceMethod.js b/packages/web3-core-method/src/methods/debug/StopGoTraceMethod.js new file mode 100644 index 00000000000..6aed2cc8989 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/StopGoTraceMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file StopGoTraceMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class StopGoTraceMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_stopGoTrace', 0, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/TraceBlockByHashMethod.js b/packages/web3-core-method/src/methods/debug/TraceBlockByHashMethod.js new file mode 100644 index 00000000000..72b0b7fe4e1 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/TraceBlockByHashMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file TraceBlockByHashMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class TraceBlockByHashMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_traceBlockByHash', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/TraceBlockByNumberMethod.js b/packages/web3-core-method/src/methods/debug/TraceBlockByNumberMethod.js new file mode 100644 index 00000000000..7b995f29063 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/TraceBlockByNumberMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file TraceBlockByNumberMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class TraceBlockByNumberMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_traceBlockByNumber', 2, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/TraceBlockFromFileMethod.js b/packages/web3-core-method/src/methods/debug/TraceBlockFromFileMethod.js new file mode 100644 index 00000000000..6c749b9c47d --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/TraceBlockFromFileMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file TraceBlockFromFileMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class TraceBlockFromFileMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_traceBlockFromFile', 2, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/TraceBlockMethod.js b/packages/web3-core-method/src/methods/debug/TraceBlockMethod.js new file mode 100644 index 00000000000..87cad69c54d --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/TraceBlockMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file TraceBlockMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class TraceBlockMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_traceBlock', 2, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/TraceTransactionMethod.js b/packages/web3-core-method/src/methods/debug/TraceTransactionMethod.js new file mode 100644 index 00000000000..baffb067cf3 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/TraceTransactionMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file TraceTransactionMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class TraceTransactionMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_traceTransaction', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/VerbosityMethod.js b/packages/web3-core-method/src/methods/debug/VerbosityMethod.js new file mode 100644 index 00000000000..e3877e8c537 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/VerbosityMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file VerbosityMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class VerbosityMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_vebosity', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/VmoduleMethod.js b/packages/web3-core-method/src/methods/debug/VmoduleMethod.js new file mode 100644 index 00000000000..646c1fab0fd --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/VmoduleMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file VmoduleMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class VmoduleMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_vmodule', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/WriteBlockProfileMethod.js b/packages/web3-core-method/src/methods/debug/WriteBlockProfileMethod.js new file mode 100644 index 00000000000..3d071fa5cc8 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/WriteBlockProfileMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file WriteBlockProfileMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class WriteBlockProfileMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_writeBlockProfile', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/src/methods/debug/WriteMemProfileMethod.js b/packages/web3-core-method/src/methods/debug/WriteMemProfileMethod.js new file mode 100644 index 00000000000..a0ac2af9194 --- /dev/null +++ b/packages/web3-core-method/src/methods/debug/WriteMemProfileMethod.js @@ -0,0 +1,36 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file WriteMemProfileMethod.js + * @author Prince Sinha + * @date 2019 + */ + +import AbstractMethod from '../../../lib/methods/AbstractMethod'; + +export default class WriteMemProfileMethod extends AbstractMethod { + /** + * @param {Utils} utils + * @param {Object} formatters + * @param {AbstractWeb3Module} moduleInstance + * + * @constructor + */ + constructor(utils, formatters, moduleInstance) { + super('debug_writeMemProfile', 1, utils, formatters, moduleInstance); + } +} diff --git a/packages/web3-core-method/tests/src/methods/debug/BackTraceAtMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/BackTraceAtMethodTest.js new file mode 100644 index 00000000000..03bfcded09b --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/BackTraceAtMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import BackTraceAtMethod from '../../../../src/methods/debug/BackTraceAtMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * BackTraceAtMethod test + */ +describe('BackTraceAtMethodTest', () => { + let method; + + beforeEach(() => { + method = new BackTraceAtMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_backtraceAt'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/BlockProfileMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/BlockProfileMethodTest.js new file mode 100644 index 00000000000..d02d07ff80b --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/BlockProfileMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import BlockProfileMethod from '../../../../src/methods/debug/BlockProfileMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * BlockProfileMethod test + */ +describe('BlockProfileMethodTest', () => { + let method; + + beforeEach(() => { + method = new BlockProfileMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_blockProfile'); + + expect(method.parametersAmount).toEqual(2); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/CpuProfileMethodTes.js b/packages/web3-core-method/tests/src/methods/debug/CpuProfileMethodTes.js new file mode 100644 index 00000000000..2548fb3c391 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/CpuProfileMethodTes.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import CpuProfileMethod from '../../../../src/methods/debug/CpuProfileMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * CpuProfileMethod test + */ +describe('CpuProfileMethodTest', () => { + let method; + + beforeEach(() => { + method = new CpuProfileMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_cpuProfile'); + + expect(method.parametersAmount).toEqual(2); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/DumpBlockMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/DumpBlockMethodTest.js new file mode 100644 index 00000000000..2c5ada3cd54 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/DumpBlockMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import DumpBlockMethod from '../../../../src/methods/debug/DumpBlockMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * DumpBlockMethod test + */ +describe('DumpBlockMethodTest', () => { + let method; + + beforeEach(() => { + method = new DumpBlockMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_dumpBlock'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/GcStatsMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/GcStatsMethodTest.js new file mode 100644 index 00000000000..891e82bd91f --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/GcStatsMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import GcStatsMethod from '../../../../src/methods/debug/GcStatsMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * GcStatsMethod test + */ +describe('GcStatsMethodTest', () => { + let method; + + beforeEach(() => { + method = new GcStatsMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_gcStats'); + + expect(method.parametersAmount).toEqual(0); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/GetBlockRlpMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/GetBlockRlpMethodTest.js new file mode 100644 index 00000000000..37ecad1983b --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/GetBlockRlpMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import GetBlockRlpMethod from '../../../../src/methods/debug/GetBlockRlpMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * GetBlockRlpMethod test + */ +describe('GetBlockRlpMethodTest', () => { + let method; + + beforeEach(() => { + method = new GetBlockRlpMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_getBlockRlp'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/GoTraceMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/GoTraceMethodTest.js new file mode 100644 index 00000000000..4392326a45f --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/GoTraceMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import GoTraceMethod from '../../../../src/methods/debug/GoTraceMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * GoTraceMethod test + */ +describe('GoTraceMethodTest', () => { + let method; + + beforeEach(() => { + method = new GoTraceMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_goTrace'); + + expect(method.parametersAmount).toEqual(2); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/MemStatsMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/MemStatsMethodTest.js new file mode 100644 index 00000000000..4f4c8d6598f --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/MemStatsMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import MemStatsMethod from '../../../../src/methods/debug/MemStatsMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * MemStatsMethod test + */ +describe('MemStatsMethodTest', () => { + let method; + + beforeEach(() => { + method = new MemStatsMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_memStats'); + + expect(method.parametersAmount).toEqual(0); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/SeedHashMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/SeedHashMethodTest.js new file mode 100644 index 00000000000..b4fd8842fff --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/SeedHashMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import SeedHashMethod from '../../../../src/methods/debug/SeedHashMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * SeedHashMethod test + */ +describe('SeedHashMethodTest', () => { + let method; + + beforeEach(() => { + method = new SeedHashMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_seedHash'); + + expect(method.parametersAmount).toEqual(0); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/SetBlockProfileRateMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/SetBlockProfileRateMethodTest.js new file mode 100644 index 00000000000..8a1eee8a624 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/SetBlockProfileRateMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import SetBlockProfileRateMethod from '../../../../src/methods/debug/SetBlockProfileRateMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * SetBlockProfileRateMethod test + */ +describe('SetBlockProfileRateMethodTest', () => { + let method; + + beforeEach(() => { + method = new SetBlockProfileRateMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_setBlockProfileRate'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/SetHeadMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/SetHeadMethodTest.js new file mode 100644 index 00000000000..f02e0dec677 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/SetHeadMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import SetHeadMethod from '../../../../src/methods/debug/SetHeadMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * SetHeadMethod test + */ +describe('SetHeadMethodTest', () => { + let method; + + beforeEach(() => { + method = new SetHeadMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_setHead'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/StacksMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/StacksMethodTest.js new file mode 100644 index 00000000000..72316f602a4 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/StacksMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import StacksMethod from '../../../../src/methods/debug/StacksMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * StacksMethod test + */ +describe('StacksMethodTest', () => { + let method; + + beforeEach(() => { + method = new StacksMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_stacks'); + + expect(method.parametersAmount).toEqual(0); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/StartCpuProfileMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/StartCpuProfileMethodTest.js new file mode 100644 index 00000000000..a7c085a6440 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/StartCpuProfileMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import StartCpuProfileMethod from '../../../../src/methods/debug/StartCpuProfileMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * StartCpuProfileMethod test + */ +describe('StartCpuProfileMethodTest', () => { + let method; + + beforeEach(() => { + method = new StartCpuProfileMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_startCPUProfile'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/StartGoTraceMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/StartGoTraceMethodTest.js new file mode 100644 index 00000000000..520e4f7e461 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/StartGoTraceMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import StartGoTraceMethod from '../../../../src/methods/debug/StartGoTraceMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * StartGoTraceMethod test + */ +describe('StartGoTraceMethodTest', () => { + let method; + + beforeEach(() => { + method = new StartGoTraceMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_startGoTrace'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/StopCpuProfileMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/StopCpuProfileMethodTest.js new file mode 100644 index 00000000000..8a5f52842bc --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/StopCpuProfileMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import StopCpuProfileMethod from '../../../../src/methods/debug/StopCpuProfileMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * StopCpuProfileMethod test + */ +describe('StopCpuProfileMethodTest', () => { + let method; + + beforeEach(() => { + method = new StopCpuProfileMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_stopCPUProfile'); + + expect(method.parametersAmount).toEqual(0); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/StopGoTraceMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/StopGoTraceMethodTest.js new file mode 100644 index 00000000000..f28f6517937 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/StopGoTraceMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import StopGoTraceMethod from '../../../../src/methods/debug/StopGoTraceMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * StopGoTraceMethod test + */ +describe('StopGoTraceMethodTest', () => { + let method; + + beforeEach(() => { + method = new StopGoTraceMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_stopGoTrace'); + + expect(method.parametersAmount).toEqual(0); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/TraceBlockByHashMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/TraceBlockByHashMethodTest.js new file mode 100644 index 00000000000..68d49bd296a --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/TraceBlockByHashMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import TraceBlockByHashMethod from '../../../../src/methods/debug/TraceBlockByHashMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * TraceBlockByHashMethod test + */ +describe('TraceBlockByHashMethodTest', () => { + let method; + + beforeEach(() => { + method = new TraceBlockByHashMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_traceBlockByHash'); + + expect(method.parametersAmount).toEqual(2); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/TraceBlockByNumberMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/TraceBlockByNumberMethodTest.js new file mode 100644 index 00000000000..858724ef2f2 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/TraceBlockByNumberMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import TraceBlockByNumberMethod from '../../../../src/methods/debug/TraceBlockByNumberMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * TraceBlockByNumberMethod test + */ +describe('TraceBlockByNumberMethodTest', () => { + let method; + + beforeEach(() => { + method = new TraceBlockByNumberMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_traceBlockByNumber'); + + expect(method.parametersAmount).toEqual(2); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/TraceBlockFromFileMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/TraceBlockFromFileMethodTest.js new file mode 100644 index 00000000000..552bf7bd81f --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/TraceBlockFromFileMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import TraceBlockFromFileMethod from '../../../../src/methods/debug/TraceBlockFromFileMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * TraceBlockFromFileMethod test + */ +describe('TraceBlockFromFileMethodTest', () => { + let method; + + beforeEach(() => { + method = new TraceBlockFromFileMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_traceBlockFromFile'); + + expect(method.parametersAmount).toEqual(2); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/TraceBlockMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/TraceBlockMethodTest.js new file mode 100644 index 00000000000..a2e04316804 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/TraceBlockMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import TraceBlockMethod from '../../../../src/methods/debug/TraceBlockMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * TraceBlockMethod test + */ +describe('TraceBlockMethodTest', () => { + let method; + + beforeEach(() => { + method = new TraceBlockMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_traceBlock'); + + expect(method.parametersAmount).toEqual(2); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/TraceTransactionMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/TraceTransactionMethodTest.js new file mode 100644 index 00000000000..8cf02b6f3c8 --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/TraceTransactionMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import TraceTransactionMethod from '../../../../src/methods/debug/TraceTransactionMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * TraceTransactionMethod test + */ +describe('TraceTransactionMethodTest', () => { + let method; + + beforeEach(() => { + method = new TraceTransactionMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_traceTransaction'); + + expect(method.parametersAmount).toEqual(2); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/VerbosityMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/VerbosityMethodTest.js new file mode 100644 index 00000000000..030bcc6d65b --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/VerbosityMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import VerbosityMethod from '../../../../src/methods/debug/VerbosityMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * VerbosityMethod test + */ +describe('VerbosityMethodTest', () => { + let method; + + beforeEach(() => { + method = new VerbosityMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_verbosity'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/VmoduleMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/VmoduleMethodTest.js new file mode 100644 index 00000000000..bf20418d51d --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/VmoduleMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import VmoduleMethod from '../../../../src/methods/debug/VmoduleMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * VmoduleMethod test + */ +describe('VmoduleMethodTest', () => { + let method; + + beforeEach(() => { + method = new VmoduleMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_vmodule'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/WriteBlockProfileMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/WriteBlockProfileMethodTest.js new file mode 100644 index 00000000000..e0d3b631d3a --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/WriteBlockProfileMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import WriteBlockProfileMethod from '../../../../src/methods/debug/WriteBlockProfileMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * WriteBlockProfileMethod test + */ +describe('WriteBlockProfileMethodTest', () => { + let method; + + beforeEach(() => { + method = new WriteBlockProfileMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_writeBlockProfile'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-core-method/tests/src/methods/debug/WriteMemProfileMethodTest.js b/packages/web3-core-method/tests/src/methods/debug/WriteMemProfileMethodTest.js new file mode 100644 index 00000000000..b57e6f0fbfe --- /dev/null +++ b/packages/web3-core-method/tests/src/methods/debug/WriteMemProfileMethodTest.js @@ -0,0 +1,29 @@ +import {formatters} from 'web3-core-helpers'; +import AbstractMethod from '../../../../lib/methods/AbstractMethod'; +import WriteMemProfileMethod from '../../../../src/methods/debug/WriteMemProfileMethod'; + +// Mocks +jest.mock('web3-core-helpers'); + +/** + * WriteMemProfileMethod test + */ +describe('WriteMemProfileMethodTest', () => { + let method; + + beforeEach(() => { + method = new WriteMemProfileMethod(null, formatters, {}); + }); + + it('constructor check', () => { + expect(method).toBeInstanceOf(AbstractMethod); + + expect(method.rpcMethod).toEqual('debug_writeMemProfile'); + + expect(method.parametersAmount).toEqual(1); + + expect(method.utils).toEqual(null); + + expect(method.formatters).toEqual(formatters); + }); +}); diff --git a/packages/web3-eth-debug/README.md b/packages/web3-eth-debug/README.md new file mode 100644 index 00000000000..a135ceb9744 --- /dev/null +++ b/packages/web3-eth-debug/README.md @@ -0,0 +1,31 @@ +# web3-eth-debug + +This is a sub package of [web3.js][repo] + +This is the debug package to be used in the `web3-eth` package. +Please read the [documentation][docs] for more. + +## Installation + +```bash +npm install web3-eth-debug +``` + +## Usage + +```js +import {Debug} from 'web3-eth-debug'; + +const debug = new Debug( + 'http://127.0.0.1:8546', + null, + options +); +``` + +## Types + +All the typescript typings are placed in the types folder. + +[docs]: http://web3js.readthedocs.io/en/1.0/ +[repo]: https://github.com/ethereum/web3.js diff --git a/packages/web3-eth-debug/jest.config.js b/packages/web3-eth-debug/jest.config.js new file mode 100644 index 00000000000..015e9a3e24d --- /dev/null +++ b/packages/web3-eth-debug/jest.config.js @@ -0,0 +1,3 @@ +const jestConfig = require('../../jest.config'); + +module.exports = jestConfig(); diff --git a/packages/web3-eth-debug/package-lock.json b/packages/web3-eth-debug/package-lock.json new file mode 100644 index 00000000000..2c15581e2d6 --- /dev/null +++ b/packages/web3-eth-debug/package-lock.json @@ -0,0 +1,440 @@ +{ + "name": "web3-eth-debug", + "version": "1.0.0-beta.52", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/runtime": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.1.tgz", + "integrity": "sha512-7jGW8ppV0ant637pIqAcFfQDDH1orEPGJb8aXfUozuCU3QqX7rX4DA8iwrbPrR1hcH0FTTHz47yQnk+bl5xHQA==", + "requires": { + "regenerator-runtime": "^0.12.0" + } + }, + "@types/parsimmon": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@types/parsimmon/-/parsimmon-1.10.0.tgz", + "integrity": "sha512-bsTIJFVQv7jnvNiC42ld2pQW2KRI+pAG243L+iATvqzy3X6+NH1obz2itRKDZZ8VVhN3wjwYax/VBGCcXzgTqQ==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "definitelytyped-header-parser": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/definitelytyped-header-parser/-/definitelytyped-header-parser-1.0.1.tgz", + "integrity": "sha512-dotNYEd/IXw1LftTVKzjbbN/5TzsVhcmFJJi1W/L2IBgS1TaDcv3ZVh9Z8Zr0AFYC2T7OfdBT8vp0iDaUUlTyA==", + "dev": true, + "requires": { + "@types/parsimmon": "^1.3.0", + "parsimmon": "^1.2.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dtslint": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/dtslint/-/dtslint-0.4.2.tgz", + "integrity": "sha512-ph4GXLw3HYzlQMJOFcpCqWHuL3MxJ/344OR7wn0wlQGchQGTIVNsSUl8iKEMatpy2geNMysgA9fQa6xVhHOkTQ==", + "dev": true, + "requires": { + "fs-extra": "^6.0.1", + "strip-json-comments": "^2.0.1", + "tslint": "^5.12.0", + "typescript": "^3.4.0-dev.20190315" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "fs-extra": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", + "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "parsimmon": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.12.0.tgz", + "integrity": "sha512-uC/BjuSfb4jfaWajKCp1mVncXXq+V1twbcYChbTxN3GM7fn+8XoHwUdvUz+PTaFtDSCRQxU8+Rnh+iMhAkVwdw==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + }, + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "tslint": { + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", + "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "typescript": { + "version": "3.4.0-dev.20190315", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.0-dev.20190315.tgz", + "integrity": "sha512-AmAGWYv52Bka/q20YNFy3jRiPMgAmWssti5uLTzFoPyuuzCd/GPmxm+j3iYm22ShrrDJw8biPxVDTq3DnOIaWA==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/packages/web3-eth-debug/package.json b/packages/web3-eth-debug/package.json new file mode 100644 index 00000000000..0b3a73d5d51 --- /dev/null +++ b/packages/web3-eth-debug/package.json @@ -0,0 +1,37 @@ +{ + "name": "web3-eth-debug", + "namespace": "ethereum", + "version": "1.0.0-beta.52", + "description": "Web3 module to interact with the Ethereum blockchain accounts stored in the node.", + "repository": "https://github.com/ethereum/web3.js/tree/1.0/packages/web3-eth-debug", + "license": "LGPL-3.0", + "main": "dist/web3-eth-debug.cjs.js", + "module": "dist/web3-eth-debug.esm.js", + "browser": "dist/web3-eth-debug.umd.js", + "scripts": { + "build": "rollup -c", + "dev": "rollup -c -w", + "test": "jest", + "dtslint": "dtslint types --onlyTestTsNext" + }, + "types": "types/index.d.ts", + "dependencies": { + "@babel/runtime": "^7.3.1", + "web3-core": "1.0.0-beta.52", + "web3-core-helpers": "1.0.0-beta.52", + "web3-core-method": "1.0.0-beta.52", + "web3-net": "1.0.0-beta.52", + "web3-providers": "1.0.0-beta.52", + "web3-utils": "1.0.0-beta.52" + }, + "devDependencies": { + "definitelytyped-header-parser": "^1.0.1", + "dtslint": "0.4.2", + "web3-eth-accounts": "1.0.0-beta.52" + }, + "files": [ + "dist", + "types/index.d.ts" + ], + "gitHead": "1c89f503c90180598910d29892f6ebf92455cfe1" +} diff --git a/packages/web3-eth-debug/rollup.config.js b/packages/web3-eth-debug/rollup.config.js new file mode 100644 index 00000000000..e43c2245ba5 --- /dev/null +++ b/packages/web3-eth-debug/rollup.config.js @@ -0,0 +1,4 @@ +import pkg from './package.json'; +import rollupConfig from '../../rollup.config'; + +export default rollupConfig('Web3EthPersonal', pkg.name); diff --git a/packages/web3-eth-debug/src/Debug.js b/packages/web3-eth-debug/src/Debug.js new file mode 100644 index 00000000000..05b9ea549e4 --- /dev/null +++ b/packages/web3-eth-debug/src/Debug.js @@ -0,0 +1,220 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file index.js + * @author Prince Sinha + * @date 2019 + */ + +import {AbstractWeb3Module} from 'web3-core'; + +export default class Debug extends AbstractWeb3Module { + /** + * TODO: Add missing documentation for getAccounts, lockAccount and sendTransaction! + * @param {Web3EthereumProvider|HttpProvider|WebsocketProvider|IpcProvider|String} provider + * @param {MethodFactory} methodFactory + * @param {Network} net + * @param {Utils} utils + * @param {Object} formatters + * @param {Object} options + * @param {Net.Socket} nodeNet + * + * @constructor + */ + constructor(provider, methodFactory, net, utils, formatters, options, nodeNet) { + super(provider, options, methodFactory, nodeNet); + + this.utils = utils; + this.formatters = formatters; + this.net = net; + } + + /** + * Extends setProvider method from AbstractWeb3Module. + * + * @method setProvider + * + * @param {Object|String} provider + * @param {Net} net + * + * @returns {Boolean} + */ + setProvider(provider, net) { + return !!(super.setProvider(provider, net) && this.net.setProvider(provider, net)); + } + + /** + * Sets the defaultGasPrice property on the current object and the network module + * + * @property defaultGasPrice + * + * @param {String} value + */ + set defaultGasPrice(value) { + super.defaultGasPrice = value; + this.net.defaultGasPrice = value; + } + + /** + * Gets the defaultGasPrice property + * + * @property defaultGasPrice + * + * @returns {String|Number} value + */ + get defaultGasPrice() { + return super.defaultGasPrice; + } + + /** + * Sets the defaultGas property on the current object and the network module + * + * @property defaultGas + * + * @param {Number} value + */ + set defaultGas(value) { + super.defaultGas = value; + this.net.defaultGas = value; + } + + /** + * Gets the defaultGas property + * + * @property defaultGas + * + * @returns {String|Number} value + */ + get defaultGas() { + return super.defaultGas; + } + + /** + * Sets the transactionBlockTimeout property on the current object and the network module + * + * @property transactionBlockTimeout + * + * @param {Number} value + */ + set transactionBlockTimeout(value) { + super.transactionBlockTimeout = value; + this.net.transactionBlockTimeout = value; + } + + /** + * Gets the transactionBlockTimeout property + * + * @property transactionBlockTimeout + * + * @returns {Number} value + */ + get transactionBlockTimeout() { + return super.transactionBlockTimeout; + } + + /** + * Sets the transactionConfirmationBlocks property on the current object and the network module + * + * @property transactionConfirmationBlocks + * + * @param {Number} value + */ + set transactionConfirmationBlocks(value) { + super.transactionConfirmationBlocks = value; + this.net.transactionConfirmationBlocks = value; + } + + /** + * Gets the transactionConfirmationBlocks property + * + * @property transactionConfirmationBlocks + * + * @returns {Number} value + */ + get transactionConfirmationBlocks() { + return super.transactionConfirmationBlocks; + } + + /** + * Sets the transactionPollingTimeout property on the current object and the network module + * + * @property transactionPollingTimeout + * + * @param {Number} value + */ + set transactionPollingTimeout(value) { + super.transactionPollingTimeout = value; + this.net.transactionPollingTimeout = value; + } + + /** + * Gets the transactionPollingTimeout property + * + * @property transactionPollingTimeout + * + * @returns {Number} value + */ + get transactionPollingTimeout() { + return super.transactionPollingTimeout; + } + + /** + * Sets the defaultAccount property on the current object and the network module + * + * @property defaultAccount + * + * @param {String} value + */ + set defaultAccount(value) { + super.defaultAccount = value; + this.net.defaultAccount = value; + } + + /** + * Gets the defaultAccount property + * + * @property defaultAccount + * + * @returns {String} value + */ + get defaultAccount() { + return super.defaultAccount; + } + + /** + * Sets the defaultBlock property on the current object and the network module + * + * @property defaultBlock + * + * @param value + */ + set defaultBlock(value) { + super.defaultBlock = value; + this.net.defaultBlock = value; + } + + /** + * Gets the defaultBlock property + * + * @property defaultBlock + * + * @returns {String|Number} value + */ + get defaultBlock() { + return super.defaultBlock; + } +} diff --git a/packages/web3-eth-debug/src/factories/MethodFactory.js b/packages/web3-eth-debug/src/factories/MethodFactory.js new file mode 100644 index 00000000000..bceaf194754 --- /dev/null +++ b/packages/web3-eth-debug/src/factories/MethodFactory.js @@ -0,0 +1,90 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file MethodFactory.js + * @author Prince Sinha + * @date 2019 + */ + +import { + AbstractMethodFactory, + BackTraceAtMethod, + BlockProfileMethod, + CpuProfileMethod, + DumpBlockMethod, + GcStatsMethod, + GetBlockRlpMethod, + GoTraceMethod, + MemStatsMethod, + SeedHashMethod, + SetBlockProfileRateMethod, + SetHeadMethod, + StacksMethod, + StartCpuProfileMethod, + StartGoTraceMethod, + StopCpuProfileMethod, + StopGoTraceMethod, + TraceBlockByHashMethod, + TraceBlockByNumberMethod, + TraceBlockFromFileMethod, + TraceBlockMethod, + TraceTransactionMethod, + VerbosityMethod, + VmoduleMethod, + WriteBlockProfileMethod, + WriteMemProfileMethod +} from 'web3-core-method'; + +export default class MethodFactory extends AbstractMethodFactory { + /** + * @param {Utils} utils + * @param {Object} formatters + * + * @constructor + */ + constructor(utils, formatters) { + super(utils, formatters); + + this.methods = { + backTraceAt: BackTraceAtMethod, + blockProfile: BlockProfileMethod, + cpuProfile: CpuProfileMethod, + dumpBlock: DumpBlockMethod, + gcStats: GcStatsMethod, + getBlockRlp: GetBlockRlpMethod, + goTrace: GoTraceMethod, + memStats: MemStatsMethod, + seedHash: SeedHashMethod, + setBlockProfileRate: SetBlockProfileRateMethod, + setHead: SetHeadMethod, + stacks: StacksMethod, + startCPUProfile: StartCpuProfileMethod, + startGoTrace: StartGoTraceMethod, + stopCPUProfile: StopCpuProfileMethod, + stopGoTrace: StopGoTraceMethod, + traceBlockByHash: TraceBlockByHashMethod, + traceBlockByNumber: TraceBlockByNumberMethod, + traceBlockFromFile: TraceBlockFromFileMethod, + traceBlock: TraceBlockMethod, + traceTransaction: TraceTransactionMethod, + verbosity: VerbosityMethod, + vmodule: VmoduleMethod, + writeBlockProfile: WriteBlockProfileMethod, + writeMemProfile: WriteMemProfileMethod + }; + } +} diff --git a/packages/web3-eth-debug/src/index.js b/packages/web3-eth-debug/src/index.js new file mode 100644 index 00000000000..c9c510f4665 --- /dev/null +++ b/packages/web3-eth-debug/src/index.js @@ -0,0 +1,53 @@ +/* + This file is part of web3.js. + + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file index.js + * @author Prince Sinha + * @date 2019 + */ + +import {Network} from 'web3-net'; +import * as Utils from 'web3-utils'; +import {formatters} from 'web3-core-helpers'; +import {ProviderResolver} from 'web3-providers'; +import MethodFactory from './factories/MethodFactory'; +import DebugModule from './Debug.js'; + +/** + * Returns the Debug object + * + * @method Debug + * + * @param {Web3EthereumProvider|HttpProvider|WebsocketProvider|IpcProvider|String} provider + * @param {Net.Socket} net + * @param {Object} options + * + * @returns {Debug} + */ +export function Debug(provider, net = null, options = {}) { + const resolvedProvider = new ProviderResolver().resolve(provider, net); + + return new DebugModule( + resolvedProvider, + new MethodFactory(Utils, formatters), + new Network(resolvedProvider, null, options), + Utils, + formatters, + options, + null + ); +} diff --git a/packages/web3-eth-debug/tests/src/DebugTest.js b/packages/web3-eth-debug/tests/src/DebugTest.js new file mode 100644 index 00000000000..76d8506be20 --- /dev/null +++ b/packages/web3-eth-debug/tests/src/DebugTest.js @@ -0,0 +1,107 @@ +import * as Utils from 'web3-utils'; +import {formatters} from 'web3-core-helpers'; +import {Network} from 'web3-net'; +import {AbstractWeb3Module} from 'web3-core'; +import MethodFactory from '../../src/factories/MethodFactory'; +import Debug from '../../src/Debug'; + +// Mocks +jest.mock('web3-utils'); +jest.mock('web3-core-helpers'); +jest.mock('web3-net'); + +/** + * Debug test + */ +describe('DebugTest', () => { + let debug, providerMock, methodFactory, networkMock; + + beforeEach(() => { + providerMock = {send: jest.fn(), clearSubscriptions: jest.fn()}; + methodFactory = new MethodFactory(Utils, formatters); + + new Network(); + networkMock = Network.mock.instances[0]; + + debug = new Debug(providerMock, methodFactory, networkMock, Utils, formatters, {}, {}); + }); + + it('constructor check', () => { + expect(debug.net).toEqual(networkMock); + + expect(debug.utils).toEqual(Utils); + + expect(debug.formatters).toEqual(formatters); + + expect(debug).toBeInstanceOf(AbstractWeb3Module); + }); + + it('calls setProvider and returns true', () => { + networkMock.setProvider = jest.fn(); + networkMock.setProvider.mockReturnValueOnce(true); + + expect(debug.setProvider(providerMock, 'net')).toEqual(true); + + expect(networkMock.setProvider).toHaveBeenCalledWith(providerMock, 'net'); + }); + + it('sets the defaultGasPrice property', () => { + debug.defaultGasPrice = 10; + + expect(debug.defaultGasPrice).toEqual(10); + + expect(networkMock.defaultGasPrice).toEqual(10); + }); + + it('sets the defaultGas property', () => { + debug.defaultGas = 10; + + expect(debug.defaultGas).toEqual(10); + + expect(networkMock.defaultGas).toEqual(10); + }); + + it('sets the transactionBlockTimeout property', () => { + debug.transactionBlockTimeout = 10; + + expect(debug.transactionBlockTimeout).toEqual(10); + + expect(networkMock.transactionBlockTimeout).toEqual(10); + }); + + it('sets the transactionConfirmationBlocks property', () => { + debug.transactionConfirmationBlocks = 10; + + expect(debug.transactionConfirmationBlocks).toEqual(10); + + expect(networkMock.transactionConfirmationBlocks).toEqual(10); + }); + + it('sets the transactionPollingTimeout property', () => { + debug.transactionPollingTimeout = 10; + + expect(debug.transactionPollingTimeout).toEqual(10); + + expect(networkMock.transactionPollingTimeout).toEqual(10); + }); + + it('sets the defaultAccount property', () => { + Utils.toChecksumAddress.mockReturnValue('0x2'); + + debug.defaultAccount = '0x0'; + + expect(debug.defaultAccount).toEqual('0x2'); + + expect(networkMock.defaultAccount).toEqual('0x0'); + + expect(Utils.toChecksumAddress).toHaveBeenCalledWith('0x0'); + }); + + it('sets the defaultBlock property', () => { + debug.defaultBlock = 1; + + expect(debug.defaultBlock).toEqual(1); + + expect(networkMock.defaultBlock).toEqual(1); + }); +}); diff --git a/packages/web3-eth-debug/tests/src/factories/MethodFactoryTest.js b/packages/web3-eth-debug/tests/src/factories/MethodFactoryTest.js new file mode 100644 index 00000000000..47ca818cc36 --- /dev/null +++ b/packages/web3-eth-debug/tests/src/factories/MethodFactoryTest.js @@ -0,0 +1,82 @@ +import * as Utils from 'web3-utils'; +import {formatters} from 'web3-core-helpers'; +import { + BackTraceAtMethod, + BlockProfileMethod, + CpuProfileMethod, + DumpBlockMethod, + GcStatsMethod, + GetBlockRlpMethod, + GoTraceMethod, + MemStatsMethod, + SeedHashMethod, + SetBlockProfileRateMethod, + SetHeadMethod, + StacksMethod, + StartCpuProfileMethod, + StartGoTraceMethod, + StopCpuProfileMethod, + StopGoTraceMethod, + TraceBlockByHashMethod, + TraceBlockByNumberMethod, + TraceBlockFromFileMethod, + TraceBlockMethod, + TraceTransactionMethod, + VerbosityMethod, + VmoduleMethod, + WriteBlockProfileMethod, + WriteMemProfileMethod +} from 'web3-core-method'; + +import MethodFactory from '../../../src/factories/MethodFactory'; + +// Mocks +jest.mock('web3-utils'); +jest.mock('web3-core-helpers'); + +/** + * MethodFactory test + */ +describe('MethodFactoryTest', () => { + let methodFactory; + + beforeEach(() => { + methodFactory = new MethodFactory(Utils, formatters); + }); + + it('constructor check', () => { + expect(methodFactory.utils).toEqual(Utils); + + expect(methodFactory.formatters).toEqual(formatters); + }); + + it('JSON-RPC methods check', () => { + expect(methodFactory.methods).toEqual({ + backTraceAt: BackTraceAtMethod, + blockProfile: BlockProfileMethod, + cpuProfile: CpuProfileMethod, + dumpBlock: DumpBlockMethod, + gcStats: GcStatsMethod, + getBlockRlp: GetBlockRlpMethod, + goTrace: GoTraceMethod, + memStats: MemStatsMethod, + seedHash: SeedHashMethod, + setBlockProfileRate: SetBlockProfileRateMethod, + setHead: SetHeadMethod, + stacks: StacksMethod, + startCPUProfile: StartCpuProfileMethod, + startGoTrace: StartGoTraceMethod, + stopCPUProfile: StopCpuProfileMethod, + stopGoTrace: StopGoTraceMethod, + traceBlockByHash: TraceBlockByHashMethod, + traceBlockByNumber: TraceBlockByNumberMethod, + traceBlockFromFile: TraceBlockFromFileMethod, + traceBlock: TraceBlockMethod, + traceTransaction: TraceTransactionMethod, + verbosity: VerbosityMethod, + vmodule: VmoduleMethod, + writeBlockProfile: WriteBlockProfileMethod, + writeMemProfile: WriteMemProfileMethod + }); + }); +}); diff --git a/packages/web3-eth-debug/types/index.d.ts b/packages/web3-eth-debug/types/index.d.ts new file mode 100644 index 00000000000..9b45435fa44 --- /dev/null +++ b/packages/web3-eth-debug/types/index.d.ts @@ -0,0 +1,156 @@ +/* + This file is part of web3.js. + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file index.d.ts + * @author Prince Sinha + * @date 2019 + */ + +import {Accounts} from 'web3-eth-accounts'; +import {provider} from 'web3-providers'; +import {AbstractWeb3Module, Web3ModuleOptions} from 'web3-core'; +import * as net from 'net'; + +export class Debug extends AbstractWeb3Module { + constructor(provider: provider, net?: net.Socket|null, options?: Web3ModuleOptions, accounts?: Accounts|null); + + backTraceAt( + filename: string, + callback?: (error: Error, result: any) => void + ): Promise; + + blockProfile( + file: string, + seconds: number, + callback?: (error: Error, result: any) => void + ): Promise; + + cpuProfile( + file: string, + seconds: number, + callback?: (error: Error, resukt: string) => void + ): Promise; + + dumpBlock( + blockNumber: number, + callback?: (error: Error, result: any) => void + ): Promise; + + gcStats( + callback?: (error: Error, result: Stats) => void + ): Promise; + + getBlockRlp( + blockNumber: number, + callback?: (error: Error, result: string) => void + ): Promise; + + goTrace( + file: string, + seconds: number, + callback?: (error: Error, result: any) => void + ): Promise; + + memStats(callback?: (error: Error, result: any) => void): Promise; + + seedHash( + blockNumber: number, + callback?: (error: Error, result: string) => void + ): Promise; + + setHead( + blockNumber: number, + callback?: (error: Error, result: any) => void + ): Promise; + + setBlockProfileRate( + rate: number, + callback?: (error: Error, result: any) => void + ): Promise; + + stacks(callback?: (error: Error, result: any) => void): Promise; + + startCPUProfile( + file: string, + callback?: (error: Error, result: any) => void + ): Promise; + + startGoTrace( + file: string, + callback?: (error: Error, result: any) => void + ): Promise; + + stopCPUProfile(callback?: (error: Error, result: any) => void): Promise; + + stopGoTrace(callback?: (error: Error, result: any) => void): Promise; + + traceBlock( + blockRlp: string, + options?: {}, + callback?: (error: Error, result: any) => void + ): Promise; + + traceBlockByNumber( + blockNumber: number, + options?: {}, + callback?: (error: Error, result: any) => void + ): Promise; + + traceBlockByHash( + transactionHash: string, + options?: {}, + callback?: (error: Error, result: any) => void + ): Promise; + + traceBlockFromFile( + fileName: string, + options?: {}, + callback?: (error: Error, result: any) => void + ): Promise; + + traceTransaction( + transactionHash: string, + options?: {}, + callback?: (error: Error, result: any) => void + ): Promise; + + verbosity( + level: number, + callback?: (error: Error, result: any) => void + ): Promise; + + vmodule( + input: string, + callback?: (error: Error, result: any) => void + ): Promise; + + writeBlockProfile( + file: string, + callback?: (error: Error, result: any) => void + ): Promise; + + writeMemProfile( + file: string, + callback?: (error: Error, result: any) => void + ): Promise; +} + +export interface Stats { + LastGC: string; + NumGC: number; + Pause: number[]; + PauseEnd: string[]; + PauseQuantiles: string; + PauseTotal: number; +} diff --git a/packages/web3-eth-debug/types/tests/debug-tests.ts b/packages/web3-eth-debug/types/tests/debug-tests.ts new file mode 100644 index 00000000000..e6b7bd70220 --- /dev/null +++ b/packages/web3-eth-debug/types/tests/debug-tests.ts @@ -0,0 +1,191 @@ +/* + This file is part of web3.js. + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file debug-tests.ts + * @author Prince Sinha + * @date 2019 + */ + +import {Debug} from 'web3-eth-debug'; +import {Stats} from '../index'; + +const debug = new Debug('http://localhost:8545'); + +// $ExpectType Promise +debug.backTraceAt("server.go:443"); + +// $ExpectType Promise +debug.backTraceAt("server.go:443", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.blockProfile("", 600); + +// $ExpectType Promise +debug.blockProfile("", 600, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.cpuProfile("", 600); + +// $ExpectType Promise +debug.cpuProfile("", 600, (error: Error, address: any) => {}); + +// $ExpectType Promise +debug.dumpBlock(10); + +// $ExpectType Promise +debug.dumpBlock(10, (error: Error, result: string) => {}); + +// $ExpectType Promise +debug.gcStats(); + +// $ExpectType Promise +debug.gcStats((error: Error, result: Stats) => {}); + +// $ExpectType Promise +debug.getBlockRlp(10); + +// $ExpectType Promise +debug.getBlockRlp(10, (error: Error, result: string) => {}); + +// $ExpectType Promise +debug.goTrace("", 600); + +// $ExpectType Promise +debug.goTrace("", 600, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.memStats(); + +// $ExpectType Promise +debug.memStats((error: Error, result: any) => {}); + +// $ExpectType Promise +debug.seedHash(1); + +// $ExpectType Promise +debug.seedHash(1, (error: Error, result: string) => {}); + +// $ExpectType Promise +debug.setHead(1); + +// $ExpectType Promise +debug.setHead(1, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.startCPUProfile("prince"); + +// $ExpectType Promise +debug.startCPUProfile("prince", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.startGoTrace("prince"); + +// $ExpectType Promise +debug.startGoTrace("prince", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.stopCPUProfile(); + +// $ExpectType Promise +debug.stopCPUProfile((error: Error, result: any) => {}); + +// $ExpectType Promise +debug.stopGoTrace(); + +// $ExpectType Promise +debug.stopGoTrace((error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceBlock(""); + +// $ExpectType Promise +debug.traceBlock("", {disableStack: true, disableMemory: true, disableStorage: true}); + +// $ExpectType Promise +debug.traceBlock("", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceBlock("", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceBlockByHash("0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06"); + +// $ExpectType Promise +debug.traceBlockByHash("0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", {disableStack: true, disableMemory: true, disableStorage: true}); + +// $ExpectType Promise +debug.traceBlockByHash("0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceBlockByHash("0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceBlockByNumber(10); + +// $ExpectType Promise +debug.traceBlockByNumber(10, {disableStack: true, disableMemory: true, disableStorage: true}); + +// $ExpectType Promise +debug.traceBlockByNumber(10, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceBlockByNumber(10, {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceBlockFromFile(""); + +// $ExpectType Promise +debug.traceBlockFromFile("", {disableStack: true, disableMemory: true, disableStorage: true}); + +// $ExpectType Promise +debug.traceBlockFromFile("", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceBlockFromFile("", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f"); + +// $ExpectType Promise +debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", {disableStack: true, disableMemory: true, disableStorage: true}); + +// $ExpectType Promise +debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.verbosity(5); + +// $ExpectType Promise +debug.verbosity(5, (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.vmodule("eth/*=6"); + +// $ExpectType Promise +debug.vmodule("eth/*=6", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.writeBlockProfile(""); + +// $ExpectType Promise +debug.writeBlockProfile("", (error: Error, result: any) => {}); + +// $ExpectType Promise +debug.writeMemProfile(""); + +// $ExpectType Promise +debug.writeMemProfile("", (error: Error, result: any) => {}); diff --git a/packages/web3-eth-debug/types/tsconfig.json b/packages/web3-eth-debug/types/tsconfig.json new file mode 100644 index 00000000000..2a818e282d8 --- /dev/null +++ b/packages/web3-eth-debug/types/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noEmit": true, + "allowSyntheticDefaultImports": false, + "baseUrl": ".", + "paths": { + "web3-eth-debug": ["."] + } + } +} diff --git a/packages/web3-eth-debug/types/tslint.json b/packages/web3-eth-debug/types/tslint.json new file mode 100644 index 00000000000..6429b0c446e --- /dev/null +++ b/packages/web3-eth-debug/types/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "dtslint/dtslint.json", + "rules": { + "semicolon": false, + "no-import-default-of-export-equals": false, + "file-name-casing": [true, "kebab-case"], + "whitespace": false, + "no-unnecessary-class": false + } +} diff --git a/packages/web3-eth-personal/package-lock.json b/packages/web3-eth-personal/package-lock.json index 4bfc154532f..30a60d202a1 100644 --- a/packages/web3-eth-personal/package-lock.json +++ b/packages/web3-eth-personal/package-lock.json @@ -1,6 +1,6 @@ { "name": "web3-eth-personal", - "version": "1.0.0-beta.51", + "version": "1.0.0-beta.52", "lockfileVersion": 1, "requires": true, "dependencies": { From 71abc34d7e7d990e6ab301b1e7fb84eff9dd02b4 Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Sun, 14 Apr 2019 00:29:21 +0530 Subject: [PATCH 02/13] TraceBlockByHash fix --- .../src/methods/debug/TraceBlockByHashMethod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-core-method/src/methods/debug/TraceBlockByHashMethod.js b/packages/web3-core-method/src/methods/debug/TraceBlockByHashMethod.js index 72b0b7fe4e1..2e86aab9269 100644 --- a/packages/web3-core-method/src/methods/debug/TraceBlockByHashMethod.js +++ b/packages/web3-core-method/src/methods/debug/TraceBlockByHashMethod.js @@ -31,6 +31,6 @@ export default class TraceBlockByHashMethod extends AbstractMethod { * @constructor */ constructor(utils, formatters, moduleInstance) { - super('debug_traceBlockByHash', 1, utils, formatters, moduleInstance); + super('debug_traceBlockByHash', 2, utils, formatters, moduleInstance); } } From 24f834a250e0cded624db24c641e705b8ff75855 Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Sun, 14 Apr 2019 00:35:34 +0530 Subject: [PATCH 03/13] TraceTransaction fix --- .../src/methods/debug/TraceTransactionMethod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-core-method/src/methods/debug/TraceTransactionMethod.js b/packages/web3-core-method/src/methods/debug/TraceTransactionMethod.js index baffb067cf3..7ee9bf6b06e 100644 --- a/packages/web3-core-method/src/methods/debug/TraceTransactionMethod.js +++ b/packages/web3-core-method/src/methods/debug/TraceTransactionMethod.js @@ -31,6 +31,6 @@ export default class TraceTransactionMethod extends AbstractMethod { * @constructor */ constructor(utils, formatters, moduleInstance) { - super('debug_traceTransaction', 1, utils, formatters, moduleInstance); + super('debug_traceTransaction', 2, utils, formatters, moduleInstance); } } From 1d6afe68ab3208cbe74cb014c01e143e7305210c Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Sun, 14 Apr 2019 00:42:05 +0530 Subject: [PATCH 04/13] getBlockRlp fix --- .../web3-core-method/src/methods/debug/GetBlockRlpMethod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-core-method/src/methods/debug/GetBlockRlpMethod.js b/packages/web3-core-method/src/methods/debug/GetBlockRlpMethod.js index 148ff0adc4d..042b6fb4232 100644 --- a/packages/web3-core-method/src/methods/debug/GetBlockRlpMethod.js +++ b/packages/web3-core-method/src/methods/debug/GetBlockRlpMethod.js @@ -31,6 +31,6 @@ export default class GetBlockRlpMethod extends AbstractMethod { * @constructor */ constructor(utils, formatters, moduleInstance) { - super('debug_gcBlockRlp', 1, utils, formatters, moduleInstance); + super('debug_getBlockRlp', 1, utils, formatters, moduleInstance); } } From 63aa223620b7bc8cc98b43a01e1cbc7708af452e Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Sun, 14 Apr 2019 00:48:15 +0530 Subject: [PATCH 05/13] verbosity module fix --- packages/web3-core-method/src/methods/debug/VerbosityMethod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-core-method/src/methods/debug/VerbosityMethod.js b/packages/web3-core-method/src/methods/debug/VerbosityMethod.js index e3877e8c537..fc9c1c84141 100644 --- a/packages/web3-core-method/src/methods/debug/VerbosityMethod.js +++ b/packages/web3-core-method/src/methods/debug/VerbosityMethod.js @@ -31,6 +31,6 @@ export default class VerbosityMethod extends AbstractMethod { * @constructor */ constructor(utils, formatters, moduleInstance) { - super('debug_vebosity', 1, utils, formatters, moduleInstance); + super('debug_verbosity', 1, utils, formatters, moduleInstance); } } From 696286b6e552de6623029b1f6efe50c781b704dd Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Sun, 14 Apr 2019 00:57:36 +0530 Subject: [PATCH 06/13] setHead fix --- packages/web3-core-method/src/methods/debug/SetHeadMethod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-core-method/src/methods/debug/SetHeadMethod.js b/packages/web3-core-method/src/methods/debug/SetHeadMethod.js index 1d3cc9853ff..85eae04fbfe 100644 --- a/packages/web3-core-method/src/methods/debug/SetHeadMethod.js +++ b/packages/web3-core-method/src/methods/debug/SetHeadMethod.js @@ -31,6 +31,6 @@ export default class SetHeadMethod extends AbstractMethod { * @constructor */ constructor(utils, formatters, moduleInstance) { - super('debug_SetHead', 1, utils, formatters, moduleInstance); + super('debug_setHead', 1, utils, formatters, moduleInstance); } } From 9c85781a7dfcce74f8e4be412faeabe123467dd5 Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Sun, 14 Apr 2019 01:12:32 +0530 Subject: [PATCH 07/13] Typing fix --- packages/web3-eth-debug/types/tests/debug-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/web3-eth-debug/types/tests/debug-tests.ts b/packages/web3-eth-debug/types/tests/debug-tests.ts index e6b7bd70220..8f0339b015b 100644 --- a/packages/web3-eth-debug/types/tests/debug-tests.ts +++ b/packages/web3-eth-debug/types/tests/debug-tests.ts @@ -17,8 +17,7 @@ * @date 2019 */ -import {Debug} from 'web3-eth-debug'; -import {Stats} from '../index'; +import {Debug, Stats} from 'web3-eth-debug'; const debug = new Debug('http://localhost:8545'); From 7e328a8a0c5f71bd2380f2dc11606fc0596fb49f Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Mon, 15 Apr 2019 12:00:11 +0530 Subject: [PATCH 08/13] Name fix --- packages/web3-eth-debug/rollup.config.js | 2 +- packages/web3-eth-debug/src/Debug.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web3-eth-debug/rollup.config.js b/packages/web3-eth-debug/rollup.config.js index e43c2245ba5..0026e2ba42f 100644 --- a/packages/web3-eth-debug/rollup.config.js +++ b/packages/web3-eth-debug/rollup.config.js @@ -1,4 +1,4 @@ import pkg from './package.json'; import rollupConfig from '../../rollup.config'; -export default rollupConfig('Web3EthPersonal', pkg.name); +export default rollupConfig('Web3EthDebug', pkg.name); diff --git a/packages/web3-eth-debug/src/Debug.js b/packages/web3-eth-debug/src/Debug.js index 05b9ea549e4..a7be1094b58 100644 --- a/packages/web3-eth-debug/src/Debug.js +++ b/packages/web3-eth-debug/src/Debug.js @@ -15,7 +15,7 @@ along with web3.js. If not, see . */ /** - * @file index.js + * @file Debug.js * @author Prince Sinha * @date 2019 */ From 740e5b35bcd503c361115dcbb82d86713f70177e Mon Sep 17 00:00:00 2001 From: prince Date: Mon, 15 Apr 2019 22:34:47 +0530 Subject: [PATCH 09/13] removed unnecessary dependency --- packages/web3-eth-debug/package.json | 3 +-- packages/web3-eth-debug/types/index.d.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/web3-eth-debug/package.json b/packages/web3-eth-debug/package.json index 0b3a73d5d51..d5b32dee7dd 100644 --- a/packages/web3-eth-debug/package.json +++ b/packages/web3-eth-debug/package.json @@ -26,8 +26,7 @@ }, "devDependencies": { "definitelytyped-header-parser": "^1.0.1", - "dtslint": "0.4.2", - "web3-eth-accounts": "1.0.0-beta.52" + "dtslint": "0.4.2" }, "files": [ "dist", diff --git a/packages/web3-eth-debug/types/index.d.ts b/packages/web3-eth-debug/types/index.d.ts index 9b45435fa44..697379ec8da 100644 --- a/packages/web3-eth-debug/types/index.d.ts +++ b/packages/web3-eth-debug/types/index.d.ts @@ -17,13 +17,12 @@ * @date 2019 */ -import {Accounts} from 'web3-eth-accounts'; import {provider} from 'web3-providers'; import {AbstractWeb3Module, Web3ModuleOptions} from 'web3-core'; import * as net from 'net'; export class Debug extends AbstractWeb3Module { - constructor(provider: provider, net?: net.Socket|null, options?: Web3ModuleOptions, accounts?: Accounts|null); + constructor(provider: provider, net?: net.Socket|null, options?: Web3ModuleOptions, accounts?: any); backTraceAt( filename: string, From d157cfdd5a8704c5cd14ac6e2f5d0f5b94e6050b Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Wed, 17 Apr 2019 14:46:57 +0530 Subject: [PATCH 10/13] typing fix --- packages/web3-eth-debug/types/index.d.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/web3-eth-debug/types/index.d.ts b/packages/web3-eth-debug/types/index.d.ts index 697379ec8da..00e4c22f271 100644 --- a/packages/web3-eth-debug/types/index.d.ts +++ b/packages/web3-eth-debug/types/index.d.ts @@ -96,33 +96,33 @@ export class Debug extends AbstractWeb3Module { traceBlock( blockRlp: string, - options?: {}, + options?: any, callback?: (error: Error, result: any) => void ): Promise; traceBlockByNumber( blockNumber: number, - options?: {}, + options?: any, callback?: (error: Error, result: any) => void ): Promise; traceBlockByHash( transactionHash: string, - options?: {}, + options?: any, callback?: (error: Error, result: any) => void ): Promise; traceBlockFromFile( fileName: string, - options?: {}, + options?: any, callback?: (error: Error, result: any) => void ): Promise; traceTransaction( transactionHash: string, - options?: {}, - callback?: (error: Error, result: any) => void - ): Promise; + options?: any, + callback?: (error: Error, result: TraceTransaction) => void + ): Promise; verbosity( level: number, @@ -153,3 +153,10 @@ export interface Stats { PauseQuantiles: string; PauseTotal: number; } + +export interface TraceTransaction { + failed: boolean; + gas: number; + returnValue: string; + structLogs: any[]; +} From 87d377637a55a8e8cc5ae4a4d269e6c5d9f68297 Mon Sep 17 00:00:00 2001 From: prince Date: Thu, 18 Apr 2019 10:20:29 +0530 Subject: [PATCH 11/13] Build Pipeline fix --- packages/web3-eth-debug/types/tests/debug-tests.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/web3-eth-debug/types/tests/debug-tests.ts b/packages/web3-eth-debug/types/tests/debug-tests.ts index 8f0339b015b..e7228bc4b74 100644 --- a/packages/web3-eth-debug/types/tests/debug-tests.ts +++ b/packages/web3-eth-debug/types/tests/debug-tests.ts @@ -17,7 +17,7 @@ * @date 2019 */ -import {Debug, Stats} from 'web3-eth-debug'; +import {Debug, Stats, TraceTransaction} from 'web3-eth-debug'; const debug = new Debug('http://localhost:8545'); @@ -153,17 +153,17 @@ debug.traceBlockFromFile("", (error: Error, result: any) => {}); // $ExpectType Promise debug.traceBlockFromFile("", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: any) => {}); -// $ExpectType Promise +// $ExpectType Promise debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f"); -// $ExpectType Promise +// $ExpectType Promise debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", {disableStack: true, disableMemory: true, disableStorage: true}); -// $ExpectType Promise -debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", (error: Error, result: any) => {}); +// $ExpectType Promise +debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", (error: Error, result: TraceTransaction) => {}); -// $ExpectType Promise -debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: any) => {}); +// $ExpectType Promise +debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: TraceTransaction) => {}); // $ExpectType Promise debug.verbosity(5); From b1bfb59e025adcc86e8d34a42e81655a14b12ee8 Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Thu, 18 Apr 2019 13:03:00 +0530 Subject: [PATCH 12/13] Pipeline fix --- packages/web3-eth-debug/types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-eth-debug/types/index.d.ts b/packages/web3-eth-debug/types/index.d.ts index 00e4c22f271..2ded9ad4e33 100644 --- a/packages/web3-eth-debug/types/index.d.ts +++ b/packages/web3-eth-debug/types/index.d.ts @@ -158,5 +158,5 @@ export interface TraceTransaction { failed: boolean; gas: number; returnValue: string; - structLogs: any[]; + structLogs: []; } From e2be9d0c2df99caea0f01f6af4b49d156a725ddd Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Thu, 18 Apr 2019 13:25:32 +0530 Subject: [PATCH 13/13] Pipeline fix --- packages/web3-eth-debug/types/index.d.ts | 2 +- .../web3-eth-debug/types/tests/debug-tests.ts | 32 +++++++++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/packages/web3-eth-debug/types/index.d.ts b/packages/web3-eth-debug/types/index.d.ts index 2ded9ad4e33..00e4c22f271 100644 --- a/packages/web3-eth-debug/types/index.d.ts +++ b/packages/web3-eth-debug/types/index.d.ts @@ -158,5 +158,5 @@ export interface TraceTransaction { failed: boolean; gas: number; returnValue: string; - structLogs: []; + structLogs: any[]; } diff --git a/packages/web3-eth-debug/types/tests/debug-tests.ts b/packages/web3-eth-debug/types/tests/debug-tests.ts index e7228bc4b74..92c6618e8d9 100644 --- a/packages/web3-eth-debug/types/tests/debug-tests.ts +++ b/packages/web3-eth-debug/types/tests/debug-tests.ts @@ -121,13 +121,23 @@ debug.traceBlock("", {disableStack: true, disableMemory: true, disableStorage: t debug.traceBlockByHash("0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06"); // $ExpectType Promise -debug.traceBlockByHash("0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", {disableStack: true, disableMemory: true, disableStorage: true}); +debug.traceBlockByHash( + "0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", + {disableStack: true, disableMemory: true, disableStorage: true} +); // $ExpectType Promise -debug.traceBlockByHash("0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", (error: Error, result: any) => {}); +debug.traceBlockByHash( + "0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", + (error: Error, result: any) => {} +); // $ExpectType Promise -debug.traceBlockByHash("0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: any) => {}); +debug.traceBlockByHash( + "0x07801257594649d586712d84357b6626d81f33465519ba7994de585f3adf7f06", + {disableStack: true, disableMemory: true, disableStorage: true}, + (error: Error, result: any) => {} +); // $ExpectType Promise debug.traceBlockByNumber(10); @@ -157,13 +167,23 @@ debug.traceBlockFromFile("", {disableStack: true, disableMemory: true, disableSt debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f"); // $ExpectType Promise -debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", {disableStack: true, disableMemory: true, disableStorage: true}); +debug.traceTransaction( + "0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", + {disableStack: true, disableMemory: true, disableStorage: true} +); // $ExpectType Promise -debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", (error: Error, result: TraceTransaction) => {}); +debug.traceTransaction( + "0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", + (error: Error, result: TraceTransaction) => {} +); // $ExpectType Promise -debug.traceTransaction("0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", {disableStack: true, disableMemory: true, disableStorage: true}, (error: Error, result: TraceTransaction) => {}); +debug.traceTransaction( + "0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", + {disableStack: true, disableMemory: true, disableStorage: true}, + (error: Error, result: TraceTransaction) => {} +); // $ExpectType Promise debug.verbosity(5);