Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ memmap2 = "0.5.10"
memoffset = "0.9"
num-bigint = "0.4.6"
num-derive = "0.4"
num-traits = "0.2.18"
num-traits = { version = "0.2.18", default-features = false }
num_enum = "0.7.3"
openssl = "0.10.72"
pairing = "0.23.0"
Expand Down
4 changes: 1 addition & 3 deletions frozen-abi-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ fn quote_for_test(
type_name: &Ident,
expected_digest: &str,
) -> TokenStream2 {
// escape from nits.sh...
let p = Ident::new(&("ep".to_owned() + "rintln"), Span::call_site());
quote! {
#[cfg(test)]
mod #test_mod_ident {
Expand All @@ -302,7 +300,7 @@ fn quote_for_test(
let actual_digest = ::std::format!("{}", hash);
if ::std::env::var("SOLANA_ABI_BULK_UPDATE").is_ok() {
if #expected_digest != actual_digest {
#p!("sed -i -e 's/{}/{}/g' $(git grep --files-with-matches frozen_abi)", #expected_digest, hash);
::std::eprintln!("sed -i -e 's/{}/{}/g' $(git grep --files-with-matches frozen_abi)", #expected_digest, hash);
}
::solana_frozen_abi::__private::log::warn!("Not testing the abi digest under SOLANA_ABI_BULK_UPDATE!");
} else {
Expand Down
1 change: 1 addition & 0 deletions scripts/check-nits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ declare print_free_tree=(
':**.rs'
':^address/src/hasher.rs'
':^address/src/lib.rs'
':^frozen-abi-macro/src/lib.rs'
':^logger/src/lib.rs'
':^msg/src/lib.rs'
':^program-log/src/logger.rs'
Expand Down
1 change: 1 addition & 0 deletions scripts/check-no-std.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ no_std_crates=(
-p solana-sdk-ids
-p solana-signature
-p solana-sysvar-id
-p solana-system-interface
)
# Use the upstream BPF target, which doesn't support std, to make sure that our
# no_std support really works.
Expand Down
5 changes: 4 additions & 1 deletion system-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ rustdoc-args = ["--cfg=docsrs"]
crate-type = ["rlib"]

[features]
bincode = ["dep:solana-instruction", "serde"]
alloc = []
bincode = ["dep:solana-instruction", "alloc", "serde"]
frozen-abi = [
"dep:solana-frozen-abi",
"dep:solana-frozen-abi-macro",
"dep:solana-logger",
"serde",
"std",
"solana-address/frozen-abi",
"solana-address/std",
]
serde = ["dep:serde", "dep:serde_derive", "solana-address/serde"]
std = []

[dependencies]
num-traits = { workspace = true }
Expand Down
5 changes: 4 additions & 1 deletion system-interface/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@
//! [`Instruction`]:
//! https://docs.rs/solana-instruction/latest/solana_instruction/struct.Instruction.html

use solana_address::Address;
#[cfg(feature = "bincode")]
use {
crate::program::ID,
alloc::{string::ToString, vec, vec::Vec},
solana_instruction::{AccountMeta, Instruction},
};
#[cfg(feature = "alloc")]
use {alloc::string::String, solana_address::Address};

// Inline some constants to avoid dependencies.
//
Expand Down Expand Up @@ -85,6 +87,7 @@ const NONCE_STATE_SIZE: usize = 80;
feature = "serde",
derive(serde_derive::Deserialize, serde_derive::Serialize)
)]
#[cfg(feature = "alloc")]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the breaking change, since SystemInstruction isn't available without alloc enabled.

#[derive(Clone, Debug, Eq, PartialEq)]
pub enum SystemInstruction {
/// Create a new account
Expand Down
6 changes: 6 additions & 0 deletions system-interface/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
//! The System program interface.

#![no_std]
#![cfg_attr(feature = "frozen-abi", feature(min_specialization))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;

pub mod error;
pub mod instruction;

Expand Down