Skip to content

Commit

Permalink
assume metadatas only for specific policy/asset when 721 or 20
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromtcosta committed Apr 3, 2023
1 parent c09e525 commit 725934d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/neo4j/multiAsset/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,25 @@ export const metadata = (driver: Driver) => ({
for (const meta of metadatas) {
const metaObjs = JSON.parse(meta) as any[];
for (const metaObj of metaObjs) {
const obj = {
key: metaObj.label,
metadata: metaObj.map_json
};

prev[key].push(obj);
if (metaObj.label === "721" || metaObj.label === "20") {
if (metaObj.map_json[policy]) {
if (metaObj.map_json[policy][assetName]) {
const obj = {
key: metaObj.label,
metadata: metaObj.map_json
};

prev[key].push(obj);
}
}
} else {
const obj = {
key: metaObj.label,
metadata: metaObj.map_json
};

prev[key].push(obj);
}
}
}
}
Expand Down

0 comments on commit 725934d

Please sign in to comment.