Skip to content

Commit

Permalink
fix: update the size of vote accounts now that the network has moved …
Browse files Browse the repository at this point in the history
…on past 1.14.11

## Summary

The new size of the vote account is `3762`. This update will make `VoteProgram.initializeAccount()` work with validators newer than 1.14.11 (which is now the majority of the network)

## Test Plan

```ts
pnpm test:live-with-test-validator
```
  • Loading branch information
steveluscher committed Sep 29, 2023
1 parent 679b719 commit 33dcf69
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/library-legacy/src/programs/vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export class VoteProgram {
*
* KEEP IN SYNC WITH `VoteState::size_of()` in https://github.com/solana-labs/solana/blob/a474cb24b9238f5edcc982f65c0b37d4a1046f7e/sdk/program/src/vote/state/mod.rs#L340-L342
*/
static space: number = 3731;
static space: number = 3762;

/**
* Generate an Initialize instruction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1145,13 +1145,13 @@ describe('getAccountInfo', () => {
type: 'vote',
},
program: 'vote',
space: 3731n,
space: 3762n,
},
executable: false,
lamports: 10290815n,
owner: 'Vote111111111111111111111111111111111111111',
rentEpoch: 0n,
space: 3731n,
space: 3762n,
},
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1243,13 +1243,13 @@ describe('getMultipleAccounts', () => {
type: 'vote',
},
program: 'vote',
space: 3731n,
space: 3762n,
},
executable: false,
lamports: 10290815n,
owner: 'Vote111111111111111111111111111111111111111',
rentEpoch: 0n,
space: 3731n,
space: 3762n,
},
],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1227,13 +1227,13 @@ describe('getProgramAccounts', () => {
type: 'vote',
},
program: 'vote',
space: 3731n,
space: 3762n,
},
executable: false,
lamports: expect.any(BigInt), // Changes
owner: 'Vote111111111111111111111111111111111111111',
rentEpoch: expect.any(BigInt),
space: 3731n,
space: 3762n,
},
pubkey: '4QUZQ4c7bZuJ4o4L8tYAEGnePFV27SUFEVmC7BYfsXRp',
},
Expand Down Expand Up @@ -1266,13 +1266,13 @@ describe('getProgramAccounts', () => {
type: 'vote',
},
program: 'vote',
space: 3731n,
space: 3762n,
},
executable: false,
lamports: expect.any(BigInt), // Changes
owner: 'Vote111111111111111111111111111111111111111',
rentEpoch: expect.any(BigInt),
space: 3731n,
space: 3762n,
},
pubkey: voteAccountAddress,
},
Expand Down Expand Up @@ -2205,13 +2205,13 @@ describe('getProgramAccounts', () => {
type: 'vote',
},
program: 'vote',
space: 3731n,
space: 3762n,
},
executable: false,
lamports: expect.any(BigInt), // Changes
owner: 'Vote111111111111111111111111111111111111111',
rentEpoch: expect.any(BigInt),
space: 3731n,
space: 3762n,
},
pubkey: '4QUZQ4c7bZuJ4o4L8tYAEGnePFV27SUFEVmC7BYfsXRp',
},
Expand Down Expand Up @@ -2244,13 +2244,13 @@ describe('getProgramAccounts', () => {
type: 'vote',
},
program: 'vote',
space: 3731n,
space: 3762n,
},
executable: false,
lamports: expect.any(BigInt), // Changes
owner: 'Vote111111111111111111111111111111111111111',
rentEpoch: expect.any(BigInt),
space: 3731n,
space: 3762n,
},
pubkey: voteAccountAddress,
},
Expand Down

0 comments on commit 33dcf69

Please sign in to comment.