fastify#Logger TypeScript Examples

The following examples show how to use fastify#Logger. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: operations-processor.ts    From cardano-rosetta with Apache License 2.0 6 votes vote down vote up
processPoolRetirement = (
  logger: Logger,
  operation: Components.Schemas.Operation
): { certificate: CardanoWasm.Certificate; poolKeyHash: string } => {
  logger.info(`[processPoolRetiring] About to process operation of type ${operation.type}`);
  if (operation.metadata?.epoch && operation.account?.address) {
    const epoch = operation.metadata.epoch;
    const keyHash = validateAndParsePoolKeyHash(logger, operation.account?.address);
    return {
      certificate: CardanoWasm.Certificate.new_pool_retirement(PoolRetirement.new(keyHash, epoch)),
      poolKeyHash: operation.account?.address
    };
  }
  logger.error('[processPoolRetiring] Epoch operation metadata is missing');
  throw ErrorFactory.missingMetadataParametersForPoolRetirement();
}