Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async (mapping) => {
log(mapping)
if (mapping === null) {
log("null mapping")
// todo destroy anything that needs to be disposed of
return
} else if (mapping.to.isEmpty()) {
await gatewayModule.checkRelentlessUser(mapping.from.local.toString().toLowerCase())
} else if (mapping.to!.isEmpty() === false) {
Sentry.setExtra(mapping.from.chainId, mapping.from.local.toString())
Sentry.setExtra(mapping.to.chainId, mapping.to.local.toString())
await setPlasmaAccount(mapping)
await initializeGateways(mapping, store.state.gateway.multisig)
const ethereumGateways = EthereumGateways.service()
// Listen to approval & deposit events
listenToDepositApproval(
ethereumModule.state.address,
ethereumGateways.loomGateway,
ethereumModule.getERC20("LOOM")!,
)
listenToDeposit(
ethereumModule.state.address,
});
}
} catch (e) {
// If something went wrong serializing the data, just ignore it.
}
return event;
},
});
// In the sidebar application, it is often useful to know the URL which the
// client was loaded into. This information is usually available in an iframe
// via `document.referrer`. More information about the document is available
// later when frames where the "annotator" code has loaded have connected to
// the sidebar via `postMessage` RPC messages.
Sentry.setExtra('document_url', document.referrer);
}
return function(exception, cause) {
if (ENV.SENTRY_DSN) {
if (cause) {
Sentry.setExtra('cause', cause);
}
Sentry.captureException(exception);
}
$log.warn(exception, cause);
};
}