Add prefix to public key

This commit is contained in:
neeraj 2024-03-08 14:29:32 +05:30
parent b77ec37869
commit cb6d4014ee
2 changed files with 5 additions and 5 deletions

View File

@ -114,7 +114,7 @@ export class Account {
const [account] = await this._wallet.getAccounts(); const [account] = await this._wallet.getAccounts();
this._address = account.address; this._address = account.address;
this._publicKeyLaconic2 = toHex(account.pubkey); this._publicKeyLaconic2 = Buffer.from(AMINO_PREFIX + toHex(account.pubkey), 'hex').toString('base64');
// Generate public key. // Generate public key.
this._publicKey = secp256k1.publicKeyCreate(this._privateKey); this._publicKey = secp256k1.publicKeyCreate(this._privateKey);

View File

@ -50,7 +50,7 @@ describe('Querying', () => {
expect(records.length).toBeGreaterThanOrEqual(1); expect(records.length).toBeGreaterThanOrEqual(1);
}); });
xtest('Query records by reference.', async () => { test('Query records by reference.', async () => {
const { repo_registration_record_cid } = watcher.record; const { repo_registration_record_cid } = watcher.record;
const records = await registry.queryRecords({ repo_registration_record_cid }, true); const records = await registry.queryRecords({ repo_registration_record_cid }, true);
expect(records.length).toBeGreaterThanOrEqual(1); expect(records.length).toBeGreaterThanOrEqual(1);
@ -59,7 +59,7 @@ describe('Querying', () => {
expect(repo_registration_record_cid).toStrictEqual(record_repo_registration_record_cid); expect(repo_registration_record_cid).toStrictEqual(record_repo_registration_record_cid);
}); });
xtest('Query records by attributes.', async () => { test('Query records by attributes.', async () => {
const { version, url } = watcher.record; const { version, url } = watcher.record;
const records = await registry.queryRecords({ version, url, type: undefined }, true); const records = await registry.queryRecords({ version, url, type: undefined }, true);
expect(records.length).toBe(1); expect(records.length).toBe(1);
@ -70,13 +70,13 @@ describe('Querying', () => {
expect(recordName).toBe(url); expect(recordName).toBe(url);
}); });
xtest('Query records by id.', async () => { test('Query records by id.', async () => {
const records = await registry.getRecordsByIds([watcher.id]); const records = await registry.getRecordsByIds([watcher.id]);
expect(records.length).toBe(1); expect(records.length).toBe(1);
expect(records[0].id).toBe(watcher.id); expect(records[0].id).toBe(watcher.id);
}); });
xtest('Query records passing refs true.', async () => { test('Query records passing refs true.', async () => {
const [record] = await registry.getRecordsByIds([watcher.id], true); const [record] = await registry.getRecordsByIds([watcher.id], true);
expect(record.id).toBe(watcher.id); expect(record.id).toBe(watcher.id);
// temp fix // temp fix