Skip to content

Commit

Permalink
fix(slc) Add contract data to .slc archive
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed Oct 28, 2021
1 parent 4e250d0 commit 14378e9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/cicero-core/src/instancesaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,19 @@ class InstanceSaver {
throw new Error('runtime is required and must be a string');
}

const metadata = instance.getMetadata().createTargetMetadata(runtime);

let zip = new JSZip();

// save the metadata
const metadata = instance.getMetadata().createTargetMetadata(runtime);

let packageFileContents = JSON.stringify(metadata.getPackageJson());
zip.file('package.json', packageFileContents, options);

// save the contract data
const dataContents = JSON.stringify(instance.getData());

zip.file('data.json', dataContents, options);

// save the grammar
zip.file('text/', null, Object.assign({}, options, {
dir: true
Expand Down

0 comments on commit 14378e9

Please sign in to comment.