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

fix: keyword "Certifications" can now safely be used in a TX comment

parent 56c986b7
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,8 @@ import {BlockDTO} from "../../dto/BlockDTO" ...@@ -20,7 +20,8 @@ import {BlockDTO} from "../../dto/BlockDTO"
export class BlockParser extends GenericParser { export class BlockParser extends GenericParser {
constructor() { constructor() {
super([ super(
[
{ prop: "version", regexp: CommonConstants.BLOCK.VERSION }, { prop: "version", regexp: CommonConstants.BLOCK.VERSION },
{ prop: "type", regexp: CommonConstants.BLOCK.TYPE }, { prop: "type", regexp: CommonConstants.BLOCK.TYPE },
{ prop: "currency", regexp: CommonConstants.BLOCK.CURRENCY }, { prop: "currency", regexp: CommonConstants.BLOCK.CURRENCY },
...@@ -31,24 +32,67 @@ export class BlockParser extends GenericParser { ...@@ -31,24 +32,67 @@ export class BlockParser extends GenericParser {
{ prop: "dividend", regexp: CommonConstants.BLOCK.UD }, { prop: "dividend", regexp: CommonConstants.BLOCK.UD },
{ prop: "unitbase", regexp: CommonConstants.BLOCK.UNIT_BASE }, { prop: "unitbase", regexp: CommonConstants.BLOCK.UNIT_BASE },
{ prop: "issuer", regexp: CommonConstants.BLOCK.BLOCK_ISSUER }, { prop: "issuer", regexp: CommonConstants.BLOCK.BLOCK_ISSUER },
{prop: "issuersFrame", regexp: CommonConstants.BLOCK.BLOCK_ISSUERS_FRAME}, {
{prop: "issuersFrameVar", regexp: CommonConstants.BLOCK.BLOCK_ISSUERS_FRAME_VAR}, prop: "issuersFrame",
{prop: "issuersCount", regexp: CommonConstants.BLOCK.DIFFERENT_ISSUERS_COUNT}, regexp: CommonConstants.BLOCK.BLOCK_ISSUERS_FRAME,
},
{
prop: "issuersFrameVar",
regexp: CommonConstants.BLOCK.BLOCK_ISSUERS_FRAME_VAR,
},
{
prop: "issuersCount",
regexp: CommonConstants.BLOCK.DIFFERENT_ISSUERS_COUNT,
},
{ prop: "parameters", regexp: CommonConstants.BLOCK.PARAMETERS }, { prop: "parameters", regexp: CommonConstants.BLOCK.PARAMETERS },
{ prop: "previousHash", regexp: CommonConstants.BLOCK.PREV_HASH }, { prop: "previousHash", regexp: CommonConstants.BLOCK.PREV_HASH },
{ prop: "previousIssuer", regexp: CommonConstants.BLOCK.PREV_ISSUER }, { prop: "previousIssuer", regexp: CommonConstants.BLOCK.PREV_ISSUER },
{ prop: "membersCount", regexp: CommonConstants.BLOCK.MEMBERS_COUNT }, { prop: "membersCount", regexp: CommonConstants.BLOCK.MEMBERS_COUNT },
{prop: "identities", regexp: /Identities:\n([\s\S]*)Joiners/, parser: splitAndMatch('\n', CommonConstants.IDENTITY.INLINE)}, {
{prop: "joiners", regexp: /Joiners:\n([\s\S]*)Actives/, parser: splitAndMatch('\n', CommonConstants.BLOCK.JOINER)}, prop: "identities",
{prop: "actives", regexp: /Actives:\n([\s\S]*)Leavers/, parser: splitAndMatch('\n', CommonConstants.BLOCK.ACTIVE)}, regexp: /Identities:\n([\s\S]*)Joiners/,
{prop: "leavers", regexp: /Leavers:\n([\s\S]*)Excluded/, parser: splitAndMatch('\n', CommonConstants.BLOCK.LEAVER)}, parser: splitAndMatch("\n", CommonConstants.IDENTITY.INLINE),
{prop: "revoked", regexp: /Revoked:\n([\s\S]*)Excluded/, parser: splitAndMatch('\n', CommonConstants.BLOCK.REVOCATION)}, },
{prop: "excluded", regexp: /Excluded:\n([\s\S]*)Certifications/, parser: splitAndMatch('\n', CommonConstants.PUBLIC_KEY)}, {
{prop: "certifications", regexp: /Certifications:\n([\s\S]*)Transactions/, parser: splitAndMatch('\n', CommonConstants.CERT.OTHER.INLINE)}, prop: "joiners",
{prop: "transactions", regexp: /Transactions:\n([\s\S]*)/, parser: extractTransactions}, regexp: /Joiners:\n([\s\S]*)Actives/,
parser: splitAndMatch("\n", CommonConstants.BLOCK.JOINER),
},
{
prop: "actives",
regexp: /Actives:\n([\s\S]*)Leavers/,
parser: splitAndMatch("\n", CommonConstants.BLOCK.ACTIVE),
},
{
prop: "leavers",
regexp: /Leavers:\n([\s\S]*)Excluded/,
parser: splitAndMatch("\n", CommonConstants.BLOCK.LEAVER),
},
{
prop: "revoked",
regexp: /Revoked:\n([\s\S]*)Excluded/,
parser: splitAndMatch("\n", CommonConstants.BLOCK.REVOCATION),
},
{
prop: "excluded",
regexp: /Excluded:\n([\s\S]*?)Certifications/,
parser: splitAndMatch("\n", CommonConstants.PUBLIC_KEY),
},
{
prop: "certifications",
regexp: /Certifications:\n([\s\S]*)Transactions/,
parser: splitAndMatch("\n", CommonConstants.CERT.OTHER.INLINE),
},
{
prop: "transactions",
regexp: /Transactions:\n([\s\S]*)/,
parser: extractTransactions,
},
{ prop: "inner_hash", regexp: CommonConstants.BLOCK.INNER_HASH }, { prop: "inner_hash", regexp: CommonConstants.BLOCK.INNER_HASH },
{prop: "nonce", regexp: CommonConstants.BLOCK.NONCE} { prop: "nonce", regexp: CommonConstants.BLOCK.NONCE },
], rawer.getBlock) ],
rawer.getBlock
);
} }
_clean(obj:any) { _clean(obj:any) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment