From 23296dd9193699eecc2d1b83e75e26ccb5371b04 Mon Sep 17 00:00:00 2001 From: naz_dou Date: Thu, 11 Jun 2020 16:06:36 +0300 Subject: [PATCH] feat(Oracle): Implement Oracle Test's Fix `oracle-get` command --- bin/commands/oracle.js | 10 +++++----- test/cli/oracle.test.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/commands/oracle.js b/bin/commands/oracle.js index dc2dd94f..a8944e1f 100644 --- a/bin/commands/oracle.js +++ b/bin/commands/oracle.js @@ -19,11 +19,11 @@ * PERFORMANCE OF THIS SOFTWARE. */ +import { Crypto } from '@aeternity/aepp-sdk' import { exit, initChain, initClientByWalletFile } from '../utils/cli' -import { handleApiError } from '../utils/errors' -import { printError, print, printTransaction, printOracle, printQueries } from '../utils/print' import { BUILD_ORACLE_TTL } from '../utils/constant' -import { Crypto } from '@aeternity/aepp-sdk' +import { handleApiError } from '../utils/errors' +import { print, printError, printOracle, printQueries, printTransaction } from '../utils/print' // ## Create Oracle async function createOracle (walletPath, queryFormat, responseFormat, options) { @@ -171,8 +171,8 @@ async function queryOracle (oracleId, options) { if (!Crypto.assertedType(oracleId, 'ok', true)) throw new Error('Invalid oracleId') const client = await initChain(options) await handleApiError(async () => { - const oracle = await client.api.getOracleByPubkey(oracleId) - const { oracleQueries: queries } = await client.api.getOracleQueriesByPubkey(oracleId) + const oracle = await client.getOracle(oracleId) + const { oracleQueries: queries } = await client.getOracleQueries(oracleId) if (options.json) { console.log(JSON.stringify({ ...oracle, queries })) } else { diff --git a/test/cli/oracle.test.js b/test/cli/oracle.test.js index 215810ea..b253f80d 100644 --- a/test/cli/oracle.test.js +++ b/test/cli/oracle.test.js @@ -15,10 +15,10 @@ * PERFORMANCE OF THIS SOFTWARE. */ +import { Crypto } from '@aeternity/aepp-sdk' import { before, describe, it } from 'mocha' +import { configure, execute as exec, plan, ready, WALLET_NAME } from './index' -import { configure, plan, ready, execute as exec, WALLET_NAME } from './index' -import { Crypto } from '@aeternity/aepp-sdk' plan(10000000000000)