From ebae6be90ded560e90e5850b66928c1d94b0e8df Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 14 Dec 2020 20:47:30 +0530 Subject: [PATCH] rdb bin updated --- libs/remix-debug/bin/rdb | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/libs/remix-debug/bin/rdb b/libs/remix-debug/bin/rdb index 53da786448..8896b89724 100755 --- a/libs/remix-debug/bin/rdb +++ b/libs/remix-debug/bin/rdb @@ -1,7 +1,11 @@ #!/usr/bin/env node -const program = require('commander') -const version = require('../package.json').version +import program from 'commander' +import { compileStandardWrapper } from 'solc' +import { readFileSync } from 'fs' +import { start } from 'repl' +import { version } from '../package.json' +import { CmdLine } from '../src/cmdline/index' program .command('version') @@ -25,14 +29,8 @@ program .option('--node [url]', 'node to connect to') .parse(process.argv) -const CmdLine = require('../src/cmdline/index') - -const solc = require('solc') -const fs = require('fs') - const filename = 'test/sol/simple_storage.sol' const shortFilename = 'simple_storage.sol' - const inputJson = { language: 'Solidity', sources: { @@ -51,11 +49,11 @@ const inputJson = { } } -inputJson.sources[shortFilename] = {content: fs.readFileSync(filename).toString()} +inputJson.sources[shortFilename] = {content: readFileSync(filename).toString()} console.log('compiling...') -const compilationData = JSON.parse(solc.compileStandardWrapper(JSON.stringify(inputJson))) +const compilationData = JSON.parse(compileStandardWrapper(JSON.stringify(inputJson))) const compilation = {} compilation.data = compilationData compilation.source = { sources: inputJson.sources } @@ -73,9 +71,7 @@ cmdLine.events.on('source', () => { cmdLine.getSource().forEach(console.dir) }) -const repl = require('repl') - -repl.start({ +start({ prompt: '> ', eval: (cmd, context, filename, cb) => { let command = cmd.trim()