AraBlocks / ara-contracts

Blockchain interactions in Ara modules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

purchase cli fails if no job

bplaster opened this issue · comments

Expected Behavior

Purchase cli should succeed even without a job

Actual Behavior

Purchase cli fails if job is not true and prints:
ara: error: fatal: Expecting job Id.

(This is because purchase.js requires that job is an object, and purchase cli passes in an empty but valid object if job is false.

  } else if (opts.job && 'object' !== typeof opts.job) {
    throw TypeError('Expecting job object.')
  }

Steps to Reproduce the Problem

  1. call act purchase with job not set

Specifications

  • Version:
  • Platform:
  • Subsystem:

Also, purchase.js needs to include const { randomBytes } = require('ara-crypto')