From 59d33bfa326d9ba951e01ec2b0a8d8b2525fe5f1 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sun, 21 Jun 2020 17:53:33 +1000 Subject: [PATCH] integration tests: Rename ready to getSdk --- test/integration/accounts.js | 8 ++++---- test/integration/aens.js | 4 ++-- test/integration/chain.js | 4 ++-- test/integration/channel.js | 4 ++-- test/integration/contract.js | 4 ++-- test/integration/ga.js | 4 ++-- test/integration/index.js | 2 +- test/integration/oracle.js | 4 ++-- test/integration/transaction.js | 6 +++--- test/integration/txVerification.js | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/test/integration/accounts.js b/test/integration/accounts.js index 59312cde49..e6bc1900d0 100644 --- a/test/integration/accounts.js +++ b/test/integration/accounts.js @@ -16,7 +16,7 @@ */ import { describe, it, before } from 'mocha' -import { ready, BaseAe, networkId } from './' +import { getSdk, BaseAe, networkId } from './' import { generateKeyPair } from '../../es/utils/crypto' import BigNumber from 'bignumber.js' import MemoryAccount from '../../es/account/memory' @@ -26,7 +26,7 @@ describe('Accounts', function () { let wallet before(async function () { - wallet = await ready() + wallet = await getSdk() }) const { publicKey: receiver } = generateKeyPair() @@ -35,7 +35,7 @@ describe('Accounts', function () { let wallet before(async function () { - wallet = await ready() + wallet = await getSdk() await wallet.addAccount(MemoryAccount({ keypair: generateKeyPair() }), { select: true }) }) @@ -185,7 +185,7 @@ describe('Accounts', function () { describe('can be configured to return th', () => { it('on creation', async () => { - const wallet = await ready() + const wallet = await getSdk() const th = await wallet.spend(1, receiver) th.should.be.a('object') th.hash.slice(0, 3).should.equal('th_') diff --git a/test/integration/aens.js b/test/integration/aens.js index 1d8b8a46b4..7c7103c06c 100644 --- a/test/integration/aens.js +++ b/test/integration/aens.js @@ -16,7 +16,7 @@ */ import { describe, it, before } from 'mocha' -import { plan, ready } from './' +import { plan, getSdk } from './' import * as R from 'ramda' import { generateKeyPair } from '../../es/utils/crypto' import { buildContractId, classify, computeAuctionEndBlock, computeBidFee } from '../../es/tx/builder/helpers' @@ -43,7 +43,7 @@ describe('Aens', function () { const name = randomName(13) // 13 name length doesn't trigger auction before(async function () { - aens = await ready() + aens = await getSdk() await aens.spend('1000000000000000', account.publicKey) }) diff --git a/test/integration/chain.js b/test/integration/chain.js index af397b021b..44ec0f5e64 100644 --- a/test/integration/chain.js +++ b/test/integration/chain.js @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ import { describe, it, before } from 'mocha' -import { ready } from './' +import { getSdk } from './' import { generateKeyPair } from '../../es/utils/crypto' describe('Node Chain', function () { @@ -23,7 +23,7 @@ describe('Node Chain', function () { const { publicKey } = generateKeyPair() before(async function () { - client = await ready() + client = await getSdk() }) it('determines the height', async () => { diff --git a/test/integration/channel.js b/test/integration/channel.js index c18ca6ac52..1ccdb90ae2 100644 --- a/test/integration/channel.js +++ b/test/integration/channel.js @@ -18,7 +18,7 @@ import { describe, it, before, after, beforeEach, afterEach } from 'mocha' import * as sinon from 'sinon' import BigNumber from 'bignumber.js' -import { ready, plan, BaseAe, networkId } from './' +import { getSdk, plan, BaseAe, networkId } from './' import { generateKeyPair, encodeBase64Check } from '../../es/utils/crypto' import { unpackTx, buildTx, buildTxHash } from '../../es/tx/builder' import { decode } from '../../es/tx/builder/helpers' @@ -83,7 +83,7 @@ describe('Channel', function () { } before(async function () { - initiator = await ready() + initiator = await getSdk() responder = await BaseAe({ nativeMode: true, networkId, accounts: [] }) await responder.addAccount(MemoryAccount({ keypair: generateKeyPair() }), { select: true }) sharedParams.initiatorId = await initiator.address() diff --git a/test/integration/contract.js b/test/integration/contract.js index 47ae2c6bd0..458deac237 100644 --- a/test/integration/contract.js +++ b/test/integration/contract.js @@ -16,7 +16,7 @@ */ import Compiler from '../../es/contract/compiler' import { describe, it, before } from 'mocha' -import { BaseAe, plan, ready, compilerUrl } from './' +import { BaseAe, plan, getSdk, compilerUrl } from './' import { decode } from '../../es/tx/builder/helpers' import * as R from 'ramda' @@ -189,7 +189,7 @@ describe('Contract', function () { let deployed before(async function () { - contract = await ready(true) + contract = await getSdk(true) }) describe('Aens and Oracle operation delegation', () => { let cInstance diff --git a/test/integration/ga.js b/test/integration/ga.js index d930b9a828..67063830fa 100644 --- a/test/integration/ga.js +++ b/test/integration/ga.js @@ -16,7 +16,7 @@ */ import { describe, it, before } from 'mocha' -import { ready } from './' +import { getSdk } from './' import { generateKeyPair } from '../../es/utils/crypto' import MemoryAccount from '../../es/account/memory' @@ -34,7 +34,7 @@ describe('Generalize Account', function () { const gaAccount = generateKeyPair() before(async function () { - client = await ready() + client = await getSdk() await client.spend('100000000000000000000', gaAccount.publicKey) await client.addAccount(await MemoryAccount({ keypair: gaAccount })) }) diff --git a/test/integration/index.js b/test/integration/index.js index b1c30c5fda..2d7d9897c1 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -46,7 +46,7 @@ export function plan (amount) { planned = planned.plus(amount) } -export async function ready (nativeMode = true) { +export async function getSdk (nativeMode = true) { const ae = await BaseAe({ networkId }) await ae.awaitHeight(2) diff --git a/test/integration/oracle.js b/test/integration/oracle.js index c83ad7d401..beb6d81736 100644 --- a/test/integration/oracle.js +++ b/test/integration/oracle.js @@ -16,7 +16,7 @@ */ import { describe, it, before } from 'mocha' -import { plan, ready } from './' +import { plan, getSdk } from './' import { encodeBase64Check } from '../../es/utils/crypto' plan('100000000000000000000') @@ -28,7 +28,7 @@ describe('Oracle', function () { const queryResponse = "{'tmp': 30}" before(async function () { - client = await ready() + client = await getSdk() }) it('Register Oracle with 5000 TTL', async () => { diff --git a/test/integration/transaction.js b/test/integration/transaction.js index 61375d4999..dab535aec6 100644 --- a/test/integration/transaction.js +++ b/test/integration/transaction.js @@ -17,7 +17,7 @@ import { describe, it, before } from 'mocha' import { encodeBase58Check, encodeBase64Check, generateKeyPair, salt } from '../../es/utils/crypto' -import { ready } from './index' +import { getSdk } from './index' import { commitmentHash, isNameValid } from '../../es/tx/builder/helpers' import { MemoryAccount } from '../../es' import { AE_AMOUNT_FORMATS } from '../../es/utils/amount-formatter' @@ -66,8 +66,8 @@ describe('Native Transaction', function () { before(async () => { const keyPair = generateKeyPair() - client = await ready(false) - clientNative = await ready() + client = await getSdk(false) + clientNative = await getSdk() await client.spend('16774200000000000000', keyPair.publicKey) await client.addAccount(MemoryAccount({ keypair: keyPair }), { select: true }) await clientNative.addAccount(MemoryAccount({ keypair: keyPair }), { select: true }) diff --git a/test/integration/txVerification.js b/test/integration/txVerification.js index cde13da978..91e4eadcc2 100644 --- a/test/integration/txVerification.js +++ b/test/integration/txVerification.js @@ -1,5 +1,5 @@ import { before, describe, it } from 'mocha' -import { ready } from '.' +import { getSdk } from '.' import { generateKeyPair } from '../../es/utils/crypto' import { BASE_VERIFICATION_SCHEMA, SIGNATURE_VERIFICATION_SCHEMA } from '../../es/tx/builder/schema' import MemoryAccount from '../../es/account/memory' @@ -12,7 +12,7 @@ describe('Verify Transaction', function () { let client before(async () => { - client = await ready() + client = await getSdk() await client.spend(1234, 'ak_LAqgfAAjAbpt4hhyrAfHyVg9xfVQWsk1kaHaii6fYXt6AJAGe') }) it('validate params', async () => { @@ -66,7 +66,7 @@ describe('Verify Transaction', function () { await checkErrors(signedTxFull) }) it('verify transaction before broadcast', async () => { - client = await ready() + client = await getSdk() const spendTx = await client.spendTx({ senderId: await client.address(), recipientId: await client.address(),