Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
72d3af4f
Commit
72d3af4f
authored
Sep 25, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --details option to display paylods for requests and responses
parent
9703013b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
ethsim
remix-simulator/bin/ethsim
+3
-1
provider.js
remix-simulator/src/provider.js
+8
-0
No files found.
remix-simulator/bin/ethsim
View file @
72d3af4f
...
@@ -24,12 +24,14 @@ program
...
@@ -24,12 +24,14 @@ program
.
option
(
'-b, --ip [host]'
,
'specify host'
)
.
option
(
'-b, --ip [host]'
,
'specify host'
)
.
option
(
'-c, --coinbase [coinbase]'
,
'specify host'
)
.
option
(
'-c, --coinbase [coinbase]'
,
'specify host'
)
.
option
(
'--rpc'
,
'run rpc server only'
)
.
option
(
'--rpc'
,
'run rpc server only'
)
.
option
(
'--details'
,
'display payloads for every requests and their responses'
)
.
parse
(
process
.
argv
)
.
parse
(
process
.
argv
)
const
Server
=
require
(
'../src/server'
)
const
Server
=
require
(
'../src/server'
)
const
server
=
new
Server
({
const
server
=
new
Server
({
coinbase
:
program
.
coinbase
||
"0x0000000000000000000000000000000000000000"
,
coinbase
:
program
.
coinbase
||
"0x0000000000000000000000000000000000000000"
,
rpc
:
program
.
rpc
rpc
:
program
.
rpc
,
logDetails
:
program
.
details
})
})
server
.
start
(
program
.
host
||
'127.0.0.1'
,
program
.
port
||
8545
)
server
.
start
(
program
.
host
||
'127.0.0.1'
,
program
.
port
||
8545
)
remix-simulator/src/provider.js
View file @
72d3af4f
...
@@ -14,6 +14,7 @@ const Transactions = require('./methods/transactions.js')
...
@@ -14,6 +14,7 @@ const Transactions = require('./methods/transactions.js')
const
generateBlock
=
require
(
'./genesis.js'
)
const
generateBlock
=
require
(
'./genesis.js'
)
var
Provider
=
function
(
options
)
{
var
Provider
=
function
(
options
)
{
this
.
options
=
options
||
{}
this
.
Accounts
=
new
Accounts
()
this
.
Accounts
=
new
Accounts
()
this
.
Transactions
=
new
Transactions
()
this
.
Transactions
=
new
Transactions
()
...
@@ -38,8 +39,15 @@ Provider.prototype.sendAsync = function (payload, callback) {
...
@@ -38,8 +39,15 @@ Provider.prototype.sendAsync = function (payload, callback) {
log
.
info
(
'payload method is '
,
payload
.
method
)
log
.
info
(
'payload method is '
,
payload
.
method
)
let
method
=
this
.
methods
[
payload
.
method
]
let
method
=
this
.
methods
[
payload
.
method
]
if
(
this
.
options
.
logDetails
)
{
log
.
info
(
payload
)
}
if
(
method
)
{
if
(
method
)
{
return
method
.
call
(
method
,
payload
,
(
err
,
result
)
=>
{
return
method
.
call
(
method
,
payload
,
(
err
,
result
)
=>
{
if
(
this
.
options
.
logDetails
)
{
log
.
info
(
err
)
log
.
info
(
result
)
}
if
(
err
)
{
if
(
err
)
{
return
callback
(
err
)
return
callback
(
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment