Skip to content

Commit

Permalink
chore: updated id parse method
Browse files Browse the repository at this point in the history
  • Loading branch information
frazarshad committed May 15, 2024
1 parent a72a70a commit 004753d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mappings/events/vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ export const vaultsEventKit = (block: any, data: any, module: string, path: stri
);
}

const vaultGovernanceId = id.split('.').slice(0, 4).join('.') + '.governance';
const pathRegex = /^(published\.vaultFactory\.managers\.manager[0-9]+)\.vaults\.vault[0-9]+$/
const pathRegexMatch = path.match(pathRegex);
if (!pathRegexMatch) {
throw new Error('path format is invalid');
}
const vaultGovernanceId = pathRegexMatch[1] + '.governance';
const vaultManagerGovernance = await VaultManagerGovernance.get(vaultGovernanceId);

const oraclPriceId = `${denom}-USD`;
Expand Down

0 comments on commit 004753d

Please sign in to comment.