src/blockchain/lib/eventDecodersFromArtifact.js
/**
 * @param {object} artifact solcpiler|embark generated artifact for a solidity contract
 * @returns {object} map of event names => log decoder
 */
@param {object} artifact solcpiler|embark generated artifact for a solidity contract
@returns {object} map of event names => log decoder
@param { object } artifact solcpiler|embark generated artifact for a solidity contract @returns { object } map of event names = > log decoder
function eventDecodersFromArtifact({ compilerOutput, abiDefinition }) {
  const abi = compilerOutput ? compilerOutput.abi : abiDefinition;
  if (!abi) return {};
  return abi
    .filter(method => method.type === 'event')
    .reduce(
      (decoders, event) => ({
        ...decoders,
        [event.name]: Contract.prototype._decodeEventABI.bind(event),
      }),
      {},
    );
}
function eventDecodersFromArtifact ( { compilerOutput , abiDefinition } ) { const abi = compilerOutput ? compilerOutput . abi : abiDefinition ; if ( ! abi ) return { } ; return abi . filter ( method => method . type === 'event' ) . reduce ( ( decoders , event ) => ( { ... decoders , [ event . name ] : Contract . prototype . _decodeEventABI . bind ( event ) , } ) , { } , ) ; }
@param {object} artifact solcpiler|embark generated artifact for a solidity contract
 @returns {object} map of event names => log decoder
@param { object } artifact solcpiler|embark generated artifact for a solidity contract @returns { object } map of event names = > log decoder