@@ -372,8 +372,7 @@ impl Processor {
372
372
authority_type : & [ u8 ] ,
373
373
bump_seed : u8 ,
374
374
) -> Result < ( ) , ProgramError > {
375
- let authority_signature_seeds =
376
- [ & stake_pool. to_bytes ( ) [ ..32 ] , authority_type, & [ bump_seed] ] ;
375
+ let authority_signature_seeds = [ stake_pool. as_ref ( ) , authority_type, & [ bump_seed] ] ;
377
376
let signers = & [ & authority_signature_seeds[ ..] ] ;
378
377
379
378
let ix = stake:: instruction:: delegate_stake (
@@ -405,8 +404,7 @@ impl Processor {
405
404
authority_type : & [ u8 ] ,
406
405
bump_seed : u8 ,
407
406
) -> Result < ( ) , ProgramError > {
408
- let authority_signature_seeds =
409
- [ & stake_pool. to_bytes ( ) [ ..32 ] , authority_type, & [ bump_seed] ] ;
407
+ let authority_signature_seeds = [ stake_pool. as_ref ( ) , authority_type, & [ bump_seed] ] ;
410
408
let signers = & [ & authority_signature_seeds[ ..] ] ;
411
409
412
410
let ix = stake:: instruction:: deactivate_stake ( stake_info. key , authority_info. key ) ;
@@ -424,8 +422,7 @@ impl Processor {
424
422
amount : u64 ,
425
423
split_stake : AccountInfo < ' a > ,
426
424
) -> Result < ( ) , ProgramError > {
427
- let me_bytes = stake_pool. to_bytes ( ) ;
428
- let authority_signature_seeds = [ & me_bytes[ ..32 ] , authority_type, & [ bump_seed] ] ;
425
+ let authority_signature_seeds = [ stake_pool. as_ref ( ) , authority_type, & [ bump_seed] ] ;
429
426
let signers = & [ & authority_signature_seeds[ ..] ] ;
430
427
431
428
let split_instruction =
@@ -453,8 +450,7 @@ impl Processor {
453
450
stake_history : AccountInfo < ' a > ,
454
451
stake_program_info : AccountInfo < ' a > ,
455
452
) -> Result < ( ) , ProgramError > {
456
- let me_bytes = stake_pool. to_bytes ( ) ;
457
- let authority_signature_seeds = [ & me_bytes[ ..32 ] , authority_type, & [ bump_seed] ] ;
453
+ let authority_signature_seeds = [ stake_pool. as_ref ( ) , authority_type, & [ bump_seed] ] ;
458
454
let signers = & [ & authority_signature_seeds[ ..] ] ;
459
455
460
456
let merge_instruction =
@@ -526,8 +522,7 @@ impl Processor {
526
522
clock : AccountInfo < ' a > ,
527
523
stake_program_info : AccountInfo < ' a > ,
528
524
) -> Result < ( ) , ProgramError > {
529
- let me_bytes = stake_pool. to_bytes ( ) ;
530
- let authority_signature_seeds = [ & me_bytes[ ..32 ] , authority_type, & [ bump_seed] ] ;
525
+ let authority_signature_seeds = [ stake_pool. as_ref ( ) , authority_type, & [ bump_seed] ] ;
531
526
let signers = & [ & authority_signature_seeds[ ..] ] ;
532
527
533
528
let authorize_instruction = stake:: instruction:: authorize (
@@ -577,8 +572,7 @@ impl Processor {
577
572
stake_program_info : AccountInfo < ' a > ,
578
573
lamports : u64 ,
579
574
) -> Result < ( ) , ProgramError > {
580
- let me_bytes = stake_pool. to_bytes ( ) ;
581
- let authority_signature_seeds = [ & me_bytes[ ..32 ] , authority_type, & [ bump_seed] ] ;
575
+ let authority_signature_seeds = [ stake_pool. as_ref ( ) , authority_type, & [ bump_seed] ] ;
582
576
let signers = & [ & authority_signature_seeds[ ..] ] ;
583
577
let custodian_pubkey = None ;
584
578
@@ -616,8 +610,7 @@ impl Processor {
616
610
vote_account : AccountInfo < ' a > ,
617
611
stake_config : AccountInfo < ' a > ,
618
612
) -> Result < ( ) , ProgramError > {
619
- let me_bytes = stake_pool. to_bytes ( ) ;
620
- let authority_signature_seeds = [ & me_bytes[ ..32 ] , authority_type, & [ bump_seed] ] ;
613
+ let authority_signature_seeds = [ stake_pool. as_ref ( ) , authority_type, & [ bump_seed] ] ;
621
614
let signers = & [ & authority_signature_seeds[ ..] ] ;
622
615
623
616
let redelegate_instruction = & stake:: instruction:: redelegate (
@@ -673,8 +666,7 @@ impl Processor {
673
666
bump_seed : u8 ,
674
667
amount : u64 ,
675
668
) -> Result < ( ) , ProgramError > {
676
- let me_bytes = stake_pool. to_bytes ( ) ;
677
- let authority_signature_seeds = [ & me_bytes[ ..32 ] , authority_type, & [ bump_seed] ] ;
669
+ let authority_signature_seeds = [ stake_pool. as_ref ( ) , authority_type, & [ bump_seed] ] ;
678
670
let signers = & [ & authority_signature_seeds[ ..] ] ;
679
671
680
672
let ix = spl_token_2022:: instruction:: mint_to (
@@ -1389,7 +1381,7 @@ impl Processor {
1389
1381
) ?;
1390
1382
let ephemeral_stake_account_signer_seeds: & [ & [ _ ] ] = & [
1391
1383
EPHEMERAL_STAKE_SEED_PREFIX ,
1392
- & stake_pool_info. key . to_bytes ( ) ,
1384
+ stake_pool_info. key . as_ref ( ) ,
1393
1385
& ephemeral_stake_seed. to_le_bytes ( ) ,
1394
1386
& [ ephemeral_stake_bump_seed] ,
1395
1387
] ;
@@ -1452,8 +1444,8 @@ impl Processor {
1452
1444
} else {
1453
1445
let transient_stake_account_signer_seeds: & [ & [ _ ] ] = & [
1454
1446
TRANSIENT_STAKE_SEED_PREFIX ,
1455
- & vote_account_address. to_bytes ( ) ,
1456
- & stake_pool_info. key . to_bytes ( ) ,
1447
+ vote_account_address. as_ref ( ) ,
1448
+ stake_pool_info. key . as_ref ( ) ,
1457
1449
& transient_stake_seed. to_le_bytes ( ) ,
1458
1450
& [ transient_stake_bump_seed] ,
1459
1451
] ;
@@ -1664,7 +1656,7 @@ impl Processor {
1664
1656
) ?;
1665
1657
let ephemeral_stake_account_signer_seeds: & [ & [ _ ] ] = & [
1666
1658
EPHEMERAL_STAKE_SEED_PREFIX ,
1667
- & stake_pool_info. key . to_bytes ( ) ,
1659
+ stake_pool_info. key . as_ref ( ) ,
1668
1660
& ephemeral_stake_seed. to_le_bytes ( ) ,
1669
1661
& [ ephemeral_stake_bump_seed] ,
1670
1662
] ;
@@ -1730,8 +1722,8 @@ impl Processor {
1730
1722
// no transient stake, split
1731
1723
let transient_stake_account_signer_seeds: & [ & [ _ ] ] = & [
1732
1724
TRANSIENT_STAKE_SEED_PREFIX ,
1733
- & vote_account_address. to_bytes ( ) ,
1734
- & stake_pool_info. key . to_bytes ( ) ,
1725
+ vote_account_address. as_ref ( ) ,
1726
+ stake_pool_info. key . as_ref ( ) ,
1735
1727
& transient_stake_seed. to_le_bytes ( ) ,
1736
1728
& [ transient_stake_bump_seed] ,
1737
1729
] ;
@@ -1940,8 +1932,8 @@ impl Processor {
1940
1932
) ?;
1941
1933
let source_transient_stake_account_signer_seeds: & [ & [ _ ] ] = & [
1942
1934
TRANSIENT_STAKE_SEED_PREFIX ,
1943
- & vote_account_address. to_bytes ( ) ,
1944
- & stake_pool_info. key . to_bytes ( ) ,
1935
+ vote_account_address. as_ref ( ) ,
1936
+ stake_pool_info. key . as_ref ( ) ,
1945
1937
& source_transient_stake_seed. to_le_bytes ( ) ,
1946
1938
& [ source_transient_stake_bump_seed] ,
1947
1939
] ;
@@ -1973,7 +1965,7 @@ impl Processor {
1973
1965
) ?;
1974
1966
let ephemeral_stake_account_signer_seeds: & [ & [ _ ] ] = & [
1975
1967
EPHEMERAL_STAKE_SEED_PREFIX ,
1976
- & stake_pool_info. key . to_bytes ( ) ,
1968
+ stake_pool_info. key . as_ref ( ) ,
1977
1969
& ephemeral_stake_seed. to_le_bytes ( ) ,
1978
1970
& [ ephemeral_stake_bump_seed] ,
1979
1971
] ;
@@ -2076,8 +2068,8 @@ impl Processor {
2076
2068
) ?;
2077
2069
let destination_transient_stake_account_signer_seeds: & [ & [ _ ] ] = & [
2078
2070
TRANSIENT_STAKE_SEED_PREFIX ,
2079
- & vote_account_address. to_bytes ( ) ,
2080
- & stake_pool_info. key . to_bytes ( ) ,
2071
+ vote_account_address. as_ref ( ) ,
2072
+ stake_pool_info. key . as_ref ( ) ,
2081
2073
& destination_transient_stake_seed. to_le_bytes ( ) ,
2082
2074
& [ destination_transient_stake_bump_seed] ,
2083
2075
] ;
@@ -3560,7 +3552,7 @@ impl Processor {
3560
3552
crate :: find_withdraw_authority_program_address ( program_id, stake_pool_info. key ) ;
3561
3553
3562
3554
let token_mint_authority_signer_seeds: & [ & [ _ ] ] = & [
3563
- & stake_pool_info. key . to_bytes ( ) [ .. 32 ] ,
3555
+ stake_pool_info. key . as_ref ( ) ,
3564
3556
AUTHORITY_WITHDRAW ,
3565
3557
& [ stake_withdraw_bump_seed] ,
3566
3558
] ;
@@ -3640,7 +3632,7 @@ impl Processor {
3640
3632
crate :: find_withdraw_authority_program_address ( program_id, stake_pool_info. key ) ;
3641
3633
3642
3634
let token_mint_authority_signer_seeds: & [ & [ _ ] ] = & [
3643
- & stake_pool_info. key . to_bytes ( ) [ .. 32 ] ,
3635
+ stake_pool_info. key . as_ref ( ) ,
3644
3636
AUTHORITY_WITHDRAW ,
3645
3637
& [ stake_withdraw_bump_seed] ,
3646
3638
] ;
0 commit comments