From c8a2b832d62264c55f1087548769a67e31688b43 Mon Sep 17 00:00:00 2001 From: neeraj Date: Mon, 11 Mar 2024 14:55:11 +0530 Subject: [PATCH] Remove unused fee from config --- src/auction.test.ts | 11 +++--- src/bond.test.ts | 29 ++++++++------- src/index.test.ts | 5 ++- src/nameservice-expiry.test.ts | 11 +++--- src/naming.test.ts | 65 +++++++++++++++++----------------- src/sdk.test.ts | 7 ++-- src/testing/helper.ts | 11 ------ src/util.test.ts | 7 ++-- 8 files changed, 64 insertions(+), 82 deletions(-) diff --git a/src/auction.test.ts b/src/auction.test.ts index 4f8239a..947cfcd 100644 --- a/src/auction.test.ts +++ b/src/auction.test.ts @@ -1,10 +1,9 @@ import { Registry, Account, createBid } from './index'; -import { getConfig, getLaconic2Config } from './testing/helper'; +import { getConfig } from './testing/helper'; import { DENOM } from './constants'; jest.setTimeout(30 * 60 * 1000); const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); -const { fee: laconic2Fee } = getLaconic2Config(); const auctionTests = (numBidders = 3) => { let registry: Registry; @@ -25,14 +24,14 @@ const auctionTests = (numBidders = 3) => { const mnenonic = Account.generateMnemonic(); const account = await Account.generateFromMnemonic(mnenonic); await account.init(); - await registry.sendCoins({ denom: DENOM, amount: '20000000', destinationAddress: account.address }, privateKey, laconic2Fee); + await registry.sendCoins({ denom: DENOM, amount: '20000000', destinationAddress: account.address }, privateKey, fee); accounts.push({ address: account.address, privateKey: account.privateKey.toString('hex') }); } }); test('Reserve authority.', async () => { authorityName = `laconic-${Date.now()}`; - await registry.reserveAuthority({ name: authorityName }, accounts[0].privateKey, laconic2Fee); + await registry.reserveAuthority({ name: authorityName }, accounts[0].privateKey, fee); }); test('Authority should be under auction.', async () => { @@ -50,7 +49,7 @@ const auctionTests = (numBidders = 3) => { test('Commit bids.', async () => { for (let i = 0; i < numBidders; i++) { accounts[i].bid = await createBid(chainId, auctionId, accounts[i].address, `${10000000 + (i * 500)}${DENOM}`); - await registry.commitBid({ auctionId, commitHash: accounts[i].bid.commitHash }, accounts[i].privateKey, laconic2Fee); + await registry.commitBid({ auctionId, commitHash: accounts[i].bid.commitHash }, accounts[i].privateKey, fee); } }); @@ -74,7 +73,7 @@ const auctionTests = (numBidders = 3) => { expect(auction.status).toEqual('reveal'); for (let i = 0; i < numBidders; i++) { - await registry.revealBid({ auctionId, reveal: accounts[i].bid.revealString }, accounts[i].privateKey, laconic2Fee); + await registry.revealBid({ auctionId, reveal: accounts[i].bid.revealString }, accounts[i].privateKey, fee); } }); diff --git a/src/bond.test.ts b/src/bond.test.ts index 84ee641..e5669a5 100644 --- a/src/bond.test.ts +++ b/src/bond.test.ts @@ -1,14 +1,13 @@ import path from 'path'; import { Registry } from './index'; -import { ensureUpdatedConfig, getConfig, getLaconic2Config } from './testing/helper'; +import { ensureUpdatedConfig, getConfig } from './testing/helper'; import { DENOM } from './constants'; const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); const BOND_AMOUNT = '10000'; const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); -const { fee: laconic2Fee } = getLaconic2Config(); jest.setTimeout(90 * 1000); @@ -17,7 +16,7 @@ const bondTests = () => { const publishNewWatcherVersion = async (bondId: string) => { let watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); - await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, laconic2Fee); + await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, fee); return watcher; }; @@ -28,7 +27,7 @@ const bondTests = () => { test('Create bond.', async () => { let bondId = await registry.getNextBondId(privateKey); expect(bondId).toBeDefined(); - await registry.createBond({ denom: DENOM, amount: BOND_AMOUNT }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: BOND_AMOUNT }, privateKey, fee); }); describe('With bond created', () => { @@ -37,7 +36,7 @@ const bondTests = () => { beforeAll(async () => { let bondId1 = await registry.getNextBondId(privateKey); expect(bondId1).toBeDefined(); - await registry.createBond({ denom: DENOM, amount: BOND_AMOUNT }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: BOND_AMOUNT }, privateKey, fee); [bond1] = await registry.getBondsByIds([bondId1]); expect(bond1).toBeDefined(); @@ -69,7 +68,7 @@ const bondTests = () => { test('Refill bond.', async () => { const refillAmount = '500'; const total = (parseInt(BOND_AMOUNT) + parseInt(refillAmount)).toString(); - await registry.refillBond({ id: bond1.id, denom: DENOM, amount: refillAmount }, privateKey, laconic2Fee); + await registry.refillBond({ id: bond1.id, denom: DENOM, amount: refillAmount }, privateKey, fee); const [bond] = await registry.getBondsByIds([bond1.id]); expect(bond).toBeDefined(); expect(bond.id).toBe(bond1.id); @@ -78,7 +77,7 @@ const bondTests = () => { }); test('Withdraw bond.', async () => { - await registry.withdrawBond({ id: bond1.id, denom: DENOM, amount: '500' }, privateKey, laconic2Fee); + await registry.withdrawBond({ id: bond1.id, denom: DENOM, amount: '500' }, privateKey, fee); const [bond] = await registry.getBondsByIds([bond1.id]); expect(bond).toBeDefined(); expect(bond.id).toBe(bond1.id); @@ -87,7 +86,7 @@ const bondTests = () => { }); test('Cancel bond.', async () => { - await registry.cancelBond({ id: bond1.id }, privateKey, laconic2Fee); + await registry.cancelBond({ id: bond1.id }, privateKey, fee); const [bond] = await registry.getBondsByIds([bond1.id]); expect(bond.id).toBe(''); expect(bond.owner).toBe(''); @@ -100,7 +99,7 @@ const bondTests = () => { bondId1 = await registry.getNextBondId(privateKey); expect(bondId1).toBeDefined(); - await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, fee); // Create a new record. let watcher = await publishNewWatcherVersion(bondId1); @@ -109,12 +108,12 @@ const bondTests = () => { expect(record1.bondId).toBe(bondId1); // Dissociate record, query and confirm. - await registry.dissociateBond({ recordId: record1.id }, privateKey, laconic2Fee); + await registry.dissociateBond({ recordId: record1.id }, privateKey, fee); [record1] = await registry.queryRecords(query, true); expect(record1.bondId).toBe(''); // Associate record with bond, query and confirm. - await registry.associateBond({ recordId: record1.id, bondId: bondId1 }, privateKey, laconic2Fee); + await registry.associateBond({ recordId: record1.id, bondId: bondId1 }, privateKey, fee); [record1] = await registry.queryRecords(query, true); expect(record1.bondId).toBe(bondId1); }); @@ -125,7 +124,7 @@ const bondTests = () => { bondId1 = await registry.getNextBondId(privateKey); expect(bondId1).toBeDefined(); - await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, fee); // Create a new record version. let watcher = await publishNewWatcherVersion(bondId1); @@ -142,19 +141,19 @@ const bondTests = () => { // Create another bond. bondId2 = await registry.getNextBondId(privateKey); expect(bondId2).toBeDefined(); - await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, fee); const [bond] = await registry.getBondsByIds([bondId2]); expect(bond.id).toBe(bondId2); // Reassociate records from bondId1 to bondId2, verify change. - await registry.reassociateRecords({ oldBondId: bondId1, newBondId: bondId2 }, privateKey, laconic2Fee); + await registry.reassociateRecords({ oldBondId: bondId1, newBondId: bondId2 }, privateKey, fee); records = await registry.queryRecords(queryv1, true); expect(records[0].bondId).toBe(bondId2); records = await registry.queryRecords(queryv2, true); expect(records[0].bondId).toBe(bondId2); // Dissociate all records from bond, verify change. - await registry.dissociateRecords({ bondId: bondId2 }, privateKey, laconic2Fee); + await registry.dissociateRecords({ bondId: bondId2 }, privateKey, fee); records = await registry.queryRecords(queryv1, true); expect(records[0].bondId).toBe(''); records = await registry.queryRecords(queryv2, true); diff --git a/src/index.test.ts b/src/index.test.ts index 33c782d..b68101e 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,10 +1,9 @@ import { Account } from './account'; import { DENOM } from './constants'; import { Registry } from './index'; -import { getConfig, getLaconic2Config } from './testing/helper'; +import { getConfig } from './testing/helper'; -const { chainId, restEndpoint, gqlEndpoint, privateKey } = getConfig(); -const { fee } = getLaconic2Config(); +const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); jest.setTimeout(90 * 1000); diff --git a/src/nameservice-expiry.test.ts b/src/nameservice-expiry.test.ts index f5edba7..38fa44c 100644 --- a/src/nameservice-expiry.test.ts +++ b/src/nameservice-expiry.test.ts @@ -1,7 +1,7 @@ import path from 'path'; import { Registry } from './index'; -import { ensureUpdatedConfig, getConfig, getLaconic2Config } from './testing/helper'; +import { ensureUpdatedConfig, getConfig } from './testing/helper'; import { DENOM } from './constants'; const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); @@ -9,7 +9,6 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); jest.setTimeout(120 * 1000); const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); -const { fee: laconic2Fee } = getLaconic2Config(); const nameserviceExpiryTests = () => { let registry: Registry; @@ -26,7 +25,7 @@ const nameserviceExpiryTests = () => { // Create bond. bondId = await registry.getNextBondId(privateKey); - await registry.createBond({ denom: DENOM, amount: '3000000' }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: '3000000' }, privateKey, fee); }); test('Set record and check bond balance', async () => { @@ -39,7 +38,7 @@ const nameserviceExpiryTests = () => { record: watcher.record }, privateKey, - laconic2Fee + fee ); console.log('SetRecordResult: ' + result.id); const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true); @@ -53,8 +52,8 @@ const nameserviceExpiryTests = () => { test('Reserve authority and set bond', async () => { authorityName = `laconic-${Date.now()}`; - await registry.reserveAuthority({ name: authorityName }, privateKey, laconic2Fee); - await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, laconic2Fee); + await registry.reserveAuthority({ name: authorityName }, privateKey, fee); + await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee); const [authority] = await registry.lookupAuthorities([authorityName]); expect(authority.status).toBe('active'); authorityExpiryTime = new Date(authority.expiryTime); diff --git a/src/naming.test.ts b/src/naming.test.ts index 4cf129d..2aaeb08 100644 --- a/src/naming.test.ts +++ b/src/naming.test.ts @@ -3,11 +3,10 @@ import path from 'path'; import { Account } from './account'; import { Registry } from './index'; -import { ensureUpdatedConfig, getConfig, getLaconic2Config } from './testing/helper'; +import { ensureUpdatedConfig, getConfig } from './testing/helper'; import { DENOM } from './constants'; const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); -const { fee: laconic2Fee } = getLaconic2Config(); jest.setTimeout(5 * 60 * 1000); @@ -25,7 +24,7 @@ const namingTests = () => { // Create bond. bondId = await registry.getNextBondId(privateKey); - await registry.createBond({ denom: DENOM, amount: '2000000' }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: '2000000' }, privateKey, fee); // Create watcher. watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); @@ -36,7 +35,7 @@ const namingTests = () => { record: watcher.record }, privateKey, - laconic2Fee + fee ); watcherId = result.id; @@ -45,7 +44,7 @@ const namingTests = () => { describe('Authority tests', () => { test('Reserve authority.', async () => { const authorityName = `laconic-${Date.now()}`; - await registry.reserveAuthority({ name: authorityName }, privateKey, laconic2Fee); + await registry.reserveAuthority({ name: authorityName }, privateKey, fee); }); describe('With authority reserved', () => { @@ -56,7 +55,7 @@ const namingTests = () => { authorityName = `laconic-${Date.now()}`; lrn = `lrn://${authorityName}/app/test`; - await registry.reserveAuthority({ name: authorityName }, privateKey, laconic2Fee); + await registry.reserveAuthority({ name: authorityName }, privateKey, fee); }); test('Lookup authority.', async () => { @@ -78,13 +77,13 @@ const namingTests = () => { // TODO: Implement parse error response xtest('Reserve already reserved authority', async () => { - await expect(registry.reserveAuthority({ name: authorityName }, privateKey, laconic2Fee)) + await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)) .rejects.toThrow('Name already reserved.'); }); test('Reserve sub-authority.', async () => { const subAuthority = `echo.${authorityName}`; - await registry.reserveAuthority({ name: subAuthority }, privateKey, laconic2Fee); + await registry.reserveAuthority({ name: subAuthority }, privateKey, fee); const [record] = await registry.lookupAuthorities([subAuthority]); expect(record).toBeDefined(); @@ -98,15 +97,15 @@ const namingTests = () => { const mnenonic1 = Account.generateMnemonic(); const otherAccount1 = await Account.generateFromMnemonic(mnenonic1); await otherAccount1.init(); - await registry.sendCoins({ denom: DENOM, amount: '10000', destinationAddress: otherAccount1.address }, privateKey, laconic2Fee); + await registry.sendCoins({ denom: DENOM, amount: '10000', destinationAddress: otherAccount1.address }, privateKey, fee); const mnenonic2 = Account.generateMnemonic(); const otherAccount2 = await Account.generateFromMnemonic(mnenonic2); await otherAccount2.init(); - await registry.sendCoins({ denom: DENOM, amount: '10000', destinationAddress: otherAccount2.address }, otherAccount1.getPrivateKey(), laconic2Fee); + await registry.sendCoins({ denom: DENOM, amount: '10000', destinationAddress: otherAccount2.address }, otherAccount1.getPrivateKey(), fee); const subAuthority = `halo.${authorityName}`; - await registry.reserveAuthority({ name: subAuthority, owner: otherAccount1.address }, privateKey, laconic2Fee); + await registry.reserveAuthority({ name: subAuthority, owner: otherAccount1.address }, privateKey, fee); const [record] = await registry.lookupAuthorities([subAuthority]); expect(record).toBeDefined(); @@ -119,12 +118,12 @@ const namingTests = () => { // TODO: Parse error response from set name xtest('Set name for unbonded authority', async () => { assert(watcherId); - await expect(registry.setName({ lrn, cid: watcherId }, privateKey, laconic2Fee)) + await expect(registry.setName({ lrn, cid: watcherId }, privateKey, fee)) .rejects.toThrow('Authority bond not found.'); }); test('Set authority bond', async () => { - await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, laconic2Fee); + await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee); }); }); }); @@ -137,14 +136,14 @@ const namingTests = () => { beforeAll(async () => { authorityName = `laconic-${Date.now()}`; - await registry.reserveAuthority({ name: authorityName }, privateKey, laconic2Fee); - await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, laconic2Fee); + await registry.reserveAuthority({ name: authorityName }, privateKey, fee); + await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee); // Create another account. const mnenonic = Account.generateMnemonic(); otherAccount = await Account.generateFromMnemonic(mnenonic); await otherAccount.init(); - await registry.sendCoins({ denom: DENOM, amount: '1000000000', destinationAddress: otherAccount.address }, privateKey, laconic2Fee); + await registry.sendCoins({ denom: DENOM, amount: '1000000000', destinationAddress: otherAccount.address }, privateKey, fee); otherAuthorityName = `other-${Date.now()}`; otherPrivateKey = otherAccount.privateKey.toString('hex'); @@ -153,14 +152,14 @@ const namingTests = () => { test('Set name', async () => { const lrn = `lrn://${authorityName}/app/test1`; - await registry.setName({ lrn, cid: watcherId }, privateKey, laconic2Fee); + await registry.setName({ lrn, cid: watcherId }, privateKey, fee); // Query records should return it (some lrn points to it). const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }); expect(record).toBeDefined(); expect(record.names).toHaveLength(1); - await registry.deleteName({ lrn }, privateKey, laconic2Fee); + await registry.deleteName({ lrn }, privateKey, fee); }); describe('With name set', () => { @@ -168,11 +167,11 @@ const namingTests = () => { beforeAll(async () => { lrn = `lrn://${authorityName}/app/test2`; - await registry.setName({ lrn, cid: watcherId }, privateKey, laconic2Fee); + await registry.setName({ lrn, cid: watcherId }, privateKey, fee); }); afterAll(async () => { - await registry.deleteName({ lrn }, privateKey, laconic2Fee); + await registry.deleteName({ lrn }, privateKey, fee); }); test('Lookup name', async () => { @@ -206,11 +205,11 @@ const namingTests = () => { record: updatedWatcher.record }, privateKey, - laconic2Fee + fee ); const updatedWatcherId = result.id; - await registry.setName({ lrn, cid: updatedWatcherId }, privateKey, laconic2Fee); + await registry.setName({ lrn, cid: updatedWatcherId }, privateKey, fee); const records = await registry.lookupNames([lrn], true); expect(records).toHaveLength(1); @@ -231,7 +230,7 @@ const namingTests = () => { }); test('Delete name', async () => { - await registry.deleteName({ lrn }, privateKey, laconic2Fee); + await registry.deleteName({ lrn }, privateKey, fee); let records = await registry.lookupNames([lrn], true); expect(records).toBeDefined(); @@ -255,8 +254,8 @@ const namingTests = () => { }); test('Delete already deleted name', async () => { - await registry.deleteName({ lrn }, privateKey, laconic2Fee); - await registry.deleteName({ lrn }, privateKey, laconic2Fee); + await registry.deleteName({ lrn }, privateKey, fee); + await registry.deleteName({ lrn }, privateKey, fee); const records = await registry.lookupNames([lrn], true); expect(records).toBeDefined(); @@ -272,30 +271,30 @@ const namingTests = () => { // TODO: Parse error response form set name xtest('Set name without reserving authority', async () => { - await expect(registry.setName({ lrn: 'lrn://not-reserved/app/test', cid: watcherId }, privateKey, laconic2Fee)) + await expect(registry.setName({ lrn: 'lrn://not-reserved/app/test', cid: watcherId }, privateKey, fee)) .rejects.toThrow('Name authority not found.'); }); // TODO: Parse error response form set name xtest('Set name for non-owned authority', async () => { - await registry.sendCoins({ denom: DENOM, amount: '1000000000', destinationAddress: otherAccount.address }, privateKey, laconic2Fee); + await registry.sendCoins({ denom: DENOM, amount: '1000000000', destinationAddress: otherAccount.address }, privateKey, fee); // Other account reserves an authority. - await registry.reserveAuthority({ name: otherAuthorityName }, otherPrivateKey, laconic2Fee); + await registry.reserveAuthority({ name: otherAuthorityName }, otherPrivateKey, fee); // Try setting name under other authority. - await expect(registry.setName({ lrn: `lrn://${otherAuthorityName}/app/test`, cid: watcherId }, privateKey, laconic2Fee)).rejects.toThrow('Access denied.'); + await expect(registry.setName({ lrn: `lrn://${otherAuthorityName}/app/test`, cid: watcherId }, privateKey, fee)).rejects.toThrow('Access denied.'); }); // TODO: Parse error response form set name xtest('Delete name for non-owned authority.', async () => { const otherBondId = await registry.getNextBondId(otherPrivateKey); - await registry.createBond({ denom: DENOM, amount: '1000000' }, otherPrivateKey, laconic2Fee); - await registry.setAuthorityBond({ name: otherAuthorityName, bondId: otherBondId }, otherPrivateKey, laconic2Fee); - await registry.setName({ lrn: `lrn://${otherAuthorityName}/app/test`, cid: watcherId }, otherPrivateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: '1000000' }, otherPrivateKey, fee); + await registry.setAuthorityBond({ name: otherAuthorityName, bondId: otherBondId }, otherPrivateKey, fee); + await registry.setName({ lrn: `lrn://${otherAuthorityName}/app/test`, cid: watcherId }, otherPrivateKey, fee); // Try deleting name under other authority. - await expect(registry.deleteName({ lrn: `lrn://${otherAuthorityName}/app/test` }, privateKey, laconic2Fee)).rejects.toThrow('Access denied.'); + await expect(registry.deleteName({ lrn: `lrn://${otherAuthorityName}/app/test` }, privateKey, fee)).rejects.toThrow('Access denied.'); }); // TODO: Check later for empty records diff --git a/src/sdk.test.ts b/src/sdk.test.ts index 83b6114..885cb63 100644 --- a/src/sdk.test.ts +++ b/src/sdk.test.ts @@ -1,7 +1,7 @@ import path from 'path'; import { Registry } from './index'; -import { getConfig, ensureUpdatedConfig, getLaconic2Config } from './testing/helper'; +import { getConfig, ensureUpdatedConfig } from './testing/helper'; import { DENOM } from './constants'; const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); @@ -9,7 +9,6 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); jest.setTimeout(40 * 1000); const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); -const { fee: laconic2Fee } = getLaconic2Config(); describe('Querying', () => { let watcher: any; @@ -20,11 +19,11 @@ describe('Querying', () => { registry = new Registry(gqlEndpoint, restEndpoint, chainId); bondId = await registry.getNextBondId(privateKey); - await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, fee); const publishNewWatcherVersion = async () => { watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); - await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, laconic2Fee); + await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, fee); return watcher.record.version; }; diff --git a/src/testing/helper.ts b/src/testing/helper.ts index 7afed8d..17c23d3 100644 --- a/src/testing/helper.ts +++ b/src/testing/helper.ts @@ -28,17 +28,6 @@ export const getConfig = () => { privateKey: process.env.PRIVATE_KEY, restEndpoint: process.env.LACONICD_REST_ENDPOINT || 'http://localhost:1317', gqlEndpoint: process.env.LACONICD_GQL_ENDPOINT || 'http://localhost:9473/api', - fee: { - amount: '40', - denom: 'aphoton', - gas: '400000' - } - }; -}; - -// TODO: Merge both config -export const getLaconic2Config = () => { - return { fee: { amount: [{ denom: 'photon', amount: '40' }], gas: '400000' diff --git a/src/util.test.ts b/src/util.test.ts index 86a6958..1b0ac12 100644 --- a/src/util.test.ts +++ b/src/util.test.ts @@ -1,7 +1,7 @@ import path from 'path'; import { Registry } from './index'; -import { getBaseConfig, getConfig, getLaconic2Config } from './testing/helper'; +import { getBaseConfig, getConfig } from './testing/helper'; import { Util } from './util'; import { DENOM } from './constants'; @@ -10,7 +10,6 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); jest.setTimeout(90 * 1000); const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); -const { fee: laconic2Fee } = getLaconic2Config(); const utilTests = () => { let registry: Registry; @@ -24,7 +23,7 @@ const utilTests = () => { // Create bond. bondId = await registry.getNextBondId(privateKey); - await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, laconic2Fee); + await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, fee); // Create watcher. watcher = await getBaseConfig(WATCHER_YML_PATH); @@ -35,7 +34,7 @@ const utilTests = () => { record: watcher.record }, privateKey, - laconic2Fee + fee ); watcherId = result.id;