forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add const pubkey support and make declare_id a declarative macro (#2348)
* make declare_id a declarative macro * remove old comment * deprecate program_declare_id * deprecate pubkey macro * put deprecation on the re-export of the pubkey macro * replace pubkey! with from_str_const in this repo * fmt * remove unused import * Revert "remove unused rustc_version dep from wen-restart (wrong branch)" This reverts commit 60dbddd. * avoid wen-restart changes again * fmt * fix deprecation text * make declare_deprecated_id a declarative macro * put back the deprecation on the re-export of the pubkey macro * fmt * don't deprecate the pubkey macro, but make it a declarative macro * update deprecation note * re-export the new pubkey macro in solana-sdk (with deprecation) instead of the old one
- Loading branch information
1 parent
49d2298
commit 2ea7fd7
Showing
14 changed files
with
208 additions
and
60 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use { | ||
solana_program::{pubkey, pubkey::Pubkey}, | ||
std::str::FromStr, | ||
}; | ||
|
||
// solana_program::pubkey refers to both a module and a macro. | ||
// This test demonstrates that both imports are working | ||
#[test] | ||
fn test_pubkey_import() { | ||
let pk = pubkey!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"); | ||
assert_eq!( | ||
pk, | ||
Pubkey::from_str("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL").unwrap() | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.