Remove deprecated solana_entrypoint macro (#7257)

This commit is contained in:
Jack May
2019-12-04 00:42:50 -08:00
committed by GitHub
parent 9077a94dfe
commit 9b172879a2
3 changed files with 76 additions and 88 deletions

View File

@ -1,9 +1,6 @@
use crate::{account::KeyedAccount, instruction::InstructionError, pubkey::Pubkey};
use num_traits::{FromPrimitive, ToPrimitive};
// All native programs export a symbol named process()
pub const ENTRYPOINT: &str = "process";
// Native program ENTRYPOINT prototype
pub type Entrypoint = unsafe extern "C" fn(
program_id: &Pubkey,
@ -11,23 +8,6 @@ pub type Entrypoint = unsafe extern "C" fn(
data: &[u8],
) -> Result<(), InstructionError>;
// Deprecated
// Convenience macro to define the native program entrypoint. Supply a fn to this macro that
// conforms to the `Entrypoint` type signature.
#[macro_export]
macro_rules! solana_entrypoint(
($entrypoint:ident) => (
#[no_mangle]
pub extern "C" fn process(
program_id: &$crate::pubkey::Pubkey,
keyed_accounts: &mut [$crate::account::KeyedAccount],
data: &[u8],
) -> Result<(), $crate::instruction::InstructionError> {
$entrypoint(program_id, keyed_accounts, data)
}
)
);
/// Convenience macro to declare a native program
///
/// bs58_string: bs58 string representation the program's id