Skip to content

Commit 4f3075f

Browse files
committed
Update references to pubkey
1 parent 7e2f1ea commit 4f3075f

File tree

12 files changed

+33
-30
lines changed

12 files changed

+33
-30
lines changed

programs/token-2022/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ Initializing a mint account:
2727

2828
```rust
2929
// This example assumes that the instruction receives a writable `mint`
30-
// account; `authority` is a `Pubkey`.
30+
// account; `authority` is an `Address`.
3131
// The SPL Token program is being invoked.
3232
InitializeMint {
3333
mint,
3434
rent_sysvar,
3535
decimals: 9,
3636
mint_authority: authority,
3737
freeze_authority: Some(authority),
38-
token_program: Pubkey::from_str("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
38+
token_program: Address::from_str_const("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
3939
}.invoke()?;
4040
```
4141

@@ -50,7 +50,7 @@ Transfer {
5050
to,
5151
authority,
5252
amount: 10,
53-
token_program: Pubkey::from_str("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb")
53+
token_program: Address::from_str_const("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb")
5454
}.invoke()?;
5555
```
5656

programs/token-2022/src/instructions/initialize_account_2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl InitializeAccount2<'_, '_> {
4141

4242
// instruction data
4343
// - [0]: instruction discriminator (1 byte, u8)
44-
// - [1..33]: owner (32 bytes, Pubkey)
44+
// - [1..33]: owner (32 bytes, Address)
4545
let mut instruction_data = [UNINIT_BYTE; 33];
4646

4747
// Set discriminator as u8 at offset [0]

programs/token-2022/src/instructions/initialize_account_3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl InitializeAccount3<'_, '_> {
3737

3838
// instruction data
3939
// - [0]: instruction discriminator (1 byte, u8)
40-
// - [1..33]: owner (32 bytes, Pubkey)
40+
// - [1..33]: owner (32 bytes, Address)
4141
let mut instruction_data = [UNINIT_BYTE; 33];
4242

4343
// Set discriminator as u8 at offset [0]

programs/token-2022/src/instructions/initialize_mint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ impl InitializeMint<'_, '_> {
4242
// Instruction data layout:
4343
// - [0]: instruction discriminator (1 byte, u8)
4444
// - [1]: decimals (1 byte, u8)
45-
// - [2..34]: mint_authority (32 bytes, Pubkey)
45+
// - [2..34]: mint_authority (32 bytes, Address)
4646
// - [34]: freeze_authority presence flag (1 byte, u8)
47-
// - [35..67]: freeze_authority (optional, 32 bytes, Pubkey)
47+
// - [35..67]: freeze_authority (optional, 32 bytes, Address)
4848
let mut instruction_data = [UNINIT_BYTE; 67];
4949
let mut length = instruction_data.len();
5050

programs/token-2022/src/instructions/initialize_mint_2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ impl InitializeMint2<'_, '_> {
3636
// Instruction data layout:
3737
// - [0]: instruction discriminator (1 byte, u8)
3838
// - [1]: decimals (1 byte, u8)
39-
// - [2..34]: mint_authority (32 bytes, Pubkey)
39+
// - [2..34]: mint_authority (32 bytes, Address)
4040
// - [34]: freeze_authority presence flag (1 byte, u8)
41-
// - [35..67]: freeze_authority (optional, 32 bytes, Pubkey)
41+
// - [35..67]: freeze_authority (optional, 32 bytes, Address)
4242
let mut instruction_data = [UNINIT_BYTE; 67];
4343
let mut length = instruction_data.len();
4444

4545
// Set discriminator as u8 at offset [0]
4646
write_bytes(&mut instruction_data, &[20]);
4747
// Set decimals as u8 at offset [1]
4848
write_bytes(&mut instruction_data[1..2], &[self.decimals]);
49-
// Set mint_authority as Pubkey at offset [2..34]
49+
// Set mint_authority at offset [2..34]
5050
write_bytes(&mut instruction_data[2..34], self.mint_authority.as_array());
5151

5252
if let Some(freeze_auth) = self.freeze_authority {

programs/token-2022/src/instructions/set_authority.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl SetAuthority<'_, '_> {
5555
// - [0]: instruction discriminator (1 byte, u8)
5656
// - [1]: authority_type (1 byte, u8)
5757
// - [2]: new_authority presence flag (1 byte, AuthorityType)
58-
// - [3..35] new_authority (optional, 32 bytes, Pubkey)
58+
// - [3..35] new_authority (optional, 32 bytes, Address)
5959
let mut instruction_data = [UNINIT_BYTE; 35];
6060
let mut length = instruction_data.len();
6161

programs/token/src/state/multisig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Multisig {
9191
/// Return the signer addresses of the `Multisig`.
9292
#[inline(always)]
9393
pub fn signers(&self) -> &[Address] {
94-
// SAFETY: `self.signers` is an array of `Pubkey` with a fixed size of
94+
// SAFETY: `self.signers` is an array of `Address` with a fixed size of
9595
// `MAX_MULTISIG_SIGNERS`; `self.signers_len` is always `<= MAX_MULTISIG_SIGNERS`
9696
// and indicates how many of these signers are valid.
9797
unsafe { self.signers.get_unchecked(..self.signers_len()) }

sdk/log/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ This crate defines a lightweight `Logger` type to format log messages and a comp
2828

2929
Below is a sample of the improvements observed when formatting log messages, measured in terms of compute units (CU):
3030
| Output message | `log!` | `msg!` | Improvement (%) |
31-
|------------------------------------|--------|-----------------|-----------------|
32-
| `"Hello world!"` | 104 | 104 | - |
33-
| `"lamports={}"` + `u64` | 286 | 625 (+339) | 55% |
34-
| `"{}"` + `[&str; 2]` | 119 | 1610 (+1491) | 93% |
35-
| `"{}"` + `[u64; 2]` | 483 | 1154 (+671) | 49% |
36-
| `"lamports={}"` + `i64` | 299 | 659 (+360) | 55% |
37-
| `"{}"` + `[u8; 32]` (pubkey bytes) | 2783 | 8397 (+5614) | 67% |
38-
| `"lamports={:.9}"` + `u64` | 438 | 2656 (+2218)`*` | 84% |
31+
|-------------------------------------|--------|-----------------|-----------------|
32+
| `"Hello world!"` | 104 | 104 | - |
33+
| `"lamports={}"` + `u64` | 286 | 625 (+339) | 55% |
34+
| `"{}"` + `[&str; 2]` | 119 | 1610 (+1491) | 93% |
35+
| `"{}"` + `[u64; 2]` | 483 | 1154 (+671) | 49% |
36+
| `"lamports={}"` + `i64` | 299 | 659 (+360) | 55% |
37+
| `"{}"` + `[u8; 32]` (address bytes) | 2783 | 8397 (+5614) | 67% |
38+
| `"lamports={:.9}"` + `u64` | 438 | 2656 (+2218)`*` | 84% |
3939

4040
`*` For `msg!`, the value is logged as a `f64` otherwise the precision formatting is ignored.
4141

sdk/pinocchio/src/cpi.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub fn slice_invoke(instruction: &Instruction, account_infos: &[&AccountInfo]) -
101101
/// 1. It has at least as many accounts as the number of accounts expected by
102102
/// the instruction.
103103
/// 2. The accounts match the expected accounts in the instruction, i.e., their
104-
/// `Pubkey` matches the `pubkey` in the `AccountMeta`.
104+
/// `Address` matches the address in the `AccountMeta`.
105105
/// 3. The borrow state of the accounts is compatible with the mutability of the
106106
/// accounts in the instruction.
107107
///
@@ -144,7 +144,7 @@ pub fn invoke_signed<const ACCOUNTS: usize>(
144144
/// 1. It has at least as many accounts as the number of accounts expected by
145145
/// the instruction.
146146
/// 2. The accounts match the expected accounts in the instruction, i.e., their
147-
/// `Pubkey` matches the `pubkey` in the `AccountMeta`.
147+
/// `Address` matches the address in the `AccountMeta`.
148148
/// 3. The borrow state of the accounts is compatible with the mutability of the
149149
/// accounts in the instruction.
150150
///
@@ -203,7 +203,7 @@ pub fn invoke_signed_with_bounds<const MAX_ACCOUNTS: usize>(
203203
/// 1. It has at least as many accounts as the number of accounts expected by
204204
/// the instruction.
205205
/// 2. The accounts match the expected accounts in the instruction, i.e., their
206-
/// `Pubkey` matches the `pubkey` in the `AccountMeta`.
206+
/// `Address` matches the address in the `AccountMeta`.
207207
/// 3. The borrow state of the accounts is compatible with the mutability of the
208208
/// accounts in the instruction.
209209
///
@@ -258,7 +258,7 @@ pub fn slice_invoke_signed(
258258
/// 1. It has at least as many accounts as the number of accounts expected by
259259
/// the instruction.
260260
/// 2. The accounts match the expected accounts in the instruction, i.e., their
261-
/// `Pubkey` matches the `pubkey` in the `AccountMeta`.
261+
/// `Address` matches the address in the `AccountMeta`.
262262
/// 3. The borrow state of the accounts is compatible with the mutability of the
263263
/// accounts in the instruction.
264264
///
@@ -395,8 +395,8 @@ pub unsafe fn invoke_signed_unchecked(
395395
/// discarded immediately after.
396396
#[repr(C)]
397397
struct CInstruction<'a> {
398-
/// Public key of the program.
399-
program_id: *const Pubkey,
398+
/// Address of the program.
399+
program_id: *const Address,
400400

401401
/// Accounts expected by the program instruction.
402402
accounts: *const AccountMeta<'a>,

sdk/pinocchio/src/entrypoint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ macro_rules! entrypoint {
149149
///
150150
/// ```ignore
151151
/// fn process_instruction(
152-
/// program_id: &Pubkey, // Public key of the account the program was loaded into
152+
/// program_id: &Address, // Address of the account the program was loaded into
153153
/// accounts: &[AccountInfo], // All accounts required to process the instruction
154154
/// instruction_data: &[u8], // Serialized instruction-specific data
155155
/// ) -> ProgramResult;

0 commit comments

Comments
 (0)