@@ -264,31 +264,28 @@ macro_rules! require_initialized_pda {
264264}
265265
266266#[ macro_export]
267- macro_rules! require_initialized_pda_unsafe {
268- ( $info: expr, $seeds: expr, $program_id : expr , $ is_writable: expr) => { {
267+ macro_rules! require_initialized_pda_fast {
268+ ( $info: expr, $seeds: expr, $is_writable: expr) => { {
269269 use solana_sha256_hasher:: hashv;
270270 let pda = hashv( $seeds) . to_bytes( ) ;
271271 if !pubkey_eq( $info. key( ) , & pda) {
272272 log!(
273- "require_initialized_pda!({}, {}, {}, {} ); pubkey_eq failed" ,
273+ "require_initialized_pda!({}, {}, {}); pubkey_eq failed" ,
274274 stringify!( $info) ,
275275 stringify!( $seeds) ,
276- stringify!( $program_id) ,
277276 stringify!( $is_writable)
278277 ) ;
279278 pubkey:: log( $info. key( ) ) ;
280- pubkey:: log( $program_id) ;
281279 return Err ( ProgramError :: InvalidSeeds ) ;
282280 }
283281
284- require_owned_by!( $info, $program_id ) ;
282+ require_owned_by!( $info, & $crate :: fast :: ID ) ;
285283
286284 if $is_writable && !$info. is_writable( ) {
287285 log!(
288- "require_initialized_pda!({}, {}, {}, {} ); is_writable expectation failed" ,
286+ "require_initialized_pda!({}, {}, {}); is_writable expectation failed" ,
289287 stringify!( $info) ,
290288 stringify!( $seeds) ,
291- stringify!( $program_id) ,
292289 stringify!( $is_writable)
293290 ) ;
294291 pubkey:: log( $info. key( ) ) ;
@@ -341,29 +338,26 @@ macro_rules! require_pda {
341338}
342339
343340#[ macro_export]
344- macro_rules! require_pda_unsafe {
345- ( $info: expr, $seeds: expr, $program_id : expr , $ is_writable: expr) => { {
341+ macro_rules! require_pda_fast {
342+ ( $info: expr, $seeds: expr, $is_writable: expr) => { {
346343 use solana_sha256_hasher:: hashv;
347344 let pda = hashv( $seeds) . to_bytes( ) ;
348345 if !pubkey_eq( $info. key( ) , & pda) {
349346 log!(
350- "require_pda!({}, {}, {}, {} ); pubkey_eq failed" ,
347+ "require_pda!({}, {}, {}); pubkey_eq failed" ,
351348 stringify!( $info) ,
352349 stringify!( $seeds) ,
353- stringify!( $program_id) ,
354350 stringify!( $is_writable)
355351 ) ;
356352 pubkey:: log( $info. key( ) ) ;
357- pubkey:: log( $program_id) ;
358353 return Err ( ProgramError :: InvalidSeeds ) ;
359354 }
360355
361356 if $is_writable && !$info. is_writable( ) {
362357 log!(
363- "require_pda!({}, {}, {}, {} ); is_writable expectation failed" ,
358+ "require_pda!({}, {}, {}); is_writable expectation failed" ,
364359 stringify!( $info) ,
365360 stringify!( $seeds) ,
366- stringify!( $program_id) ,
367361 stringify!( $is_writable)
368362 ) ;
369363 pubkey:: log( $info. key( ) ) ;
@@ -392,9 +386,9 @@ macro_rules! require_program_config {
392386}
393387
394388#[ macro_export]
395- macro_rules! require_program_config_unsafe {
389+ macro_rules! require_program_config_fast {
396390 ( $program_config: expr, $program: expr, $bump: expr, $is_writable: expr) => { {
397- $crate:: require_pda_unsafe !(
391+ $crate:: require_pda_fast !(
398392 $program_config,
399393 & [
400394 pda:: PROGRAM_CONFIG_TAG ,
@@ -403,7 +397,6 @@ macro_rules! require_program_config_unsafe {
403397 & $crate:: fast:: ID ,
404398 PDA_MARKER
405399 ] ,
406- & $crate:: fast:: ID ,
407400 $is_writable
408401 ) ;
409402 !pubkey_eq( $program_config. owner( ) , & pinocchio_system:: ID )
0 commit comments