This commit is contained in:
parent
d7ca4730a2
commit
f525e18ca4
@ -17,16 +17,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Checkout laconicd
|
- name: Checkout laconicd
|
||||||
# uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
# with:
|
with:
|
||||||
# path: "./laconicd/"
|
path: "./laconicd/"
|
||||||
# repository: cerc-io/laconicd
|
repository: cerc-io/laconicd
|
||||||
# fetch-depth: 0
|
fetch-depth: 0
|
||||||
# ref: main
|
ref: main
|
||||||
run: |
|
|
||||||
git clone https://git.vdb.to/deep-stack/laconicd.git
|
|
||||||
cd laconicd
|
|
||||||
git checkout pm-qol-improvements
|
|
||||||
- name: Environment
|
- name: Environment
|
||||||
run: ls -tlh && env
|
run: ls -tlh && env
|
||||||
|
|
||||||
|
@ -19,20 +19,14 @@ const namingTests = () => {
|
|||||||
let watcherId: string;
|
let watcherId: string;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
console.log('running parent beforeAll')
|
|
||||||
|
|
||||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
console.log('registry fetched')
|
|
||||||
|
|
||||||
// Create bond.
|
// Create bond.
|
||||||
bondId = await registry.getNextBondId(privateKey);
|
bondId = await registry.getNextBondId(privateKey);
|
||||||
console.log('bondId', bondId)
|
|
||||||
await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee);
|
await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee);
|
||||||
console.log('done creating bond')
|
|
||||||
|
|
||||||
// Create watcher.
|
// Create watcher.
|
||||||
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
|
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
|
||||||
console.log('done ensureUpdatedConfig')
|
|
||||||
const result = await registry.setRecord(
|
const result = await registry.setRecord(
|
||||||
{
|
{
|
||||||
privateKey,
|
privateKey,
|
||||||
@ -44,9 +38,6 @@ const namingTests = () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
watcherId = result.data.id;
|
watcherId = result.data.id;
|
||||||
console.log('watcherId', watcherId)
|
|
||||||
|
|
||||||
console.log('done running parent beforeAll')
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Authority tests', () => {
|
describe('Authority tests', () => {
|
||||||
@ -54,7 +45,6 @@ const namingTests = () => {
|
|||||||
const authorityName = `laconic-${Date.now()}`;
|
const authorityName = `laconic-${Date.now()}`;
|
||||||
|
|
||||||
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
||||||
console.log('done Reserve authority')
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('With authority reserved', () => {
|
describe('With authority reserved', () => {
|
||||||
@ -62,13 +52,11 @@ const namingTests = () => {
|
|||||||
let crn: string;
|
let crn: string;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
console.log('running beforeAll')
|
|
||||||
|
|
||||||
authorityName = `laconic-${Date.now()}`;
|
authorityName = `laconic-${Date.now()}`;
|
||||||
crn = `crn://${authorityName}/app/test`;
|
crn = `crn://${authorityName}/app/test`;
|
||||||
|
|
||||||
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
||||||
console.log('done running beforeAll')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Lookup authority.', async () => {
|
test('Lookup authority.', async () => {
|
||||||
@ -78,7 +66,6 @@ const namingTests = () => {
|
|||||||
expect(record.ownerAddress).not.toBe('');
|
expect(record.ownerAddress).not.toBe('');
|
||||||
expect(record.ownerPublicKey).not.toBe('');
|
expect(record.ownerPublicKey).not.toBe('');
|
||||||
expect(Number(record.height)).toBeGreaterThan(0);
|
expect(Number(record.height)).toBeGreaterThan(0);
|
||||||
console.log('done Lookup authority')
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Lookup non existing authority', async () => {
|
test('Lookup non existing authority', async () => {
|
||||||
@ -87,13 +74,11 @@ const namingTests = () => {
|
|||||||
expect(record.ownerAddress).toBe('');
|
expect(record.ownerAddress).toBe('');
|
||||||
expect(record.ownerPublicKey).toBe('');
|
expect(record.ownerPublicKey).toBe('');
|
||||||
expect(Number(record.height)).toBe(0);
|
expect(Number(record.height)).toBe(0);
|
||||||
console.log('done Lookup non existing authority')
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Reserve already reserved authority', async () => {
|
test('Reserve already reserved authority', async () => {
|
||||||
await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).
|
await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).
|
||||||
rejects.toThrow('Name already reserved.');
|
rejects.toThrow('Name already reserved.');
|
||||||
console.log('done Reserve already reserved authority')
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Reserve sub-authority.', async () => {
|
test('Reserve sub-authority.', async () => {
|
||||||
@ -105,7 +90,6 @@ const namingTests = () => {
|
|||||||
expect(record.ownerAddress).not.toBe('');
|
expect(record.ownerAddress).not.toBe('');
|
||||||
expect(record.ownerPublicKey).not.toBe('');
|
expect(record.ownerPublicKey).not.toBe('');
|
||||||
expect(Number(record.height)).toBeGreaterThan(0);
|
expect(Number(record.height)).toBeGreaterThan(0);
|
||||||
console.log('done Reserve sub-authority')
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Reserve sub-authority with different owner.', async () => {
|
test('Reserve sub-authority with different owner.', async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user