#![allow(incomplete_features)]
#![cfg_attr(feature = "frozen-abi", feature(specialization))]
extern crate self as solana_sdk;
#[cfg(feature = "full")]
pub use signer::signers;
#[cfg(not(target_os = "solana"))]
pub use solana_program::program_stubs;
#[allow(deprecated)]
pub use solana_program::sdk_ids;
#[cfg(target_arch = "wasm32")]
pub use solana_program::wasm_bindgen;
pub use solana_program::{
account_info, address_lookup_table, big_mod_exp, blake3, bpf_loader, bpf_loader_deprecated,
bpf_loader_upgradeable, clock, config, custom_heap_default, custom_panic_default,
debug_account_data, declare_deprecated_sysvar_id, declare_sysvar_id, ed25519_program,
epoch_rewards, epoch_schedule, fee_calculator, impl_sysvar_get, incinerator, instruction,
keccak, lamports, loader_instruction, loader_upgradeable_instruction, loader_v4,
loader_v4_instruction, message, msg, native_token, nonce, program, program_error,
program_option, program_pack, rent, secp256k1_program, serialize_utils, slot_hashes,
slot_history, stable_layout, stake, stake_history, syscalls, system_instruction,
system_program, sysvar, unchecked_div_by_const, vote,
};
#[cfg(feature = "borsh")]
pub use solana_program::{borsh, borsh0_10, borsh1};
pub mod client;
pub mod commitment_config;
pub mod compute_budget;
pub mod deserialize_utils;
pub mod ed25519_instruction;
pub mod entrypoint;
pub mod entrypoint_deprecated;
pub mod epoch_info;
pub mod epoch_rewards_hasher;
pub mod example_mocks;
pub mod exit;
pub mod feature;
pub mod fee;
pub mod genesis_config;
pub mod hard_forks;
pub mod hash;
pub mod inner_instruction;
pub mod log;
pub mod native_loader;
pub mod net;
pub mod nonce_account;
pub mod offchain_message;
pub mod poh_config;
pub mod precompiles;
pub mod program_utils;
pub mod pubkey;
pub mod quic;
pub mod rent_collector;
pub mod rent_debits;
pub mod reserved_account_keys;
pub mod reward_info;
pub mod reward_type;
pub mod rpc_port;
pub mod secp256k1_instruction;
pub mod shred_version;
pub mod signature;
pub mod signer;
pub mod simple_vote_transaction_checker;
pub mod system_transaction;
pub mod timing;
pub mod transaction;
pub mod transaction_context;
pub mod transport;
pub mod wasm;
#[deprecated(since = "2.1.0", note = "Use `solana-account` crate instead")]
pub use solana_account as account;
#[deprecated(
since = "2.1.0",
note = "Use `solana_account::state_traits` crate instead"
)]
pub use solana_account::state_traits as account_utils;
#[deprecated(since = "2.1.0", note = "Use `solana-bn254` crate instead")]
pub use solana_bn254 as alt_bn128;
#[deprecated(since = "2.1.0", note = "Use `solana-decode-error` crate instead")]
pub use solana_decode_error as decode_error;
#[deprecated(since = "2.1.0", note = "Use `solana-derivation-path` crate instead")]
pub use solana_derivation_path as derivation_path;
#[deprecated(since = "2.1.0", note = "Use `solana-feature-set` crate instead")]
pub use solana_feature_set as feature_set;
#[deprecated(since = "2.1.0", note = "Use `solana-inflation` crate instead")]
pub use solana_inflation as inflation;
#[deprecated(since = "2.1.0", note = "Use `solana-packet` crate instead")]
pub use solana_packet as packet;
#[deprecated(since = "2.1.0", note = "Use `solana-program-memory` crate instead")]
pub use solana_program_memory as program_memory;
#[deprecated(since = "2.1.0", note = "Use `solana_pubkey::pubkey` instead")]
pub use solana_pubkey::pubkey;
#[deprecated(since = "2.1.0", note = "Use `solana-sanitize` crate instead")]
pub use solana_sanitize as sanitize;
pub use solana_sdk_macro::declare_deprecated_id;
pub use solana_sdk_macro::declare_id;
pub use solana_sdk_macro::pubkeys;
#[deprecated(since = "2.1.0", note = "Use `solana-secp256k1-recover` crate instead")]
pub use solana_secp256k1_recover as secp256k1_recover;
#[deprecated(since = "2.1.0", note = "Use `solana-serde-varint` crate instead")]
pub use solana_serde_varint as serde_varint;
#[deprecated(since = "2.1.0", note = "Use `solana-short-vec` crate instead")]
pub use solana_short_vec as short_vec;
#[macro_export]
macro_rules! saturating_add_assign {
($i:expr, $v:expr) => {{
$i = $i.saturating_add($v)
}};
}
#[macro_use]
extern crate serde_derive;
pub extern crate bs58;
extern crate log as logger;
#[cfg_attr(feature = "frozen-abi", macro_use)]
#[cfg(feature = "frozen-abi")]
extern crate solana_frozen_abi_macro;
#[cfg(test)]
mod tests {
#[test]
fn test_saturating_add_assign() {
let mut i = 0u64;
let v = 1;
saturating_add_assign!(i, v);
assert_eq!(i, 1);
i = u64::MAX;
saturating_add_assign!(i, v);
assert_eq!(i, u64::MAX);
}
}