Skip to content

Commit 3c67d8a

Browse files
feat: add iconUrl to ValidatorInfo type (#2919)
* Add iconUrl to validator Info type * Fix up malformed JS comment * Add test --------- Co-authored-by: steveluscher <[email protected]>
1 parent 3cf0f55 commit 3c67d8a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/library-legacy/src/validator-info.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export type Info = {
3333
website?: string;
3434
/** optional, extra information the validator chose to share */
3535
details?: string;
36+
/** optional, validator logo URL */
37+
iconUrl?: string;
3638
/** optional, used to identify validators on keybase.io */
3739
keybaseUsername?: string;
3840
};
@@ -41,6 +43,7 @@ const InfoString = pick({
4143
name: string(),
4244
website: optional(string()),
4345
details: optional(string()),
46+
iconUrl: optional(string()),
4447
keybaseUsername: optional(string()),
4548
});
4649

packages/library-legacy/test/validator-info.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {Keypair} from '../src/keypair';
55
import {PublicKey} from '../src/publickey';
66
import {ValidatorInfo} from '../src/validator-info';
77

8-
describe('ValidatorInfo', () => {
8+
describe.only('ValidatorInfo', () => {
99
it('from config account data', () => {
1010
const keypair = Keypair.fromSeed(Uint8Array.from(Array(32).fill(8)));
1111

@@ -14,6 +14,7 @@ describe('ValidatorInfo', () => {
1414
{
1515
name: 'Validator',
1616
keybaseUsername: 'validator_id',
17+
iconUrl: 'https://example.com/icon',
1718
},
1819
);
1920

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

0 commit comments

Comments
 (0)