Skip to content

Commit

Permalink
Update SDK for new kind
Browse files Browse the repository at this point in the history
  • Loading branch information
danenbm committed May 9, 2024
1 parent 1b82960 commit ee29b68
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions clients/js/src/helpers/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,12 @@ export async function validateTransfer(
return null;
});

const oraclePass = oracleValidations.every(
(v) => v?.transfer === ExternalValidationResult.Pass
);
const oraclePass = oracleValidations.every((v) => {
if (v?.__kind === 'Uninitialized') {
return false;
}
return v?.transfer === ExternalValidationResult.Pass;
});
if (!oraclePass) {
return LifecycleValidationError.OracleValidationFailed;
}
Expand Down Expand Up @@ -284,9 +287,12 @@ export async function validateBurn(
return null;
});

const oraclePass = oracleValidations.every(
(v) => v?.burn === ExternalValidationResult.Pass
);
const oraclePass = oracleValidations.every((v) => {
if (v?.__kind === 'Uninitialized') {
return false;
}
return v?.burn === ExternalValidationResult.Pass;
});
if (!oraclePass) {
return LifecycleValidationError.OracleValidationFailed;
}
Expand Down Expand Up @@ -373,9 +379,12 @@ export async function validateUpdate(
return null;
});

const oraclePass = oracleValidations.every(
(v) => v?.update === ExternalValidationResult.Pass
);
const oraclePass = oracleValidations.every((v) => {
if (v?.__kind === 'Uninitialized') {
return false;
}
return v?.update === ExternalValidationResult.Pass;
});
if (!oraclePass) {
return LifecycleValidationError.OracleValidationFailed;
}
Expand Down

0 comments on commit ee29b68

Please sign in to comment.