Skip to content

Commit 7c011b2

Browse files
committed
Rename constant
1 parent 626d9c0 commit 7c011b2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

address/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod syscalls;
88
pub use syscalls::*;
99

1010
/// Number of bytes in an address.
11-
pub const PUBKEY_BYTES: usize = 32;
11+
pub const ADDRESS_BYTES: usize = 32;
1212

1313
/// Maximum length of derived `Address` seed.
1414
pub const MAX_SEED_LEN: usize = 32;
@@ -27,4 +27,4 @@ pub const MAX_SEEDS: usize = 16;
2727
/// [account]: https://solana.com/docs/core/accounts
2828
/// [ed25519]: https://ed25519.cr.yp.to/
2929
/// [pdas]: https://solana.com/docs/core/cpi#program-derived-addresses
30-
pub type Address = [u8; PUBKEY_BYTES];
30+
pub type Address = [u8; ADDRESS_BYTES];

address/src/syscalls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub fn try_find_program_address(
112112
) -> Result<(Address, u8), ProgramError> {
113113
#[cfg(target_os = "solana")]
114114
{
115-
let mut bytes = core::mem::MaybeUninit::<[u8; crate::PUBKEY_BYTES]>::uninit();
115+
let mut bytes = core::mem::MaybeUninit::<[u8; crate::ADDRESS_BYTES]>::uninit();
116116
let mut bump_seed = u8::MAX;
117117

118118
let result = unsafe {
@@ -164,7 +164,7 @@ pub fn try_create_program_address(
164164
// Call via a system call to perform the calculation
165165
#[cfg(target_os = "solana")]
166166
{
167-
let mut bytes = core::mem::MaybeUninit::<[u8; crate::PUBKEY_BYTES]>::uninit();
167+
let mut bytes = core::mem::MaybeUninit::<[u8; crate::ADDRESS_BYTES]>::uninit();
168168

169169
let result = unsafe {
170170
sol_create_program_address(

pubkey/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use arbitrary::Arbitrary;
1212
use bytemuck_derive::{Pod, Zeroable};
1313
#[cfg(feature = "serde")]
1414
use serde_derive::{Deserialize, Serialize};
15-
pub use solana_address::{MAX_SEEDS, MAX_SEED_LEN, PUBKEY_BYTES};
15+
pub use solana_address::{ADDRESS_BYTES as PUBKEY_BYTES, MAX_SEEDS, MAX_SEED_LEN};
1616
#[cfg(any(feature = "std", target_arch = "wasm32"))]
1717
use std::vec::Vec;
1818
#[cfg(feature = "borsh")]

0 commit comments

Comments
 (0)