Rename rest endpoint to rpc endpoint
Some checks failed
Tests / sdk_tests (pull_request) Failing after 18s
Some checks failed
Tests / sdk_tests (pull_request) Failing after 18s
This commit is contained in:
parent
8378d36bf3
commit
044a787622
@ -1,4 +1,4 @@
|
|||||||
PRIVATE_KEY=
|
PRIVATE_KEY=
|
||||||
COSMOS_CHAIN_ID=laconic_9000-1
|
COSMOS_CHAIN_ID=laconic_9000-1
|
||||||
LACONICD_GQL_ENDPOINT=http://localhost:9473/api
|
LACONICD_GQL_ENDPOINT=http://localhost:9473/api
|
||||||
LACONICD_REST_ENDPOINT=http://127.0.0.1:26657
|
LACONICD_RPC_ENDPOINT=http://127.0.0.1:26657
|
||||||
|
@ -20,7 +20,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: "./laconicd/"
|
path: "./laconicd/"
|
||||||
repository: cerc-io/laconic2d
|
repository: cerc-io/laconic2d # TODO: Update to laconicd on repo renaming
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: main
|
ref: main
|
||||||
- name: Environment
|
- name: Environment
|
||||||
|
@ -3,7 +3,7 @@ import { getConfig } from './testing/helper';
|
|||||||
import { DENOM } from './constants';
|
import { DENOM } from './constants';
|
||||||
|
|
||||||
jest.setTimeout(30 * 60 * 1000);
|
jest.setTimeout(30 * 60 * 1000);
|
||||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||||
|
|
||||||
const auctionTests = (numBidders = 3) => {
|
const auctionTests = (numBidders = 3) => {
|
||||||
let registry: Registry;
|
let registry: Registry;
|
||||||
@ -16,7 +16,7 @@ const auctionTests = (numBidders = 3) => {
|
|||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
console.log('Running auction tests with num bidders', numBidders);
|
console.log('Running auction tests with num bidders', numBidders);
|
||||||
|
|
||||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Setup bidder accounts', async () => {
|
test('Setup bidder accounts', async () => {
|
||||||
|
@ -7,7 +7,7 @@ import { DENOM } from './constants';
|
|||||||
const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
||||||
|
|
||||||
const BOND_AMOUNT = '1000000000';
|
const BOND_AMOUNT = '1000000000';
|
||||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||||
|
|
||||||
jest.setTimeout(90 * 1000);
|
jest.setTimeout(90 * 1000);
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ const bondTests = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Create bond.', async () => {
|
test('Create bond.', async () => {
|
||||||
|
@ -3,7 +3,7 @@ import { DENOM } from './constants';
|
|||||||
import { Registry } from './index';
|
import { Registry } from './index';
|
||||||
import { getConfig } from './testing/helper';
|
import { getConfig } from './testing/helper';
|
||||||
|
|
||||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||||
|
|
||||||
jest.setTimeout(90 * 1000);
|
jest.setTimeout(90 * 1000);
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ const registryTests = () => {
|
|||||||
let registry: Registry;
|
let registry: Registry;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Get account info.', async () => {
|
test('Get account info.', async () => {
|
||||||
|
@ -63,13 +63,13 @@ export class Registry {
|
|||||||
_chainID: string;
|
_chainID: string;
|
||||||
_client: RegistryClient;
|
_client: RegistryClient;
|
||||||
|
|
||||||
constructor (gqlUrl: string, restUrl = '', chainId: string = DEFAULT_CHAIN_ID) {
|
constructor (gqlUrl: string, rpcUrl = '', chainId: string = DEFAULT_CHAIN_ID) {
|
||||||
this._endpoints = {
|
this._endpoints = {
|
||||||
rest: restUrl,
|
rpc: rpcUrl,
|
||||||
gql: gqlUrl
|
gql: gqlUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
this._client = new RegistryClient(gqlUrl, restUrl);
|
this._client = new RegistryClient(gqlUrl, rpcUrl);
|
||||||
this._chainID = chainId;
|
this._chainID = chainId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ export class Registry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getLaconicClient (account: Account) {
|
async getLaconicClient (account: Account) {
|
||||||
return LaconicClient.connectWithSigner(this._endpoints.rest, account.wallet);
|
return LaconicClient.connectWithSigner(this._endpoints.rpc, account.wallet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
|||||||
|
|
||||||
jest.setTimeout(120 * 1000);
|
jest.setTimeout(120 * 1000);
|
||||||
|
|
||||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||||
|
|
||||||
const nameserviceExpiryTests = () => {
|
const nameserviceExpiryTests = () => {
|
||||||
let registry: Registry;
|
let registry: Registry;
|
||||||
@ -21,7 +21,7 @@ const nameserviceExpiryTests = () => {
|
|||||||
let recordExpiryTime: Date;
|
let recordExpiryTime: Date;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||||
|
|
||||||
// Create bond.
|
// Create bond.
|
||||||
bondId = await registry.getNextBondId(privateKey);
|
bondId = await registry.getNextBondId(privateKey);
|
||||||
|
@ -10,7 +10,7 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
|||||||
|
|
||||||
jest.setTimeout(5 * 60 * 1000);
|
jest.setTimeout(5 * 60 * 1000);
|
||||||
|
|
||||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||||
|
|
||||||
const namingTests = () => {
|
const namingTests = () => {
|
||||||
let registry: Registry;
|
let registry: Registry;
|
||||||
@ -20,7 +20,7 @@ const namingTests = () => {
|
|||||||
let watcherId: string;
|
let watcherId: string;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||||
|
|
||||||
// Create bond.
|
// Create bond.
|
||||||
bondId = await registry.getNextBondId(privateKey);
|
bondId = await registry.getNextBondId(privateKey);
|
||||||
|
@ -95,7 +95,7 @@ const auctionFields = `
|
|||||||
* Registry
|
* Registry
|
||||||
*/
|
*/
|
||||||
export class RegistryClient {
|
export class RegistryClient {
|
||||||
_restEndpoint: string;
|
_rpcEndpoint: string;
|
||||||
_graph: any;
|
_graph: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,14 +128,14 @@ export class RegistryClient {
|
|||||||
/**
|
/**
|
||||||
* New Client.
|
* New Client.
|
||||||
*/
|
*/
|
||||||
constructor (gqlEndpoint: string, restEndpoint: string) {
|
constructor (gqlEndpoint: string, rpcEndpoint: string) {
|
||||||
assert(gqlEndpoint);
|
assert(gqlEndpoint);
|
||||||
this._graph = graphqlClient(gqlEndpoint, {
|
this._graph = graphqlClient(gqlEndpoint, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
asJSON: true
|
asJSON: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this._restEndpoint = restEndpoint;
|
this._rpcEndpoint = rpcEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,7 +8,7 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
|||||||
|
|
||||||
jest.setTimeout(40 * 1000);
|
jest.setTimeout(40 * 1000);
|
||||||
|
|
||||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||||
|
|
||||||
describe('Querying', () => {
|
describe('Querying', () => {
|
||||||
let watcher: any;
|
let watcher: any;
|
||||||
@ -16,7 +16,7 @@ describe('Querying', () => {
|
|||||||
let bondId: string;
|
let bondId: string;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||||
|
|
||||||
bondId = await registry.getNextBondId(privateKey);
|
bondId = await registry.getNextBondId(privateKey);
|
||||||
await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, fee);
|
await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, fee);
|
||||||
@ -31,7 +31,7 @@ describe('Querying', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Endpoint and chain ID.', async () => {
|
test('Endpoint and chain ID.', async () => {
|
||||||
expect(registry.endpoints.rest).toBe(restEndpoint);
|
expect(registry.endpoints.rpc).toBe(rpcEndpoint);
|
||||||
expect(registry.endpoints.gql).toBe(gqlEndpoint);
|
expect(registry.endpoints.gql).toBe(gqlEndpoint);
|
||||||
expect(registry.chainID).toBe(chainId);
|
expect(registry.chainID).toBe(chainId);
|
||||||
});
|
});
|
||||||
|
@ -25,7 +25,7 @@ export const getConfig = () => {
|
|||||||
return {
|
return {
|
||||||
chainId: process.env.COSMOS_CHAIN_ID || DEFAULT_CHAIN_ID,
|
chainId: process.env.COSMOS_CHAIN_ID || DEFAULT_CHAIN_ID,
|
||||||
privateKey: process.env.PRIVATE_KEY,
|
privateKey: process.env.PRIVATE_KEY,
|
||||||
restEndpoint: process.env.LACONICD_REST_ENDPOINT || 'http://localhost:26657',
|
rpcEndpoint: process.env.LACONICD_RPC_ENDPOINT || 'http://localhost:26657',
|
||||||
gqlEndpoint: process.env.LACONICD_GQL_ENDPOINT || 'http://localhost:9473/api',
|
gqlEndpoint: process.env.LACONICD_GQL_ENDPOINT || 'http://localhost:9473/api',
|
||||||
fee: {
|
fee: {
|
||||||
amount: [{ denom: 'photon', amount: '40' }],
|
amount: [{ denom: 'photon', amount: '40' }],
|
||||||
|
@ -9,7 +9,7 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
|||||||
|
|
||||||
jest.setTimeout(90 * 1000);
|
jest.setTimeout(90 * 1000);
|
||||||
|
|
||||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||||
|
|
||||||
const utilTests = () => {
|
const utilTests = () => {
|
||||||
let registry: Registry;
|
let registry: Registry;
|
||||||
@ -19,7 +19,7 @@ const utilTests = () => {
|
|||||||
let watcherId: string;
|
let watcherId: string;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||||
|
|
||||||
// Create bond.
|
// Create bond.
|
||||||
bondId = await registry.getNextBondId(privateKey);
|
bondId = await registry.getNextBondId(privateKey);
|
||||||
|
Loading…
Reference in New Issue
Block a user