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
eed8fcd9
Commit
eed8fcd9
authored
Dec 02, 2019
by
aniket-engg
Committed by
Aniket
Dec 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test fixes and petersburg,istanbul addition
parent
64c1e1e4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
23 deletions
+20
-23
execution-context.js
remix-lib/src/execution/execution-context.js
+7
-5
txRunner.js
remix-lib/src/execution/txRunner.js
+6
-11
web3VmProvider.js
remix-lib/src/web3Provider/web3VmProvider.js
+5
-5
genesis.js
remix-simulator/src/genesis.js
+1
-1
txProcess.js
remix-simulator/src/methods/txProcess.js
+1
-1
No files found.
remix-lib/src/execution/execution-context.js
View file @
eed8fcd9
...
@@ -95,7 +95,9 @@ function createVm (hardfork) {
...
@@ -95,7 +95,9 @@ function createVm (hardfork) {
var
vms
=
{
var
vms
=
{
byzantium
:
createVm
(
'byzantium'
),
byzantium
:
createVm
(
'byzantium'
),
constantinople
:
createVm
(
'constantinople'
)
constantinople
:
createVm
(
'constantinople'
),
petersburg
:
createVm
(
'petersburg'
),
istanbul
:
createVm
(
'istanbul'
)
}
}
var
mainNetGenesisHash
=
'0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3'
var
mainNetGenesisHash
=
'0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3'
...
@@ -141,7 +143,7 @@ function ExecutionContext () {
...
@@ -141,7 +143,7 @@ function ExecutionContext () {
}
}
this
.
web3
=
function
()
{
this
.
web3
=
function
()
{
return
this
.
isVM
()
?
vms
.
constantinople
.
web3vm
:
web3
return
this
.
isVM
()
?
vms
.
istanbul
.
web3vm
:
web3
}
}
this
.
detectNetwork
=
function
(
callback
)
{
this
.
detectNetwork
=
function
(
callback
)
{
...
@@ -196,7 +198,7 @@ function ExecutionContext () {
...
@@ -196,7 +198,7 @@ function ExecutionContext () {
}
}
this
.
vm
=
function
()
{
this
.
vm
=
function
()
{
return
vms
.
constantinople
.
vm
return
vms
.
istanbul
.
vm
}
}
this
.
setContext
=
function
(
context
,
endPointUrl
,
confirmCb
,
infoCb
)
{
this
.
setContext
=
function
(
context
,
endPointUrl
,
confirmCb
,
infoCb
)
{
...
@@ -209,8 +211,8 @@ function ExecutionContext () {
...
@@ -209,8 +211,8 @@ function ExecutionContext () {
if
(
context
===
'vm'
)
{
if
(
context
===
'vm'
)
{
executionContext
=
context
executionContext
=
context
vms
.
constantinople
.
stateManager
.
revert
(()
=>
{
vms
.
istanbul
.
stateManager
.
revert
(()
=>
{
vms
.
constantinople
.
stateManager
.
checkpoint
(()
=>
{})
vms
.
istanbul
.
stateManager
.
checkpoint
(()
=>
{})
})
})
self
.
event
.
trigger
(
'contextChanged'
,
[
'vm'
])
self
.
event
.
trigger
(
'contextChanged'
,
[
'vm'
])
return
cb
()
return
cb
()
...
...
remix-lib/src/execution/txRunner.js
View file @
eed8fcd9
...
@@ -115,7 +115,6 @@ class TxRunner {
...
@@ -115,7 +115,6 @@ class TxRunner {
data
:
Buffer
.
from
(
data
.
slice
(
2
),
'hex'
)
data
:
Buffer
.
from
(
data
.
slice
(
2
),
'hex'
)
})
})
tx
.
sign
(
account
.
privateKey
)
tx
.
sign
(
account
.
privateKey
)
const
coinbases
=
[
'0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a'
,
'0x8945a1288dc78a6d8952a92c77aee6730b414778'
,
'0x94d76e24f818426ae84aa404140e8d5f60e10e7e'
]
const
coinbases
=
[
'0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a'
,
'0x8945a1288dc78a6d8952a92c77aee6730b414778'
,
'0x94d76e24f818426ae84aa404140e8d5f60e10e7e'
]
const
difficulties
=
[
new
BN
(
'69762765929000'
,
10
),
new
BN
(
'70762765929000'
,
10
),
new
BN
(
'71762765929000'
,
10
)]
const
difficulties
=
[
new
BN
(
'69762765929000'
,
10
),
new
BN
(
'70762765929000'
,
10
),
new
BN
(
'71762765929000'
,
10
)]
var
block
=
new
EthJSBlock
({
var
block
=
new
EthJSBlock
({
...
@@ -146,24 +145,20 @@ class TxRunner {
...
@@ -146,24 +145,20 @@ class TxRunner {
}
}
runBlockInVm
(
tx
,
block
,
callback
)
{
runBlockInVm
(
tx
,
block
,
callback
)
{
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
},
function
(
err
,
results
)
{
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
}).
then
(
function
(
results
)
{
err
=
err
?
err
.
message
:
err
if
(
err
)
{
return
callback
(
err
)
}
let
result
=
results
.
results
[
0
]
let
result
=
results
.
results
[
0
]
if
(
result
)
{
if
(
result
)
{
result
.
status
=
'0x'
+
result
.
vm
.
exception
.
toString
(
16
)
result
.
status
=
'0x'
+
(
result
.
execResult
.
exceptionError
?
0
:
1
)
}
}
executionContext
.
addBlock
(
block
)
executionContext
.
addBlock
(
block
)
executionContext
.
trackTx
(
'0x'
+
tx
.
hash
().
toString
(
'hex'
),
block
)
executionContext
.
trackTx
(
'0x'
+
tx
.
hash
().
toString
(
'hex'
),
block
)
callback
(
null
,
{
callback
(
err
,
{
result
:
result
,
result
:
result
,
transactionHash
:
ethJSUtil
.
bufferToHex
(
Buffer
.
from
(
tx
.
hash
()))
transactionHash
:
ethJSUtil
.
bufferToHex
(
Buffer
.
from
(
tx
.
hash
()))
})
})
}).
catch
(
function
(
err
)
{
err
=
err
?
err
.
message
:
err
callback
(
err
)
})
})
}
}
...
...
remix-lib/src/web3Provider/web3VmProvider.js
View file @
eed8fcd9
...
@@ -107,8 +107,8 @@ web3VmProvider.prototype.txProcessed = function (self, data) {
...
@@ -107,8 +107,8 @@ web3VmProvider.prototype.txProcessed = function (self, data) {
self
.
vmTraces
[
self
.
processingHash
].
gas
=
'0x'
+
data
.
gasUsed
.
toString
(
16
)
self
.
vmTraces
[
self
.
processingHash
].
gas
=
'0x'
+
data
.
gasUsed
.
toString
(
16
)
var
logs
=
[]
var
logs
=
[]
for
(
var
l
in
data
.
vm
.
logs
)
{
for
(
var
l
in
data
.
execResult
.
logs
)
{
var
log
=
data
.
vm
.
logs
[
l
]
var
log
=
data
.
execResult
.
logs
[
l
]
var
topics
=
[]
var
topics
=
[]
if
(
log
[
1
].
length
>
0
)
{
if
(
log
[
1
].
length
>
0
)
{
for
(
var
k
in
log
[
1
])
{
for
(
var
k
in
log
[
1
])
{
...
@@ -126,14 +126,14 @@ web3VmProvider.prototype.txProcessed = function (self, data) {
...
@@ -126,14 +126,14 @@ web3VmProvider.prototype.txProcessed = function (self, data) {
}
}
self
.
txsReceipt
[
self
.
processingHash
].
logs
=
logs
self
.
txsReceipt
[
self
.
processingHash
].
logs
=
logs
self
.
txsReceipt
[
self
.
processingHash
].
transactionHash
=
self
.
processingHash
self
.
txsReceipt
[
self
.
processingHash
].
transactionHash
=
self
.
processingHash
self
.
txsReceipt
[
self
.
processingHash
].
status
=
'0x'
+
data
.
vm
.
exception
.
toString
(
16
)
self
.
txsReceipt
[
self
.
processingHash
].
status
=
'0x'
+
(
data
.
execResult
.
exceptionError
?
0
:
1
)
if
(
data
.
createdAddress
)
{
if
(
data
.
createdAddress
)
{
var
address
=
util
.
hexConvert
(
data
.
createdAddress
)
var
address
=
util
.
hexConvert
(
data
.
createdAddress
)
self
.
vmTraces
[
self
.
processingHash
].
return
=
address
self
.
vmTraces
[
self
.
processingHash
].
return
=
address
self
.
txsReceipt
[
self
.
processingHash
].
contractAddress
=
address
self
.
txsReceipt
[
self
.
processingHash
].
contractAddress
=
address
}
else
if
(
data
.
vm
.
return
)
{
}
else
if
(
data
.
execResult
.
returnValue
)
{
self
.
vmTraces
[
self
.
processingHash
].
return
=
util
.
hexConvert
(
data
.
vm
.
return
)
self
.
vmTraces
[
self
.
processingHash
].
return
=
util
.
hexConvert
(
data
.
execResult
.
returnValue
)
}
else
{
}
else
{
self
.
vmTraces
[
self
.
processingHash
].
return
=
'0x'
self
.
vmTraces
[
self
.
processingHash
].
return
=
'0x'
}
}
...
...
remix-simulator/src/genesis.js
View file @
eed8fcd9
...
@@ -17,7 +17,7 @@ function generateBlock () {
...
@@ -17,7 +17,7 @@ function generateBlock () {
uncleHeaders
:
[]
uncleHeaders
:
[]
})
})
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
}
,
function
()
{
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
}
).
then
(
function
()
{
executionContext
.
addBlock
(
block
)
executionContext
.
addBlock
(
block
)
})
})
}
}
...
...
remix-simulator/src/methods/txProcess.js
View file @
eed8fcd9
...
@@ -9,7 +9,7 @@ function runCall (payload, from, to, data, value, gasLimit, txRunner, callbacks,
...
@@ -9,7 +9,7 @@ function runCall (payload, from, to, data, value, gasLimit, txRunner, callbacks,
return
callback
(
err
)
return
callback
(
err
)
}
}
let
toReturn
=
'0x'
+
result
.
result
.
vm
.
return
.
toString
(
'hex'
)
let
toReturn
=
'0x'
+
result
.
result
.
execResult
.
returnValue
.
toString
(
'hex'
)
if
(
toReturn
===
'0x'
)
{
if
(
toReturn
===
'0x'
)
{
toReturn
=
'0x0'
toReturn
=
'0x0'
}
}
...
...
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