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