File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ pub fn derive_address<const N: usize>(
6161 i += 1 ;
6262 }
6363
64- // TODO: replace this with `as_slice` when the msrv is upgraded
64+ // TODO: replace this with `as_slice` when the MSRV is upgraded
6565 // to `1.84.0+`.
6666 let bump_seed = [ bump. unwrap_or_default ( ) ] ;
6767
@@ -138,11 +138,17 @@ pub const fn derive_address_const<const N: usize>(
138138 i += 1 ;
139139 }
140140
141- if bump. is_some ( ) {
142- hasher = hasher. update ( & [ bump. unwrap ( ) ] ) ;
141+ // TODO: replace this with `is_some` when the MSRV is upgraded
142+ // to `1.84.0+`.
143+ if let Some ( bump) = bump {
144+ hasher
145+ . update ( & [ bump] )
146+ . update ( program_id)
147+ . update ( PDA_MARKER )
148+ . finalize ( )
149+ } else {
150+ hasher. update ( program_id) . update ( PDA_MARKER ) . finalize ( )
143151 }
144-
145- hasher. update ( program_id) . update ( PDA_MARKER ) . finalize ( )
146152}
147153
148154/// Convenience macro to define a static `Pubkey` value.
You can’t perform that action at this time.
0 commit comments