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
8f2abe78
Commit
8f2abe78
authored
Jun 12, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linting issues
parent
39c5e31e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
85 deletions
+72
-85
blocks.js
remix-simulator/src/methods/blocks.js
+28
-26
misc.js
remix-simulator/src/methods/misc.js
+3
-3
transactions.js
remix-simulator/src/methods/transactions.js
+41
-56
No files found.
remix-simulator/src/methods/blocks.js
View file @
8f2abe78
var
Web3
=
require
(
'web3'
)
var
RemixLib
=
require
(
'remix-lib'
)
var
RemixLib
=
require
(
'remix-lib'
)
var
executionContext
=
RemixLib
.
execution
.
executionContext
var
executionContext
=
RemixLib
.
execution
.
executionContext
...
@@ -25,34 +24,38 @@ Blocks.prototype.methods = function () {
...
@@ -25,34 +24,38 @@ Blocks.prototype.methods = function () {
Blocks
.
prototype
.
eth_getBlockByNumber
=
function
(
payload
,
cb
)
{
Blocks
.
prototype
.
eth_getBlockByNumber
=
function
(
payload
,
cb
)
{
var
block
=
executionContext
.
blocks
[
payload
.
params
[
0
]]
var
block
=
executionContext
.
blocks
[
payload
.
params
[
0
]]
if
(
!
block
)
{
return
cb
(
new
Error
(
'block not found'
))
}
let
b
=
{
let
b
=
{
'number'
:
toHex
(
block
.
header
.
number
),
'number'
:
toHex
(
block
.
header
.
number
),
"hash"
:
toHex
(
block
.
hash
()),
'hash'
:
toHex
(
block
.
hash
()),
'parentHash'
:
toHex
(
block
.
header
.
parentHash
),
'parentHash'
:
toHex
(
block
.
header
.
parentHash
),
'nonce'
:
toHex
(
block
.
header
.
nonce
),
'nonce'
:
toHex
(
block
.
header
.
nonce
),
"sha3Uncles"
:
"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
,
'sha3Uncles'
:
'0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
,
"logsBloom"
:
"0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
,
'logsBloom'
:
'0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331'
,
"transactionsRoot"
:
"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
,
'transactionsRoot'
:
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
,
"stateRoot"
:
toHex
(
block
.
header
.
stateRoot
),
'stateRoot'
:
toHex
(
block
.
header
.
stateRoot
),
'miner'
:
this
.
coinbase
,
'miner'
:
this
.
coinbase
,
'difficulty'
:
toHex
(
block
.
header
.
difficulty
),
'difficulty'
:
toHex
(
block
.
header
.
difficulty
),
"totalDifficulty"
:
toHex
(
block
.
header
.
totalDifficulty
),
'totalDifficulty'
:
toHex
(
block
.
header
.
totalDifficulty
),
'extraData'
:
toHex
(
block
.
header
.
extraData
),
'extraData'
:
toHex
(
block
.
header
.
extraData
),
"size"
:
"0x027f07"
,
// 163591
'size'
:
'0x027f07'
,
// 163591
'gasLimit'
:
toHex
(
block
.
header
.
gasLimit
),
'gasLimit'
:
toHex
(
block
.
header
.
gasLimit
),
'gasUsed'
:
toHex
(
block
.
header
.
gasUsed
),
'gasUsed'
:
toHex
(
block
.
header
.
gasUsed
),
"timestamp"
:
toHex
(
block
.
header
.
timestamp
),
'timestamp'
:
toHex
(
block
.
header
.
timestamp
),
"transactions"
:
block
.
transactions
.
map
((
t
)
=>
"0x"
+
t
.
hash
().
toString
(
'hex'
)),
'transactions'
:
block
.
transactions
.
map
((
t
)
=>
'0x'
+
t
.
hash
().
toString
(
'hex'
)),
"uncles"
:
[]
'uncles'
:
[]
}
}
cb
(
null
,
b
)
cb
(
null
,
b
)
}
}
function
toHex
(
value
)
{
function
toHex
(
value
)
{
if
(
!
value
)
return
"0x0"
if
(
!
value
)
return
'0x0'
let
v
=
value
.
toString
(
'hex'
)
let
v
=
value
.
toString
(
'hex'
)
return
((
v
===
"0x"
||
v
===
""
)
?
"0x0"
:
(
"0x"
+
v
))
return
((
v
===
'0x'
||
v
===
''
)
?
'0x0'
:
(
'0x'
+
v
))
}
}
Blocks
.
prototype
.
eth_getBlockByHash
=
function
(
payload
,
cb
)
{
Blocks
.
prototype
.
eth_getBlockByHash
=
function
(
payload
,
cb
)
{
...
@@ -60,23 +63,23 @@ Blocks.prototype.eth_getBlockByHash = function (payload, cb) {
...
@@ -60,23 +63,23 @@ Blocks.prototype.eth_getBlockByHash = function (payload, cb) {
let
b
=
{
let
b
=
{
'number'
:
toHex
(
block
.
header
.
number
),
'number'
:
toHex
(
block
.
header
.
number
),
"hash"
:
toHex
(
block
.
hash
()),
'hash'
:
toHex
(
block
.
hash
()),
'parentHash'
:
toHex
(
block
.
header
.
parentHash
),
'parentHash'
:
toHex
(
block
.
header
.
parentHash
),
'nonce'
:
toHex
(
block
.
header
.
nonce
),
'nonce'
:
toHex
(
block
.
header
.
nonce
),
"sha3Uncles"
:
"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
,
'sha3Uncles'
:
'0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
,
"logsBloom"
:
"0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
,
'logsBloom'
:
'0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331'
,
"transactionsRoot"
:
"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
,
'transactionsRoot'
:
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
,
"stateRoot"
:
toHex
(
block
.
header
.
stateRoot
),
'stateRoot'
:
toHex
(
block
.
header
.
stateRoot
),
'miner'
:
this
.
coinbase
,
'miner'
:
this
.
coinbase
,
'difficulty'
:
toHex
(
block
.
header
.
difficulty
),
'difficulty'
:
toHex
(
block
.
header
.
difficulty
),
"totalDifficulty"
:
toHex
(
block
.
header
.
totalDifficulty
),
'totalDifficulty'
:
toHex
(
block
.
header
.
totalDifficulty
),
'extraData'
:
toHex
(
block
.
header
.
extraData
),
'extraData'
:
toHex
(
block
.
header
.
extraData
),
"size"
:
"0x027f07"
,
// 163591
'size'
:
'0x027f07'
,
// 163591
'gasLimit'
:
toHex
(
block
.
header
.
gasLimit
),
'gasLimit'
:
toHex
(
block
.
header
.
gasLimit
),
'gasUsed'
:
toHex
(
block
.
header
.
gasUsed
),
'gasUsed'
:
toHex
(
block
.
header
.
gasUsed
),
"timestamp"
:
toHex
(
block
.
header
.
timestamp
),
'timestamp'
:
toHex
(
block
.
header
.
timestamp
),
"transactions"
:
block
.
transactions
.
map
((
t
)
=>
"0x"
+
t
.
hash
().
toString
(
'hex'
)),
'transactions'
:
block
.
transactions
.
map
((
t
)
=>
'0x'
+
t
.
hash
().
toString
(
'hex'
)),
"uncles"
:
[]
'uncles'
:
[]
}
}
cb
(
null
,
b
)
cb
(
null
,
b
)
...
@@ -114,4 +117,4 @@ Blocks.prototype.eth_getUncleCountByBlockNumber = function (payload, cb) {
...
@@ -114,4 +117,4 @@ Blocks.prototype.eth_getUncleCountByBlockNumber = function (payload, cb) {
cb
(
null
,
0
)
cb
(
null
,
0
)
}
}
module
.
exports
=
Blocks
module
.
exports
=
Blocks
\ No newline at end of file
remix-simulator/src/methods/misc.js
View file @
8f2abe78
...
@@ -50,15 +50,15 @@ Misc.prototype.eth_getCompilers = function (payload, cb) {
...
@@ -50,15 +50,15 @@ Misc.prototype.eth_getCompilers = function (payload, cb) {
}
}
Misc
.
prototype
.
eth_compileSolidity
=
function
(
payload
,
cb
)
{
Misc
.
prototype
.
eth_compileSolidity
=
function
(
payload
,
cb
)
{
cb
(
null
,
"unsupported"
)
cb
(
null
,
'unsupported'
)
}
}
Misc
.
prototype
.
eth_compileLLL
=
function
(
payload
,
cb
)
{
Misc
.
prototype
.
eth_compileLLL
=
function
(
payload
,
cb
)
{
cb
(
null
,
"unsupported"
)
cb
(
null
,
'unsupported'
)
}
}
Misc
.
prototype
.
eth_compileSerpent
=
function
(
payload
,
cb
)
{
Misc
.
prototype
.
eth_compileSerpent
=
function
(
payload
,
cb
)
{
cb
(
null
,
"unsupported"
)
cb
(
null
,
'unsupported'
)
}
}
module
.
exports
=
Misc
module
.
exports
=
Misc
remix-simulator/src/methods/transactions.js
View file @
8f2abe78
var
Web3
=
require
(
'web3'
)
var
RemixLib
=
require
(
'remix-lib'
)
var
RemixLib
=
require
(
'remix-lib'
)
var
executionContext
=
RemixLib
.
execution
.
executionContext
var
executionContext
=
RemixLib
.
execution
.
executionContext
var
ethJSUtil
=
require
(
'ethereumjs-util'
)
var
ethJSUtil
=
require
(
'ethereumjs-util'
)
var
processTx
=
require
(
'./txProcess.js'
)
var
processTx
=
require
(
'./txProcess.js'
)
var
BN
=
ethJSUtil
.
BN
var
BN
=
ethJSUtil
.
BN
function
hexConvert
(
ints
)
{
var
ret
=
'0x'
for
(
var
i
=
0
;
i
<
ints
.
length
;
i
++
)
{
var
h
=
ints
[
i
]
if
(
h
)
{
ret
+=
(
h
<=
0xf
?
'0'
:
''
)
+
h
.
toString
(
16
)
}
else
{
ret
+=
'00'
}
}
return
ret
}
var
Transactions
=
function
(
accounts
)
{
var
Transactions
=
function
(
accounts
)
{
this
.
accounts
=
accounts
this
.
accounts
=
accounts
}
}
...
@@ -45,15 +33,15 @@ Transactions.prototype.eth_getTransactionReceipt = function (payload, cb) {
...
@@ -45,15 +33,15 @@ Transactions.prototype.eth_getTransactionReceipt = function (payload, cb) {
return
cb
(
error
)
return
cb
(
error
)
}
}
var
txBlock
=
executionContext
.
txs
[
receipt
.
hash
]
;
var
txBlock
=
executionContext
.
txs
[
receipt
.
hash
]
var
r
=
{
var
r
=
{
'transactionHash'
:
receipt
.
hash
,
'transactionHash'
:
receipt
.
hash
,
'transactionIndex'
:
'0x00'
,
'transactionIndex'
:
'0x00'
,
'blockHash'
:
"0x"
+
txBlock
.
hash
().
toString
(
'hex'
),
'blockHash'
:
'0x'
+
txBlock
.
hash
().
toString
(
'hex'
),
'blockNumber'
:
"0x"
+
txBlock
.
header
.
number
.
toString
(
'hex'
),
'blockNumber'
:
'0x'
+
txBlock
.
header
.
number
.
toString
(
'hex'
),
'gasUsed'
:
w
eb3
.
utils
.
toHex
(
receipt
.
gas
),
'gasUsed'
:
W
eb3
.
utils
.
toHex
(
receipt
.
gas
),
'cumulativeGasUsed'
:
w
eb3
.
utils
.
toHex
(
receipt
.
gas
),
'cumulativeGasUsed'
:
W
eb3
.
utils
.
toHex
(
receipt
.
gas
),
'contractAddress'
:
receipt
.
contractAddress
,
'contractAddress'
:
receipt
.
contractAddress
,
'logs'
:
receipt
.
logs
,
'logs'
:
receipt
.
logs
,
'status'
:
receipt
.
status
'status'
:
receipt
.
status
...
@@ -70,13 +58,13 @@ Transactions.prototype.eth_estimateGas = function (payload, cb) {
...
@@ -70,13 +58,13 @@ Transactions.prototype.eth_estimateGas = function (payload, cb) {
Transactions
.
prototype
.
eth_getCode
=
function
(
payload
,
cb
)
{
Transactions
.
prototype
.
eth_getCode
=
function
(
payload
,
cb
)
{
let
address
=
payload
.
params
[
0
]
let
address
=
payload
.
params
[
0
]
executionContext
.
web3
().
eth
.
getCode
(
address
,
(
error
,
result
)
=>
{
executionContext
.
web3
().
eth
.
getCode
(
address
,
(
error
,
result
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
dir
(
"error getting code"
);
console
.
dir
(
'error getting code'
)
console
.
dir
(
error
)
;
console
.
dir
(
error
)
}
}
cb
(
error
,
result
)
cb
(
error
,
result
)
})
})
}
}
Transactions
.
prototype
.
eth_call
=
function
(
payload
,
cb
)
{
Transactions
.
prototype
.
eth_call
=
function
(
payload
,
cb
)
{
...
@@ -103,35 +91,33 @@ Transactions.prototype.eth_getTransactionByHash = function (payload, cb) {
...
@@ -103,35 +91,33 @@ Transactions.prototype.eth_getTransactionByHash = function (payload, cb) {
return
cb
(
error
)
return
cb
(
error
)
}
}
var
test
=
executionContext
.
web3
();
var
txBlock
=
executionContext
.
txs
[
receipt
.
transactionHash
]
var
txBlock
=
executionContext
.
txs
[
receipt
.
transactionHash
];
// TODO: params to add later
// TODO: params to add later
let
r
=
{
let
r
=
{
'blockHash'
:
"0x"
+
txBlock
.
hash
().
toString
(
'hex'
),
'blockHash'
:
'0x'
+
txBlock
.
hash
().
toString
(
'hex'
),
'blockNumber'
:
"0x"
+
txBlock
.
header
.
number
.
toString
(
'hex'
),
'blockNumber'
:
'0x'
+
txBlock
.
header
.
number
.
toString
(
'hex'
),
'from'
:
receipt
.
from
,
'from'
:
receipt
.
from
,
'gas'
:
w
eb3
.
utils
.
toHex
(
receipt
.
gas
),
'gas'
:
W
eb3
.
utils
.
toHex
(
receipt
.
gas
),
// 'gasPrice': '2000000000000', // 0x123
// 'gasPrice': '2000000000000', // 0x123
"gasPrice"
:
"0x4a817c800"
,
// 20000000000
'gasPrice'
:
'0x4a817c800'
,
// 20000000000
'hash'
:
receipt
.
transactionHash
,
'hash'
:
receipt
.
transactionHash
,
'input'
:
receipt
.
input
,
'input'
:
receipt
.
input
,
// "nonce": 2, // 0x15
// "nonce": 2, // 0x15
// "transactionIndex": 0,
// "transactionIndex": 0,
"value"
:
receipt
.
value
'value'
:
receipt
.
value
// "value":"0xf3dbb76162000" // 4290000000000000
// "value":"0xf3dbb76162000" // 4290000000000000
// "v": "0x25", // 37
// "v": "0x25", // 37
// "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
// "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
// "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c"
// "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c"
}
}
if
(
receipt
.
to
)
{
if
(
receipt
.
to
)
{
r
.
to
=
receipt
.
to
r
.
to
=
receipt
.
to
}
}
if
(
r
.
value
===
"0x"
)
{
if
(
r
.
value
===
'0x'
)
{
r
.
value
=
"0x0"
r
.
value
=
'0x0'
}
}
cb
(
null
,
r
)
cb
(
null
,
r
)
...
@@ -142,7 +128,7 @@ Transactions.prototype.eth_getTransactionByBlockHashAndIndex = function (payload
...
@@ -142,7 +128,7 @@ Transactions.prototype.eth_getTransactionByBlockHashAndIndex = function (payload
const
txIndex
=
payload
.
params
[
1
]
const
txIndex
=
payload
.
params
[
1
]
var
txBlock
=
executionContext
.
blocks
[
payload
.
params
[
0
]]
var
txBlock
=
executionContext
.
blocks
[
payload
.
params
[
0
]]
const
txHash
=
"0x"
+
txBlock
.
transactions
[
w
eb3
.
utils
.
toDecimal
(
txIndex
)].
hash
().
toString
(
'hex'
)
const
txHash
=
'0x'
+
txBlock
.
transactions
[
W
eb3
.
utils
.
toDecimal
(
txIndex
)].
hash
().
toString
(
'hex'
)
executionContext
.
web3
().
eth
.
getTransactionReceipt
(
txHash
,
(
error
,
receipt
)
=>
{
executionContext
.
web3
().
eth
.
getTransactionReceipt
(
txHash
,
(
error
,
receipt
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -151,17 +137,17 @@ Transactions.prototype.eth_getTransactionByBlockHashAndIndex = function (payload
...
@@ -151,17 +137,17 @@ Transactions.prototype.eth_getTransactionByBlockHashAndIndex = function (payload
// TODO: params to add later
// TODO: params to add later
let
r
=
{
let
r
=
{
'blockHash'
:
"0x"
+
txBlock
.
hash
().
toString
(
'hex'
),
'blockHash'
:
'0x'
+
txBlock
.
hash
().
toString
(
'hex'
),
'blockNumber'
:
"0x"
+
txBlock
.
header
.
number
.
toString
(
'hex'
),
'blockNumber'
:
'0x'
+
txBlock
.
header
.
number
.
toString
(
'hex'
),
'from'
:
receipt
.
from
,
'from'
:
receipt
.
from
,
'gas'
:
w
eb3
.
utils
.
toHex
(
receipt
.
gas
),
'gas'
:
W
eb3
.
utils
.
toHex
(
receipt
.
gas
),
// 'gasPrice': '2000000000000', // 0x123
// 'gasPrice': '2000000000000', // 0x123
"gasPrice"
:
"0x4a817c800"
,
// 20000000000
'gasPrice'
:
'0x4a817c800'
,
// 20000000000
'hash'
:
receipt
.
transactionHash
,
'hash'
:
receipt
.
transactionHash
,
'input'
:
receipt
.
input
,
'input'
:
receipt
.
input
,
// "nonce": 2, // 0x15
// "nonce": 2, // 0x15
// "transactionIndex": 0,
// "transactionIndex": 0,
"value"
:
receipt
.
value
'value'
:
receipt
.
value
// "value":"0xf3dbb76162000" // 4290000000000000
// "value":"0xf3dbb76162000" // 4290000000000000
// "v": "0x25", // 37
// "v": "0x25", // 37
// "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
// "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
...
@@ -172,8 +158,8 @@ Transactions.prototype.eth_getTransactionByBlockHashAndIndex = function (payload
...
@@ -172,8 +158,8 @@ Transactions.prototype.eth_getTransactionByBlockHashAndIndex = function (payload
r
.
to
=
receipt
.
to
r
.
to
=
receipt
.
to
}
}
if
(
r
.
value
===
"0x"
)
{
if
(
r
.
value
===
'0x'
)
{
r
.
value
=
"0x0"
r
.
value
=
'0x0'
}
}
cb
(
null
,
r
)
cb
(
null
,
r
)
...
@@ -184,7 +170,7 @@ Transactions.prototype.eth_getTransactionByBlockNumberAndIndex = function (paylo
...
@@ -184,7 +170,7 @@ Transactions.prototype.eth_getTransactionByBlockNumberAndIndex = function (paylo
const
txIndex
=
payload
.
params
[
1
]
const
txIndex
=
payload
.
params
[
1
]
var
txBlock
=
executionContext
.
blocks
[
payload
.
params
[
0
]]
var
txBlock
=
executionContext
.
blocks
[
payload
.
params
[
0
]]
const
txHash
=
"0x"
+
txBlock
.
transactions
[
w
eb3
.
utils
.
toDecimal
(
txIndex
)].
hash
().
toString
(
'hex'
)
const
txHash
=
'0x'
+
txBlock
.
transactions
[
W
eb3
.
utils
.
toDecimal
(
txIndex
)].
hash
().
toString
(
'hex'
)
executionContext
.
web3
().
eth
.
getTransactionReceipt
(
txHash
,
(
error
,
receipt
)
=>
{
executionContext
.
web3
().
eth
.
getTransactionReceipt
(
txHash
,
(
error
,
receipt
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -193,17 +179,17 @@ Transactions.prototype.eth_getTransactionByBlockNumberAndIndex = function (paylo
...
@@ -193,17 +179,17 @@ Transactions.prototype.eth_getTransactionByBlockNumberAndIndex = function (paylo
// TODO: params to add later
// TODO: params to add later
let
r
=
{
let
r
=
{
'blockHash'
:
"0x"
+
txBlock
.
hash
().
toString
(
'hex'
),
'blockHash'
:
'0x'
+
txBlock
.
hash
().
toString
(
'hex'
),
'blockNumber'
:
"0x"
+
txBlock
.
header
.
number
.
toString
(
'hex'
),
'blockNumber'
:
'0x'
+
txBlock
.
header
.
number
.
toString
(
'hex'
),
'from'
:
receipt
.
from
,
'from'
:
receipt
.
from
,
'gas'
:
w
eb3
.
utils
.
toHex
(
receipt
.
gas
),
'gas'
:
W
eb3
.
utils
.
toHex
(
receipt
.
gas
),
// 'gasPrice': '2000000000000', // 0x123
// 'gasPrice': '2000000000000', // 0x123
"gasPrice"
:
"0x4a817c800"
,
// 20000000000
'gasPrice'
:
'0x4a817c800'
,
// 20000000000
'hash'
:
receipt
.
transactionHash
,
'hash'
:
receipt
.
transactionHash
,
'input'
:
receipt
.
input
,
'input'
:
receipt
.
input
,
// "nonce": 2, // 0x15
// "nonce": 2, // 0x15
// "transactionIndex": 0,
// "transactionIndex": 0,
"value"
:
receipt
.
value
'value'
:
receipt
.
value
// "value":"0xf3dbb76162000" // 4290000000000000
// "value":"0xf3dbb76162000" // 4290000000000000
// "v": "0x25", // 37
// "v": "0x25", // 37
// "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
// "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
...
@@ -214,12 +200,12 @@ Transactions.prototype.eth_getTransactionByBlockNumberAndIndex = function (paylo
...
@@ -214,12 +200,12 @@ Transactions.prototype.eth_getTransactionByBlockNumberAndIndex = function (paylo
r
.
to
=
receipt
.
to
r
.
to
=
receipt
.
to
}
}
if
(
r
.
value
===
"0x"
)
{
if
(
r
.
value
===
'0x'
)
{
r
.
value
=
"0x0"
r
.
value
=
'0x0'
}
}
cb
(
null
,
r
)
cb
(
null
,
r
)
})
})
}
}
module
.
exports
=
Transactions
module
.
exports
=
Transactions
\ No newline at end of file
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