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
19e62c9f
Unverified
Commit
19e62c9f
authored
Jul 27, 2018
by
yann300
Committed by
GitHub
Jul 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1425 from ethereum/librarieDeployCustom
Json file include network id
parents
aa425d4f
f07e95ee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
config.yml
.circleci/config.yml
+4
-4
compiler-metadata.js
src/app/files/compiler-metadata.js
+27
-9
No files found.
.circleci/config.yml
View file @
19e62c9f
...
@@ -26,10 +26,10 @@ jobs:
...
@@ -26,10 +26,10 @@ jobs:
-
checkout
-
checkout
-
restore_cache
:
-
restore_cache
:
keys
:
keys
:
-
dep-bundle-1
6
-{{ checksum "package.json" }}
-
dep-bundle-1
7
-{{ checksum "package.json" }}
-
run
:
npm install
-
run
:
npm install
-
save_cache
:
-
save_cache
:
key
:
dep-bundle-1
6
-{{ checksum "package.json" }}
key
:
dep-bundle-1
7
-{{ checksum "package.json" }}
paths
:
paths
:
-
~/repo/node_modules
-
~/repo/node_modules
-
run
:
npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
-
run
:
npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
...
@@ -46,10 +46,10 @@ jobs:
...
@@ -46,10 +46,10 @@ jobs:
-
checkout
-
checkout
-
restore_cache
:
-
restore_cache
:
keys
:
keys
:
-
dep-bundle-1
1
-{{ checksum "package.json" }}
-
dep-bundle-1
2
-{{ checksum "package.json" }}
-
run
:
npm install
-
run
:
npm install
-
save_cache
:
-
save_cache
:
key
:
dep-bundle-1
1
-{{ checksum "package.json" }}
key
:
dep-bundle-1
2
-{{ checksum "package.json" }}
paths
:
paths
:
-
~/repo/node_modules
-
~/repo/node_modules
-
run
:
npm run build_debugger
-
run
:
npm run build_debugger
...
...
src/app/files/compiler-metadata.js
View file @
19e62c9f
'use strict'
'use strict'
var
executionContext
=
require
(
'../../execution-context'
)
class
CompilerMetadata
{
class
CompilerMetadata
{
constructor
(
events
,
opts
)
{
constructor
(
events
,
opts
)
{
var
self
=
this
var
self
=
this
self
.
_events
=
events
self
.
_events
=
events
self
.
_opts
=
opts
self
.
_opts
=
opts
self
.
networks
=
[
'VM:-'
,
'main:1'
,
'ropsten:3'
,
'rinkeby:4'
,
'kovan:42'
]
}
}
syncContractMetadata
()
{
syncContractMetadata
()
{
var
self
=
this
var
self
=
this
self
.
_events
.
compiler
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
self
.
_events
.
compiler
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
if
(
success
)
{
if
(
!
success
)
return
var
provider
=
self
.
_opts
.
fileManager
.
currentFileProvider
()
var
provider
=
self
.
_opts
.
fileManager
.
currentFileProvider
()
var
path
=
self
.
_opts
.
fileManager
.
currentPath
()
var
path
=
self
.
_opts
.
fileManager
.
currentPath
()
if
(
provider
&&
path
)
{
if
(
provider
&&
path
)
{
...
@@ -25,10 +27,25 @@ class CompilerMetadata {
...
@@ -25,10 +27,25 @@ class CompilerMetadata {
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
}
}
self
.
networks
.
forEach
((
network
)
=>
{
metadata
[
network
]
=
self
.
_syncContext
(
contract
,
metadata
[
network
]
||
{})
})
provider
.
set
(
fileName
,
JSON
.
stringify
(
metadata
,
null
,
'
\
t'
))
}
})
})
}
})
}
_syncContext
(
contract
,
metadata
)
{
var
linkReferences
=
metadata
[
'linkReferences'
]
var
linkReferences
=
metadata
[
'linkReferences'
]
var
autoDeployLib
=
metadata
[
'autoDeployLib'
]
var
autoDeployLib
=
metadata
[
'autoDeployLib'
]
if
(
!
linkReferences
)
linkReferences
=
{}
if
(
!
linkReferences
)
linkReferences
=
{}
if
(
autoDeployLib
===
undefined
)
autoDeployLib
=
true
if
(
autoDeployLib
===
undefined
)
autoDeployLib
=
true
for
(
var
libFile
in
contract
.
object
.
evm
.
bytecode
.
linkReferences
)
{
for
(
var
libFile
in
contract
.
object
.
evm
.
bytecode
.
linkReferences
)
{
if
(
!
linkReferences
[
libFile
])
linkReferences
[
libFile
]
=
{}
if
(
!
linkReferences
[
libFile
])
linkReferences
[
libFile
]
=
{}
for
(
var
lib
in
contract
.
object
.
evm
.
bytecode
.
linkReferences
[
libFile
])
{
for
(
var
lib
in
contract
.
object
.
evm
.
bytecode
.
linkReferences
[
libFile
])
{
...
@@ -39,13 +56,7 @@ class CompilerMetadata {
...
@@ -39,13 +56,7 @@ class CompilerMetadata {
}
}
metadata
[
'linkReferences'
]
=
linkReferences
metadata
[
'linkReferences'
]
=
linkReferences
metadata
[
'autoDeployLib'
]
=
autoDeployLib
metadata
[
'autoDeployLib'
]
=
autoDeployLib
provider
.
set
(
fileName
,
JSON
.
stringify
(
metadata
,
null
,
'
\
t'
))
return
metadata
}
})
})
}
}
})
}
}
metadataOf
(
contractName
,
callback
)
{
metadataOf
(
contractName
,
callback
)
{
...
@@ -53,16 +64,23 @@ class CompilerMetadata {
...
@@ -53,16 +64,23 @@ class CompilerMetadata {
var
provider
=
self
.
_opts
.
fileManager
.
currentFileProvider
()
var
provider
=
self
.
_opts
.
fileManager
.
currentFileProvider
()
var
path
=
self
.
_opts
.
fileManager
.
currentPath
()
var
path
=
self
.
_opts
.
fileManager
.
currentPath
()
if
(
provider
&&
path
)
{
if
(
provider
&&
path
)
{
executionContext
.
detectNetwork
((
err
,
{
id
,
name
}
=
{})
=>
{
if
(
err
)
{
console
.
log
(
err
)
}
else
{
var
fileName
=
path
+
'/'
+
contractName
+
'.json'
var
fileName
=
path
+
'/'
+
contractName
+
'.json'
provider
.
get
(
fileName
,
(
error
,
content
)
=>
{
provider
.
get
(
fileName
,
(
error
,
content
)
=>
{
if
(
error
)
return
callback
(
error
)
if
(
error
)
return
callback
(
error
)
try
{
try
{
callback
(
null
,
JSON
.
parse
(
content
))
var
metadata
=
JSON
.
parse
(
content
)
return
callback
(
null
,
metadata
[
name
+
':'
+
id
]
||
metadata
[
name
]
||
metadata
[
id
])
}
catch
(
e
)
{
}
catch
(
e
)
{
callback
(
e
.
message
)
callback
(
e
.
message
)
}
}
})
})
}
}
})
}
}
}
}
}
...
...
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