Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 6761f44

Browse files
authored
Token nits (#353)
1 parent 81ac32e commit 6761f44

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

docs/src/token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ called from other programs that interact with the Token Program's interface.
230230

231231
Accounts containing wrapped SOL are associated with a specific Mint called the
232232
"Native Mint" using the public key
233-
`So11111111111111111111111111111111111111111`.
233+
`So11111111111111111111111111111111111111112`.
234234

235235
These accounts have a few unique behaviors
236236

token/program/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub enum TokenError {
2626
#[error("Fixed supply")]
2727
FixedSupply,
2828
/// The account cannot be initialized because it is already being used.
29-
#[error("AlreadyInUse")]
29+
#[error("Already in use")]
3030
AlreadyInUse,
3131
/// Invalid number of provided signers.
3232
#[error("Invalid number of provided signers")]

token/program/src/instruction.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ pub fn transfer(
669669
signer_pubkeys.is_empty(),
670670
));
671671
for signer_pubkey in signer_pubkeys.iter() {
672-
accounts.push(AccountMeta::new(**signer_pubkey, true));
672+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
673673
}
674674

675675
Ok(Instruction {
@@ -698,7 +698,7 @@ pub fn approve(
698698
signer_pubkeys.is_empty(),
699699
));
700700
for signer_pubkey in signer_pubkeys.iter() {
701-
accounts.push(AccountMeta::new(**signer_pubkey, true));
701+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
702702
}
703703

704704
Ok(Instruction {
@@ -718,13 +718,13 @@ pub fn revoke(
718718
let data = TokenInstruction::Revoke.pack();
719719

720720
let mut accounts = Vec::with_capacity(2 + signer_pubkeys.len());
721-
accounts.push(AccountMeta::new_readonly(*source_pubkey, false));
721+
accounts.push(AccountMeta::new(*source_pubkey, false));
722722
accounts.push(AccountMeta::new_readonly(
723723
*owner_pubkey,
724724
signer_pubkeys.is_empty(),
725725
));
726726
for signer_pubkey in signer_pubkeys.iter() {
727-
accounts.push(AccountMeta::new(**signer_pubkey, true));
727+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
728728
}
729729

730730
Ok(Instruction {
@@ -757,7 +757,7 @@ pub fn set_authority(
757757
signer_pubkeys.is_empty(),
758758
));
759759
for signer_pubkey in signer_pubkeys.iter() {
760-
accounts.push(AccountMeta::new(**signer_pubkey, true));
760+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
761761
}
762762

763763
Ok(Instruction {
@@ -786,7 +786,7 @@ pub fn mint_to(
786786
signer_pubkeys.is_empty(),
787787
));
788788
for signer_pubkey in signer_pubkeys.iter() {
789-
accounts.push(AccountMeta::new(**signer_pubkey, true));
789+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
790790
}
791791

792792
Ok(Instruction {
@@ -815,7 +815,7 @@ pub fn burn(
815815
signer_pubkeys.is_empty(),
816816
));
817817
for signer_pubkey in signer_pubkeys.iter() {
818-
accounts.push(AccountMeta::new(**signer_pubkey, true));
818+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
819819
}
820820

821821
Ok(Instruction {
@@ -843,7 +843,7 @@ pub fn close_account(
843843
signer_pubkeys.is_empty(),
844844
));
845845
for signer_pubkey in signer_pubkeys.iter() {
846-
accounts.push(AccountMeta::new(**signer_pubkey, true));
846+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
847847
}
848848

849849
Ok(Instruction {
@@ -871,7 +871,7 @@ pub fn freeze_account(
871871
signer_pubkeys.is_empty(),
872872
));
873873
for signer_pubkey in signer_pubkeys.iter() {
874-
accounts.push(AccountMeta::new(**signer_pubkey, true));
874+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
875875
}
876876

877877
Ok(Instruction {
@@ -899,7 +899,7 @@ pub fn thaw_account(
899899
signer_pubkeys.is_empty(),
900900
));
901901
for signer_pubkey in signer_pubkeys.iter() {
902-
accounts.push(AccountMeta::new(**signer_pubkey, true));
902+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
903903
}
904904

905905
Ok(Instruction {
@@ -932,7 +932,7 @@ pub fn transfer2(
932932
signer_pubkeys.is_empty(),
933933
));
934934
for signer_pubkey in signer_pubkeys.iter() {
935-
accounts.push(AccountMeta::new(**signer_pubkey, true));
935+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
936936
}
937937

938938
Ok(Instruction {
@@ -965,7 +965,7 @@ pub fn approve2(
965965
signer_pubkeys.is_empty(),
966966
));
967967
for signer_pubkey in signer_pubkeys.iter() {
968-
accounts.push(AccountMeta::new(**signer_pubkey, true));
968+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
969969
}
970970

971971
Ok(Instruction {
@@ -995,7 +995,7 @@ pub fn mint_to2(
995995
signer_pubkeys.is_empty(),
996996
));
997997
for signer_pubkey in signer_pubkeys.iter() {
998-
accounts.push(AccountMeta::new(**signer_pubkey, true));
998+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
999999
}
10001000

10011001
Ok(Instruction {
@@ -1025,7 +1025,7 @@ pub fn burn2(
10251025
signer_pubkeys.is_empty(),
10261026
));
10271027
for signer_pubkey in signer_pubkeys.iter() {
1028-
accounts.push(AccountMeta::new(**signer_pubkey, true));
1028+
accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
10291029
}
10301030

10311031
Ok(Instruction {

0 commit comments

Comments
 (0)