@@ -71,23 +71,23 @@ pub fn pda_derive_address<const N: usize>(
7171 unreachable ! ( "deriving a pda is only available on target `solana`" ) ;
7272}
7373
74- pub fn archive_pda ( ) -> ( Pubkey , u8 ) {
75- ( ARCHIVE_ADDRESS , ARCHIVE_BUMP )
74+ pub const fn archive_pda ( ) -> ( & ' static Pubkey , u8 ) {
75+ ( & ARCHIVE_ADDRESS , ARCHIVE_BUMP )
7676}
7777
78- pub fn epoch_pda ( ) -> ( Pubkey , u8 ) {
79- ( EPOCH_ADDRESS , EPOCH_BUMP )
78+ pub const fn epoch_pda ( ) -> ( & ' static Pubkey , u8 ) {
79+ ( & EPOCH_ADDRESS , EPOCH_BUMP )
8080}
8181
82- pub fn block_pda ( ) -> ( Pubkey , u8 ) {
83- ( BLOCK_ADDRESS , BLOCK_BUMP )
82+ pub const fn block_pda ( ) -> ( & ' static Pubkey , u8 ) {
83+ ( & BLOCK_ADDRESS , BLOCK_BUMP )
8484}
8585
86- pub fn treasury_pda ( ) -> ( Pubkey , u8 ) {
87- ( TREASURY_ADDRESS , TREASURY_BUMP )
86+ pub const fn treasury_pda ( ) -> ( & ' static Pubkey , u8 ) {
87+ ( & TREASURY_ADDRESS , TREASURY_BUMP )
8888}
8989
90- pub fn treasury_ata ( ) -> ( Pubkey , u8 ) {
90+ pub fn treasury_find_ata ( ) -> ( Pubkey , u8 ) {
9191 let ( treasury_pda, _bump) = treasury_pda ( ) ;
9292 let ( mint_pda, _bump) = mint_pda ( ) ;
9393 Pubkey :: find_program_address (
@@ -100,42 +100,42 @@ pub fn treasury_ata() -> (Pubkey, u8) {
100100 )
101101}
102102
103- pub fn mint_pda ( ) -> ( Pubkey , u8 ) {
104- ( MINT_ADDRESS , MINT_BUMP )
103+ pub const fn mint_pda ( ) -> ( & ' static Pubkey , u8 ) {
104+ ( & MINT_ADDRESS , MINT_BUMP )
105105}
106106
107- pub fn metadata_find_pda ( mint : Pubkey ) -> ( Pubkey , u8 ) {
107+ pub fn metadata_find_pda ( mint : & Pubkey ) -> ( Pubkey , u8 ) {
108108 Pubkey :: find_program_address (
109109 & [ METADATA , mpl_token_metadata:: ID . as_ref ( ) , mint. as_ref ( ) ] ,
110110 & mpl_token_metadata:: ID ,
111111 )
112112}
113113
114- pub fn tape_find_pda ( authority : Pubkey , name : & [ u8 ; NAME_LEN ] ) -> ( Pubkey , u8 ) {
114+ pub fn tape_find_pda ( authority : & Pubkey , name : & [ u8 ; NAME_LEN ] ) -> ( Pubkey , u8 ) {
115115 Pubkey :: find_program_address ( & [ TAPE , authority. as_ref ( ) , name. as_ref ( ) ] , & crate :: id ( ) )
116116}
117117
118- pub fn tape_derive_pda ( authority : Pubkey , name : & [ u8 ; NAME_LEN ] , bump : u8 ) -> Pubkey {
118+ pub fn tape_derive_pda ( authority : & Pubkey , name : & [ u8 ; NAME_LEN ] , bump : u8 ) -> Pubkey {
119119 pda_derive_address (
120120 & [ TAPE , authority. as_ref ( ) , name. as_ref ( ) ] ,
121121 Some ( bump) ,
122122 & crate :: id ( ) ,
123123 )
124124}
125125
126- pub fn writer_find_pda ( tape : Pubkey ) -> ( Pubkey , u8 ) {
126+ pub fn writer_find_pda ( tape : & Pubkey ) -> ( Pubkey , u8 ) {
127127 Pubkey :: find_program_address ( & [ WRITER , tape. as_ref ( ) ] , & crate :: id ( ) )
128128}
129129
130- pub fn writer_derive_pda ( tape : Pubkey , bump : u8 ) -> Pubkey {
130+ pub fn writer_derive_pda ( tape : & Pubkey , bump : u8 ) -> Pubkey {
131131 pda_derive_address ( & [ WRITER , tape. as_ref ( ) ] , Some ( bump) , & crate :: id ( ) )
132132}
133133
134- pub fn miner_find_pda ( authority : Pubkey , name : [ u8 ; NAME_LEN ] ) -> ( Pubkey , u8 ) {
134+ pub fn miner_find_pda ( authority : & Pubkey , name : [ u8 ; NAME_LEN ] ) -> ( Pubkey , u8 ) {
135135 Pubkey :: find_program_address ( & [ MINER , authority. as_ref ( ) , name. as_ref ( ) ] , & crate :: id ( ) )
136136}
137137
138- pub fn miner_derive_pda ( authority : Pubkey , name : & [ u8 ; NAME_LEN ] , bump : u8 ) -> Pubkey {
138+ pub fn miner_derive_pda ( authority : & Pubkey , name : & [ u8 ; NAME_LEN ] , bump : u8 ) -> Pubkey {
139139 pda_derive_address (
140140 & [ MINER , authority. as_ref ( ) , name. as_ref ( ) ] ,
141141 Some ( bump) ,
@@ -144,14 +144,14 @@ pub fn miner_derive_pda(authority: Pubkey, name: &[u8; NAME_LEN], bump: u8) -> P
144144}
145145
146146
147- pub fn spool_find_pda ( miner : Pubkey , number : u64 ) -> ( Pubkey , u8 ) {
147+ pub fn spool_find_pda ( miner : & Pubkey , number : u64 ) -> ( Pubkey , u8 ) {
148148 Pubkey :: find_program_address (
149149 & [ SPOOL , miner. as_ref ( ) , number. to_le_bytes ( ) . as_ref ( ) ] ,
150150 & crate :: id ( ) ,
151151 )
152152}
153153
154- pub fn spool_derive_pda ( miner : Pubkey , number : u64 , bump : u8 ) -> Pubkey {
154+ pub fn spool_derive_pda ( miner : & Pubkey , number : u64 , bump : u8 ) -> Pubkey {
155155 pda_derive_address (
156156 & [ SPOOL , miner. as_ref ( ) , & number. to_le_bytes ( ) ] ,
157157 Some ( bump) ,
0 commit comments