Update registry SDK record methods to use cosmjs #2

Merged
nabarun merged 7 commits from nv-check-remaining-tests into main 2024-03-11 08:51:01 +00:00
Showing only changes of commit 183d91546f - Show all commits

View File

@ -29,7 +29,7 @@ const nameserviceExpiryTests = () => {
await registry.createBond({ denom: DENOM, amount: '3000000' }, privateKey, laconic2Fee); await registry.createBond({ denom: DENOM, amount: '3000000' }, privateKey, laconic2Fee);
}); });
xtest('Set record and check bond balance', async () => { test('Set record and check bond balance', async () => {
// Create watcher. // Create watcher.
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
const result = await registry.setRecord( const result = await registry.setRecord(
@ -64,7 +64,7 @@ const nameserviceExpiryTests = () => {
setTimeout(done, 60 * 1000); setTimeout(done, 60 * 1000);
}); });
xtest('Check record expiry time', async () => { test('Check record expiry time', async () => {
const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true); const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
const updatedExpiryTime = new Date(); const updatedExpiryTime = new Date();
expect(updatedExpiryTime.getTime()).toBeGreaterThan(recordExpiryTime.getTime()); expect(updatedExpiryTime.getTime()).toBeGreaterThan(recordExpiryTime.getTime());
@ -79,7 +79,7 @@ const nameserviceExpiryTests = () => {
}); });
// TODO: Check bond balance not decreasing correctly // TODO: Check bond balance not decreasing correctly
xtest('Check bond balance', async () => { test('Check bond balance', async () => {
const [bond] = await registry.getBondsByIds([bondId]); const [bond] = await registry.getBondsByIds([bondId]);
console.log(bond); console.log(bond);
expect(bond).toBeDefined(); expect(bond).toBeDefined();
@ -90,13 +90,13 @@ const nameserviceExpiryTests = () => {
setTimeout(done, 60 * 1000); setTimeout(done, 60 * 1000);
}); });
xtest('Check record deleted without bond balance', async () => { test('Check record deleted without bond balance', async () => {
const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true); const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
expect(records).toHaveLength(0); expect(records).toHaveLength(0);
}); });
// TODO: Check authority not expiring // TODO: Check authority not expiring
xtest('Check authority expired without bond balance', async () => { test('Check authority expired without bond balance', async () => {
const [authority] = await registry.lookupAuthorities([authorityName]); const [authority] = await registry.lookupAuthorities([authorityName]);
expect(authority.status).toBe('expired'); expect(authority.status).toBe('expired');
}); });