Skip to content

Commit

Permalink
feat: add iconUrl to ValidatorInfo type (#2919)
Browse files Browse the repository at this point in the history
* Add iconUrl to validator Info type

* Fix up malformed JS comment

* Add test

---------

Co-authored-by: steveluscher <steven.luscher@anza.xyz>
  • Loading branch information
ronnyhaase and steveluscher authored Jul 8, 2024
1 parent 3cf0f55 commit 3c67d8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/library-legacy/src/validator-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export type Info = {
website?: string;
/** optional, extra information the validator chose to share */
details?: string;
/** optional, validator logo URL */
iconUrl?: string;
/** optional, used to identify validators on keybase.io */
keybaseUsername?: string;
};
Expand All @@ -41,6 +43,7 @@ const InfoString = pick({
name: string(),
website: optional(string()),
details: optional(string()),
iconUrl: optional(string()),
keybaseUsername: optional(string()),
});

Expand Down
5 changes: 3 additions & 2 deletions packages/library-legacy/test/validator-info.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Keypair} from '../src/keypair';
import {PublicKey} from '../src/publickey';
import {ValidatorInfo} from '../src/validator-info';

describe('ValidatorInfo', () => {
describe.only('ValidatorInfo', () => {

This comment has been minimized.

Copy link
@steveluscher

steveluscher Jul 16, 2024

Author Collaborator

Haha. Oh no.

This comment has been minimized.

Copy link
@steveluscher

steveluscher Jul 16, 2024

Author Collaborator
it('from config account data', () => {
const keypair = Keypair.fromSeed(Uint8Array.from(Array(32).fill(8)));

Expand All @@ -14,6 +14,7 @@ describe('ValidatorInfo', () => {
{
name: 'Validator',
keybaseUsername: 'validator_id',
iconUrl: 'https://example.com/icon',
},
);

Expand All @@ -27,7 +28,7 @@ describe('ValidatorInfo', () => {
// 4) Use modified `solana-validator-info` tool to publish validator info
// 5) And then use it again to fetch the data! (feel free to trim some A's)
const configData = Buffer.from(
'AgdRlwF0SPKsXcI8nrx6x4wKJyV6xhRFjeCk8W+AAAAAABOY9ixtGkV8UbpqS189vS9p/KkyFiGNyJl+QWvRfZPKATUAAAAAAAAAeyJrZXliYXNlVXNlcm5hbWUiOiJ2YWxpZGF0b3JfaWQiLCJuYW1lIjoiVmFsaWRhdG9yIn0',
'AgdRlwF0SPKsXcI8nrx6x4wKJyV6xhRFjeCk8W+AAAAAABOY9ixtGkV8UbpqS189vS9p/KkyFiGNyJl+QWvRfZPKAVoAAAAAAAAAeyJrZXliYXNlVXNlcm5hbWUiOiJ2YWxpZGF0b3JfaWQiLCJuYW1lIjoiVmFsaWRhdG9yIiwiaWNvblVybCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vaWNvbiJ9',
'base64',
);
const info = ValidatorInfo.fromConfigData(configData);
Expand Down

0 comments on commit 3c67d8a

Please sign in to comment.