@@ -164,27 +164,39 @@ pub fn SysvarAccount(comptime sysvar_id: PublicKey) type {
164164
165165/// Rent Sysvar marker.
166166/// Usage: `.rent = RentSysvar`
167- pub const RentSysvar = SysvarAccount (PublicKey . comptimeFromBase58 ( "SysvarRent111111111111111111111111111111111" ) );
167+ pub const RentSysvar = SysvarAccount (sol . sysvar_id . RENT );
168168
169169/// Clock Sysvar marker.
170170/// Usage: `.clock = ClockSysvar`
171- pub const ClockSysvar = SysvarAccount (PublicKey . comptimeFromBase58 ( "SysvarC1ock11111111111111111111111111111111" ) );
171+ pub const ClockSysvar = SysvarAccount (sol . sysvar_id . CLOCK );
172172
173173/// Epoch Schedule Sysvar marker.
174174/// Usage: `.epoch_schedule = EpochScheduleSysvar`
175- pub const EpochScheduleSysvar = SysvarAccount (PublicKey . comptimeFromBase58 ( "SysvarEpochScheworLNPkL1MWVrwsLE4D8F2auJV1" ) );
175+ pub const EpochScheduleSysvar = SysvarAccount (sol . sysvar_id . EPOCH_SCHEDULE );
176176
177177/// Slot Hashes Sysvar marker.
178178/// Usage: `.slot_hashes = SlotHashesSysvar`
179- pub const SlotHashesSysvar = SysvarAccount (PublicKey .comptimeFromBase58 ("SysvarS1otHashes111111111111111111111111111" ));
179+ pub const SlotHashesSysvar = SysvarAccount (sol .sysvar_id .SLOT_HASHES );
180+
181+ /// Slot History Sysvar marker.
182+ /// Usage: `.slot_history = SlotHistorySysvar`
183+ pub const SlotHistorySysvar = SysvarAccount (sol .sysvar_id .SLOT_HISTORY );
180184
181185/// Stake History Sysvar marker.
182186/// Usage: `.stake_history = StakeHistorySysvar`
183- pub const StakeHistorySysvar = SysvarAccount (PublicKey .comptimeFromBase58 ("SysvarStakeHistory1111111111111111111111111" ));
187+ pub const StakeHistorySysvar = SysvarAccount (sol .sysvar_id .STAKE_HISTORY );
188+
189+ /// Epoch Rewards Sysvar marker.
190+ /// Usage: `.epoch_rewards = EpochRewardsSysvar`
191+ pub const EpochRewardsSysvar = SysvarAccount (sol .sysvar_id .EPOCH_REWARDS );
192+
193+ /// Last Restart Slot Sysvar marker.
194+ /// Usage: `.last_restart_slot = LastRestartSlotSysvar`
195+ pub const LastRestartSlotSysvar = SysvarAccount (sol .sysvar_id .LAST_RESTART_SLOT );
184196
185197/// Instructions Sysvar marker.
186198/// Usage: `.instructions = InstructionsSysvar`
187- pub const InstructionsSysvar = SysvarAccount (sol .instructions_sysvar . ID );
199+ pub const InstructionsSysvar = SysvarAccount (sol .sysvar_id . INSTRUCTIONS );
188200
189201// ============================================================================
190202// Data Account with Type-Safe Config
@@ -1262,6 +1274,41 @@ test "predefined sysvar markers" {
12621274 & ClockSysvar .ID .toBase58String (),
12631275 );
12641276
1277+ // Epoch Schedule Sysvar
1278+ try std .testing .expect (EpochScheduleSysvar .IS_SYSVAR == true );
1279+ try std .testing .expectEqualStrings (
1280+ "SysvarEpochSchedu1e111111111111111111111111" ,
1281+ & EpochScheduleSysvar .ID .toBase58String (),
1282+ );
1283+
1284+ // Slot Hashes Sysvar
1285+ try std .testing .expect (SlotHashesSysvar .IS_SYSVAR == true );
1286+ try std .testing .expectEqualStrings (
1287+ "SysvarS1otHashes111111111111111111111111111" ,
1288+ & SlotHashesSysvar .ID .toBase58String (),
1289+ );
1290+
1291+ // Slot History Sysvar
1292+ try std .testing .expect (SlotHistorySysvar .IS_SYSVAR == true );
1293+ try std .testing .expectEqualStrings (
1294+ "SysvarS1otHistory11111111111111111111111111" ,
1295+ & SlotHistorySysvar .ID .toBase58String (),
1296+ );
1297+
1298+ // Epoch Rewards Sysvar
1299+ try std .testing .expect (EpochRewardsSysvar .IS_SYSVAR == true );
1300+ try std .testing .expectEqualStrings (
1301+ "SysvarEpochRewards1111111111111111111111111" ,
1302+ & EpochRewardsSysvar .ID .toBase58String (),
1303+ );
1304+
1305+ // Last Restart Slot Sysvar
1306+ try std .testing .expect (LastRestartSlotSysvar .IS_SYSVAR == true );
1307+ try std .testing .expectEqualStrings (
1308+ "SysvarLastRestartS1ot1111111111111111111111" ,
1309+ & LastRestartSlotSysvar .ID .toBase58String (),
1310+ );
1311+
12651312 // Instructions Sysvar
12661313 try std .testing .expect (InstructionsSysvar .IS_SYSVAR == true );
12671314 try std .testing .expect (InstructionsSysvar .ID .equals (sol .instructions_sysvar .ID ));
@@ -1275,10 +1322,16 @@ test "Accounts with predefined programs" {
12751322 .memo_program = MemoProgram ,
12761323 .stake_program = StakeProgram ,
12771324 .rent = RentSysvar ,
1325+ .clock = ClockSysvar ,
1326+ .epoch_schedule = EpochScheduleSysvar ,
1327+ .slot_hashes = SlotHashesSysvar ,
1328+ .slot_history = SlotHistorySysvar ,
1329+ .epoch_rewards = EpochRewardsSysvar ,
1330+ .last_restart_slot = LastRestartSlotSysvar ,
12781331 });
12791332
12801333 const fields = @typeInfo (TestAccounts ).@"struct" .fields ;
1281- try std .testing .expect (fields .len == 6 );
1334+ try std .testing .expect (fields .len == 12 );
12821335}
12831336
12841337test "isEventFieldWrapper" {
0 commit comments