Skip to content
Snippets Groups Projects
Commit 6344dd34 authored by Cédric Moreau's avatar Cédric Moreau Committed by Hugo Trentesaux
Browse files

fix: other keywords can now safely be used in a TX comment as well

parent cf749106
No related branches found
No related tags found
No related merge requests found
...@@ -50,27 +50,27 @@ export class BlockParser extends GenericParser { ...@@ -50,27 +50,27 @@ export class BlockParser extends GenericParser {
{ prop: "membersCount", regexp: CommonConstants.BLOCK.MEMBERS_COUNT }, { prop: "membersCount", regexp: CommonConstants.BLOCK.MEMBERS_COUNT },
{ {
prop: "identities", prop: "identities",
regexp: /Identities:\n([\s\S]*)Joiners/, regexp: /Identities:\n([\s\S]*?)Joiners/,
parser: splitAndMatch("\n", CommonConstants.IDENTITY.INLINE), parser: splitAndMatch("\n", CommonConstants.IDENTITY.INLINE),
}, },
{ {
prop: "joiners", prop: "joiners",
regexp: /Joiners:\n([\s\S]*)Actives/, regexp: /Joiners:\n([\s\S]*?)Actives/,
parser: splitAndMatch("\n", CommonConstants.BLOCK.JOINER), parser: splitAndMatch("\n", CommonConstants.BLOCK.JOINER),
}, },
{ {
prop: "actives", prop: "actives",
regexp: /Actives:\n([\s\S]*)Leavers/, regexp: /Actives:\n([\s\S]*?)Leavers/,
parser: splitAndMatch("\n", CommonConstants.BLOCK.ACTIVE), parser: splitAndMatch("\n", CommonConstants.BLOCK.ACTIVE),
}, },
{ {
prop: "leavers", prop: "leavers",
regexp: /Leavers:\n([\s\S]*)Excluded/, regexp: /Leavers:\n([\s\S]*?)Excluded/,
parser: splitAndMatch("\n", CommonConstants.BLOCK.LEAVER), parser: splitAndMatch("\n", CommonConstants.BLOCK.LEAVER),
}, },
{ {
prop: "revoked", prop: "revoked",
regexp: /Revoked:\n([\s\S]*)Excluded/, regexp: /Revoked:\n([\s\S]*?)Excluded/,
parser: splitAndMatch("\n", CommonConstants.BLOCK.REVOCATION), parser: splitAndMatch("\n", CommonConstants.BLOCK.REVOCATION),
}, },
{ {
...@@ -80,12 +80,12 @@ export class BlockParser extends GenericParser { ...@@ -80,12 +80,12 @@ export class BlockParser extends GenericParser {
}, },
{ {
prop: "certifications", prop: "certifications",
regexp: /Certifications:\n([\s\S]*)Transactions/, regexp: /Certifications:\n([\s\S]*?)Transactions/,
parser: splitAndMatch("\n", CommonConstants.CERT.OTHER.INLINE), parser: splitAndMatch("\n", CommonConstants.CERT.OTHER.INLINE),
}, },
{ {
prop: "transactions", prop: "transactions",
regexp: /Transactions:\n([\s\S]*)/, regexp: /Transactions:\n([\s\S]*)/, // No need for greedy "?" regexp capture, "Transaction" parsing is different from previous multiline fields
parser: extractTransactions, parser: extractTransactions,
}, },
{ prop: "inner_hash", regexp: CommonConstants.BLOCK.INNER_HASH }, { prop: "inner_hash", regexp: CommonConstants.BLOCK.INNER_HASH },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment