Skip to content

Commit 02840e1

Browse files
committed
fixup! [libevmasm] Add support to import evm assembly json.
1 parent e2e7c2b commit 02840e1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

libevmasm/Assembly.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,16 @@ class Assembly
152152
/// Create a JSON representation of the assembly.
153153
Json::Value assemblyJSON(std::map<std::string, unsigned> const& _sourceIndices, bool _includeSourceList = true) const;
154154

155-
/// Loads the JSON representation of assembly.
155+
/// Constructs an @a Assembly from the serialized JSON representation.
156156
/// @param _json JSON object containing assembly in the format produced by assemblyJSON().
157-
/// @param _sourceList list of source names (used to supply the source-list from the root-assembly object to sub-assemblies).
158-
/// @param _level this function might be called recursively, _level reflects the nesting level.
159-
/// @returns Resulting Assembly object loaded from given json.
157+
/// @param _sourceList List of source files the assembly was built from. When the JSON represents
158+
/// the root assembly, the function will read it from the 'sourceList' field and the parameter
159+
/// must be empty. It is only used to pass the list down to recursive calls.
160+
/// @param _level Nesting level of the current assembly in the assembly tree. The root is
161+
/// at level 0 and the value increases down the tree. Necessary to distinguish between creation
162+
/// and deployed objects.
163+
/// @returns Created @a Assembly and the source list read from the 'sourceList' field of the root
164+
/// assembly.
160165
static std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> fromJSON(
161166
Json::Value const& _json,
162167
std::vector<std::string> const& _sourceList = {},

0 commit comments

Comments
 (0)