Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bundles.read().then(bundle =>
Promise.resolve({ addresses: [tritsToTrytes(transactionAddress(bundle.slice(-TRANSACTION_LENGTH)))] })
.then(findTransactions)
.then(getTrytes)
.then(pastAttachments =>
pastAttachments.filter(
trytes =>
tritsToTrytes(bundleHash(bundle)) ===
trytes.slice(
BUNDLE_OFFSET / TRYTE_WIDTH,
BUNDLE_OFFSET / TRYTE_WIDTH + BUNDLE_LENGTH / TRYTE_WIDTH
)
)
)
.then(pastAttachments =>
pastAttachments.map(trytes => tritsToTrytes(transactionHash(trytesToTrits(trytes))))
)
.then(pastAttachmentHashes =>