Skip to content

Commit

Permalink
feat(Oracle): Implement Oracle Test's
Browse files Browse the repository at this point in the history
Fix `oracle-get` command
  • Loading branch information
nduchak authored and mradkov committed Jun 10, 2021
1 parent c3e29ed commit 23296dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions bin/commands/oracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions test/cli/oracle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 23296dd

Please sign in to comment.