Commit 5fd9cbf7 authored by yann300's avatar yann300

add optional param

parent cdc7045a
......@@ -73,10 +73,13 @@ function extractStateDefinitions (contractName, sourcesList, contracts) {
* return state var and type definition of all the contracts from the given @args sourcesList
*
* @param {Object} sourcesList - sources list (containing root AST node)
* @param {Object} [contracts] - map of contract definitions (contains contractsById, contractsByName)
* @return {Object} - returns a mapping between contract name and contract state
*/
function extractStatesDefinitions (sourcesList) {
var contracts = extractContractDefinitions(sourcesList)
function extractStatesDefinitions (sourcesList, contracts) {
if (!contracts) {
contracts = extractContractDefinitions(sourcesList)
}
var ret = {}
for (var contract in contracts.contractsById) {
var name = contracts.contractsById[contract].attributes.name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment