Skip to content

Commit

Permalink
fix: assetName requirement when minting a pool
Browse files Browse the repository at this point in the history
  • Loading branch information
cjkoepke committed Nov 14, 2024
1 parent dcbf07a commit 1edea6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,10 @@ export class DatumBuilderBlazeV3 implements DatumBuilder {
return result;
}

const [policyId, assetName] = metadata.assetId.split(".");
if (!policyId || !assetName) {
const [policyId, assetName = ""] = metadata.assetId.split(".");
if (!policyId) {
throw new Error(
`Invalid asset format for minting a pool with ${metadata.assetId}. Expected both a policyID and assetName.`,
`Invalid asset format for minting a pool with ${metadata.assetId}. Expected a policyID.`,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,10 @@ export class DatumBuilderLucidV3 implements DatumBuilder {
return result;
}

const [policyId, assetName] = metadata.assetId.split(".");
if (!policyId || !assetName) {
const [policyId, assetName = ""] = metadata.assetId.split(".");
if (!policyId) {
throw new Error(
`Invalid asset format for minting a pool with ${metadata.assetId}. Expected both a policyID and assetName.`,
`Invalid asset format for minting a pool with ${metadata.assetId}. Expected a policyID.`,
);
}

Expand Down

0 comments on commit 1edea6b

Please sign in to comment.