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
84bb6ef3
Unverified
Commit
84bb6ef3
authored
Aug 28, 2019
by
yann300
Committed by
GitHub
Aug 28, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1270 from ethereum/yann300-patch-26
Update extracting swarm hash
parents
27a4ca1f
1f2e92ba
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
package.json
remix-debug/package.json
+1
-1
package.json
remix-lib/package.json
+1
-1
util.js
remix-lib/src/util.js
+17
-2
No files found.
remix-debug/package.json
View file @
84bb6ef3
...
...
@@ -32,7 +32,7 @@
"@babel/preset-es2015"
:
"latest"
,
"@babel/preset-es2017"
:
"latest"
,
"@babel/preset-stage-0"
:
"^7.0.0"
,
"babel-eslint"
:
"^
10.0.0
"
,
"babel-eslint"
:
"^
7.1.1
"
,
"babelify"
:
"^10.0.0"
,
"notify-error"
:
"^1.2.0"
,
"solc"
:
"^0.5.0"
,
...
...
remix-lib/package.json
View file @
84bb6ef3
...
...
@@ -32,7 +32,7 @@
"@babel/preset-es2015"
:
"latest"
,
"@babel/preset-es2017"
:
"latest"
,
"@babel/preset-stage-0"
:
"^7.0.0"
,
"babel-eslint"
:
"^
10.0.0
"
,
"babel-eslint"
:
"^
7.1.1
"
,
"babelify"
:
"^10.0.0"
,
"standard"
:
"^7.0.1"
,
"tape"
:
"^4.6.0"
...
...
remix-lib/src/util.js
View file @
84bb6ef3
...
...
@@ -176,6 +176,21 @@ module.exports = {
},
/**
* return a regex which extract the swarmhash from the bytecode, from POC 0.3
*
* @return {RegEx}
*/
swarmHashExtractionPOC3
:
function
()
{
return
/a265627a7a72315820
([
0-9a-f
]{64})
64736f6c6343
([
0-9a-f
]{6})
0032$/
},
extractSwarmHash
:
function
(
value
)
{
value
=
value
.
replace
(
this
.
swarmHashExtraction
(),
''
)
value
=
value
.
replace
(
this
.
swarmHashExtractionPOC3
(),
''
)
return
value
},
/**
* Compare bytecode. return true if the code is equal (handle swarm hash and library references)
* @param {String} code1 - the bytecode that is actually deployed (contains resolved library reference and a potentially different swarmhash)
* @param {String} code2 - the bytecode generated by the compiler (contains unresolved library reference and a potentially different swarmhash)
...
...
@@ -198,8 +213,8 @@ module.exports = {
code2
=
replaceLibReference
(
code2
,
pos
)
code1
=
replaceLibReference
(
code1
,
pos
)
}
code1
=
code1
.
replace
(
this
.
swarmHashExtraction
(),
''
)
code2
=
code2
.
replace
(
this
.
swarmHashExtraction
(),
''
)
code1
=
this
.
extractSwarmHash
(
code1
)
code2
=
this
.
extractSwarmHash
(
code2
)
if
(
code1
&&
code2
&&
code1
.
indexOf
(
code2
)
===
0
)
{
return
true
}
...
...
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