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
377d8e17
Unverified
Commit
377d8e17
authored
Oct 02, 2018
by
yann300
Committed by
GitHub
Oct 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #975 from noelyoo/safe-buffer
new Buffer is deprecated and unsafe
parents
6c633748
82df8d07
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
9 deletions
+9
-9
localDecoder.js
remix-debug/test/decoder/localDecoder.js
+1
-1
mapping.js
remix-debug/test/decoder/stateTests/mapping.js
+1
-1
vmCall.js
remix-debug/test/decoder/vmCall.js
+1
-1
tests.js
remix-debug/test/tests.js
+1
-1
vmCall.js
remix-debug/test/vmCall.js
+1
-1
codeResolver.js
remix-lib/src/code/codeResolver.js
+1
-1
eventsDecoder.js
remix-lib/src/execution/eventsDecoder.js
+1
-1
txRunner.js
remix-lib/src/execution/txRunner.js
+2
-2
No files found.
remix-debug/test/decoder/localDecoder.js
View file @
377d8e17
...
@@ -14,7 +14,7 @@ var compilerInput = remixLib.helpers.compiler.compilerInput
...
@@ -14,7 +14,7 @@ var compilerInput = remixLib.helpers.compiler.compilerInput
tape
(
'solidity'
,
function
(
t
)
{
tape
(
'solidity'
,
function
(
t
)
{
t
.
test
(
'local decoder'
,
function
(
st
)
{
t
.
test
(
'local decoder'
,
function
(
st
)
{
var
privateKey
=
new
Buffer
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
,
'hex'
)
var
privateKey
=
Buffer
.
from
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
,
'hex'
)
var
vm
=
vmCall
.
initVM
(
st
,
privateKey
)
var
vm
=
vmCall
.
initVM
(
st
,
privateKey
)
test
(
st
,
vm
,
privateKey
)
test
(
st
,
vm
,
privateKey
)
})
})
...
...
remix-debug/test/decoder/stateTests/mapping.js
View file @
377d8e17
...
@@ -11,7 +11,7 @@ var StorageViewer = require('../../../src/storage/storageViewer')
...
@@ -11,7 +11,7 @@ var StorageViewer = require('../../../src/storage/storageViewer')
module
.
exports
=
function
testMappingStorage
(
st
,
cb
)
{
module
.
exports
=
function
testMappingStorage
(
st
,
cb
)
{
var
mappingStorage
=
require
(
'../contracts/mappingStorage'
)
var
mappingStorage
=
require
(
'../contracts/mappingStorage'
)
var
privateKey
=
new
Buffer
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
,
'hex'
)
var
privateKey
=
Buffer
.
from
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
,
'hex'
)
var
vm
=
vmCall
.
initVM
(
st
,
privateKey
)
var
vm
=
vmCall
.
initVM
(
st
,
privateKey
)
var
output
=
compiler
.
compileStandardWrapper
(
compilerInput
(
mappingStorage
.
contract
))
var
output
=
compiler
.
compileStandardWrapper
(
compilerInput
(
mappingStorage
.
contract
))
output
=
JSON
.
parse
(
output
)
output
=
JSON
.
parse
(
output
)
...
...
remix-debug/test/decoder/vmCall.js
View file @
377d8e17
...
@@ -12,7 +12,7 @@ function sendTx (vm, from, to, value, data, cb) {
...
@@ -12,7 +12,7 @@ function sendTx (vm, from, to, value, data, cb) {
gasLimit
:
new
BN
(
3000000
,
10
),
gasLimit
:
new
BN
(
3000000
,
10
),
to
:
to
,
to
:
to
,
value
:
new
BN
(
value
,
10
),
value
:
new
BN
(
value
,
10
),
data
:
new
Buffer
(
data
,
'hex'
)
data
:
Buffer
.
from
(
data
,
'hex'
)
})
})
tx
.
sign
(
from
.
privateKey
)
tx
.
sign
(
from
.
privateKey
)
var
block
=
new
Block
({
var
block
=
new
Block
({
...
...
remix-debug/test/tests.js
View file @
377d8e17
...
@@ -15,7 +15,7 @@ var BreakpointManager = remixLib.code.BreakpointManager
...
@@ -15,7 +15,7 @@ var BreakpointManager = remixLib.code.BreakpointManager
tape
(
'debug contract'
,
function
(
t
)
{
tape
(
'debug contract'
,
function
(
t
)
{
t
.
plan
(
12
)
t
.
plan
(
12
)
var
privateKey
=
new
Buffer
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
,
'hex'
)
var
privateKey
=
Buffer
.
from
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
,
'hex'
)
var
vm
=
vmCall
.
initVM
(
t
,
privateKey
)
var
vm
=
vmCall
.
initVM
(
t
,
privateKey
)
var
output
=
compiler
.
compileStandardWrapper
(
compilerInput
(
ballot
))
var
output
=
compiler
.
compileStandardWrapper
(
compilerInput
(
ballot
))
output
=
JSON
.
parse
(
output
)
output
=
JSON
.
parse
(
output
)
...
...
remix-debug/test/vmCall.js
View file @
377d8e17
...
@@ -12,7 +12,7 @@ function sendTx (vm, from, to, value, data, cb) {
...
@@ -12,7 +12,7 @@ function sendTx (vm, from, to, value, data, cb) {
gasLimit
:
new
BN
(
3000000
,
10
),
gasLimit
:
new
BN
(
3000000
,
10
),
to
:
to
,
to
:
to
,
value
:
new
BN
(
value
,
10
),
value
:
new
BN
(
value
,
10
),
data
:
new
Buffer
(
data
,
'hex'
)
data
:
Buffer
.
from
(
data
,
'hex'
)
})
})
tx
.
sign
(
from
.
privateKey
)
tx
.
sign
(
from
.
privateKey
)
var
block
=
new
Block
({
var
block
=
new
Block
({
...
...
remix-lib/src/code/codeResolver.js
View file @
377d8e17
...
@@ -48,7 +48,7 @@ CodeResolver.prototype.cacheExecutingCode = function (address, hexCode) {
...
@@ -48,7 +48,7 @@ CodeResolver.prototype.cacheExecutingCode = function (address, hexCode) {
}
}
CodeResolver
.
prototype
.
formatCode
=
function
(
hexCode
)
{
CodeResolver
.
prototype
.
formatCode
=
function
(
hexCode
)
{
var
code
=
codeUtils
.
nameOpCodes
(
new
Buffer
(
hexCode
.
substring
(
2
),
'hex'
))
var
code
=
codeUtils
.
nameOpCodes
(
Buffer
.
from
(
hexCode
.
substring
(
2
),
'hex'
))
return
{
return
{
code
:
code
[
0
],
code
:
code
[
0
],
instructionsIndexByBytesOffset
:
code
[
1
]
instructionsIndexByBytesOffset
:
code
[
1
]
...
...
remix-lib/src/execution/eventsDecoder.js
View file @
377d8e17
...
@@ -42,7 +42,7 @@ class EventsDecoder {
...
@@ -42,7 +42,7 @@ class EventsDecoder {
var
abi
=
new
ethers
.
Interface
(
contract
.
abi
)
var
abi
=
new
ethers
.
Interface
(
contract
.
abi
)
for
(
var
e
in
abi
.
events
)
{
for
(
var
e
in
abi
.
events
)
{
var
event
=
abi
.
events
[
e
]
var
event
=
abi
.
events
[
e
]
eventABI
[
ethJSUtil
.
sha3
(
new
Buffer
(
event
.
signature
)).
toString
(
'hex'
)]
=
{
event
:
event
.
name
,
inputs
:
event
.
inputs
,
object
:
event
}
eventABI
[
ethJSUtil
.
sha3
(
Buffer
.
from
(
event
.
signature
)).
toString
(
'hex'
)]
=
{
event
:
event
.
name
,
inputs
:
event
.
inputs
,
object
:
event
}
}
}
return
eventABI
return
eventABI
}
}
...
...
remix-lib/src/execution/txRunner.js
View file @
377d8e17
...
@@ -100,7 +100,7 @@ class TxRunner {
...
@@ -100,7 +100,7 @@ class TxRunner {
gasLimit
:
new
BN
(
gasLimit
,
10
),
gasLimit
:
new
BN
(
gasLimit
,
10
),
to
:
to
,
to
:
to
,
value
:
new
BN
(
value
,
10
),
value
:
new
BN
(
value
,
10
),
data
:
new
Buffer
(
data
.
slice
(
2
),
'hex'
)
data
:
Buffer
.
from
(
data
.
slice
(
2
),
'hex'
)
})
})
tx
.
sign
(
account
.
privateKey
)
tx
.
sign
(
account
.
privateKey
)
...
@@ -133,7 +133,7 @@ class TxRunner {
...
@@ -133,7 +133,7 @@ class TxRunner {
}
}
callback
(
err
,
{
callback
(
err
,
{
result
:
result
,
result
:
result
,
transactionHash
:
ethJSUtil
.
bufferToHex
(
new
Buffer
(
tx
.
hash
()))
transactionHash
:
ethJSUtil
.
bufferToHex
(
Buffer
.
from
(
tx
.
hash
()))
})
})
})
})
}
}
...
...
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