Before bliss
This commit is contained in:
@@ -83,20 +83,33 @@ export class AppService extends EventEmitter<AppEventMap> {
|
||||
// Import the default P2PKH template
|
||||
const { templateIdentifier } = await engine.importTemplate(p2pkhTemplate);
|
||||
|
||||
engine
|
||||
.subscribeToLockingBytecodesForTemplate(templateIdentifier)
|
||||
.catch((err) =>
|
||||
console.error(
|
||||
`Error subscribing to locking bytecodes for template ${templateIdentifier}: ${err}`,
|
||||
),
|
||||
);
|
||||
engine
|
||||
.updateUnspentOutputsForTemplate(templateIdentifier)
|
||||
.catch((err) =>
|
||||
console.error(
|
||||
`Error updating unspent outputs for template ${templateIdentifier}: ${err}`,
|
||||
),
|
||||
);
|
||||
// engine
|
||||
// .subscribeToLockingBytecodesForTemplate(templateIdentifier)
|
||||
// .catch((err) =>
|
||||
// console.error(
|
||||
// `Error subscribing to locking bytecodes for template ${templateIdentifier}: ${err}`,
|
||||
// ),
|
||||
// );
|
||||
// engine
|
||||
// .updateUnspentOutputsForTemplate(templateIdentifier)
|
||||
// .catch((err) =>
|
||||
// console.error(
|
||||
// `Error updating unspent outputs for template ${templateIdentifier}: ${err}`,
|
||||
// ),
|
||||
// );
|
||||
|
||||
// Update all the unspents for every template, and subscribe to the locking bytecodes for changes
|
||||
// TODO: Remove the above lines that do the same thing. Minimising changes for BLISS.
|
||||
const updateTemplates = async () => {
|
||||
const templates = await engine.listImportedTemplates();
|
||||
|
||||
templates.forEach(async (template) => {
|
||||
// engine.updateUnspentOutputsForTemplate(generateTemplateIdentifier(template));
|
||||
engine.subscribeToLockingBytecodesForTemplate(generateTemplateIdentifier(template));
|
||||
});
|
||||
};
|
||||
|
||||
updateTemplates();
|
||||
|
||||
// Set default locking parameters for P2PKH
|
||||
// To my knowledge, this doesnt generate any lockscript, so discovery of funds will not work automatically.
|
||||
|
||||
Reference in New Issue
Block a user