Skip to content

Commit 625eac9

Browse files
committed
Use address instead of key
1 parent 2dfc295 commit 625eac9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+184
-179
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

programs/associated-token-account/src/instructions/create.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ impl Create<'_> {
4040
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
4141
// account metadata
4242
let account_metas: [AccountMeta; 6] = [
43-
AccountMeta::writable_signer(self.funding_account.key()),
44-
AccountMeta::writable(self.account.key()),
45-
AccountMeta::readonly(self.wallet.key()),
46-
AccountMeta::readonly(self.mint.key()),
47-
AccountMeta::readonly(self.system_program.key()),
48-
AccountMeta::readonly(self.token_program.key()),
43+
AccountMeta::writable_signer(self.funding_account.address()),
44+
AccountMeta::writable(self.account.address()),
45+
AccountMeta::readonly(self.wallet.address()),
46+
AccountMeta::readonly(self.mint.address()),
47+
AccountMeta::readonly(self.system_program.address()),
48+
AccountMeta::readonly(self.token_program.address()),
4949
];
5050

5151
// Instruction data:

programs/associated-token-account/src/instructions/create_idempotent.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ impl CreateIdempotent<'_> {
4141
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
4242
// account metadata
4343
let account_metas: [AccountMeta; 6] = [
44-
AccountMeta::writable_signer(self.funding_account.key()),
45-
AccountMeta::writable(self.account.key()),
46-
AccountMeta::readonly(self.wallet.key()),
47-
AccountMeta::readonly(self.mint.key()),
48-
AccountMeta::readonly(self.system_program.key()),
49-
AccountMeta::readonly(self.token_program.key()),
44+
AccountMeta::writable_signer(self.funding_account.address()),
45+
AccountMeta::writable(self.account.address()),
46+
AccountMeta::readonly(self.wallet.address()),
47+
AccountMeta::readonly(self.mint.address()),
48+
AccountMeta::readonly(self.system_program.address()),
49+
AccountMeta::readonly(self.token_program.address()),
5050
];
5151

5252
// Instruction data:

programs/associated-token-account/src/instructions/recover_nested.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ impl RecoverNested<'_> {
5151
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
5252
// account metadata
5353
let account_metas: [AccountMeta; 7] = [
54-
AccountMeta::writable(self.account.key()),
55-
AccountMeta::readonly(self.mint.key()),
56-
AccountMeta::writable(self.destination_account.key()),
57-
AccountMeta::readonly(self.owner_account.key()),
58-
AccountMeta::readonly(self.owner_mint.key()),
59-
AccountMeta::writable_signer(self.wallet.key()),
60-
AccountMeta::readonly(self.token_program.key()),
54+
AccountMeta::writable(self.account.address()),
55+
AccountMeta::readonly(self.mint.address()),
56+
AccountMeta::writable(self.destination_account.address()),
57+
AccountMeta::readonly(self.owner_account.address()),
58+
AccountMeta::readonly(self.owner_mint.address()),
59+
AccountMeta::writable_signer(self.wallet.address()),
60+
AccountMeta::readonly(self.token_program.address()),
6161
];
6262

6363
// Instruction data:

programs/memo/src/instructions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl Memo<'_, '_, '_> {
4444
account_metas
4545
.get_unchecked_mut(i)
4646
.write(AccountMeta::readonly_signer(
47-
self.signers.get_unchecked(i).key(),
47+
self.signers.get_unchecked(i).address(),
4848
));
4949
}
5050
}

programs/system/src/instructions/advance_nonce_account.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ impl AdvanceNonceAccount<'_> {
3232
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
3333
// account metadata
3434
let account_metas: [AccountMeta; 3] = [
35-
AccountMeta::writable(self.account.key()),
36-
AccountMeta::readonly(self.recent_blockhashes_sysvar.key()),
37-
AccountMeta::readonly_signer(self.authority.key()),
35+
AccountMeta::writable(self.account.address()),
36+
AccountMeta::readonly(self.recent_blockhashes_sysvar.address()),
37+
AccountMeta::readonly_signer(self.authority.address()),
3838
];
3939

4040
// instruction

programs/system/src/instructions/allocate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ impl Allocate<'_> {
2626
#[inline(always)]
2727
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
2828
// account metadata
29-
let account_metas: [AccountMeta; 1] = [AccountMeta::writable_signer(self.account.key())];
29+
let account_metas: [AccountMeta; 1] =
30+
[AccountMeta::writable_signer(self.account.address())];
3031

3132
// instruction data
3233
// - [0..4 ]: instruction discriminator

programs/system/src/instructions/allocate_with_seed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ impl AllocateWithSeed<'_, '_, '_> {
4343
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
4444
// account metadata
4545
let account_metas: [AccountMeta; 2] = [
46-
AccountMeta::writable(self.account.key()),
47-
AccountMeta::readonly_signer(self.base.key()),
46+
AccountMeta::writable(self.account.address()),
47+
AccountMeta::readonly_signer(self.base.address()),
4848
];
4949

5050
// instruction data
@@ -56,7 +56,7 @@ impl AllocateWithSeed<'_, '_, '_> {
5656
// - [.. +32]: owner address
5757
let mut instruction_data = [0; 112];
5858
instruction_data[0] = 9;
59-
instruction_data[4..36].copy_from_slice(self.base.key().as_array());
59+
instruction_data[4..36].copy_from_slice(self.base.address().as_array());
6060
instruction_data[36..44].copy_from_slice(&u64::to_le_bytes(self.seed.len() as u64));
6161

6262
let offset = 44 + self.seed.len();

programs/system/src/instructions/assign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl Assign<'_, '_> {
2727
#[inline(always)]
2828
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
2929
// account metadata
30-
let account_metas: [AccountMeta; 1] = [AccountMeta::writable_signer(self.account.key())];
30+
let account_metas: [AccountMeta; 1] = [AccountMeta::writable_signer(self.account.address())];
3131

3232
// instruction data
3333
// - [0..4 ]: instruction discriminator

programs/system/src/instructions/assign_with_seed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ impl AssignWithSeed<'_, '_, '_> {
3939
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
4040
// account metadata
4141
let account_metas: [AccountMeta; 2] = [
42-
AccountMeta::writable(self.account.key()),
43-
AccountMeta::readonly_signer(self.base.key()),
42+
AccountMeta::writable(self.account.address()),
43+
AccountMeta::readonly_signer(self.base.address()),
4444
];
4545

4646
// instruction data
@@ -51,7 +51,7 @@ impl AssignWithSeed<'_, '_, '_> {
5151
// - [.. +32]: owner address
5252
let mut instruction_data = [0; 104];
5353
instruction_data[0] = 10;
54-
instruction_data[4..36].copy_from_slice(self.base.key().as_array());
54+
instruction_data[4..36].copy_from_slice(self.base.address().as_array());
5555
instruction_data[36..44].copy_from_slice(&u64::to_le_bytes(self.seed.len() as u64));
5656

5757
let offset = 44 + self.seed.len();

0 commit comments

Comments
 (0)