|
326 | 326 | //! use solana_msg::msg;
|
327 | 327 | //! use solana_program_error::{ProgramError, ProgramResult};
|
328 | 328 | //! use solana_sdk_ids::secp256k1_program;
|
329 |
| -//! use solana_sysvar::instructions; |
| 329 | +//! use solana_instructions_sysvar::load_instruction_at_checked; |
330 | 330 | //!
|
331 | 331 | //! /// An Ethereum address corresponding to a secp256k1 secret key that is
|
332 | 332 | //! /// authorized to sign our messages.
|
|
354 | 354 | //! // Load the secp256k1 instruction.
|
355 | 355 | //! // `new_secp256k1_instruction` generates an instruction that must be at index 0.
|
356 | 356 | //! let secp256k1_instr =
|
357 |
| -//! instructions::load_instruction_at_checked(0, instructions_sysvar_account)?; |
| 357 | +//! solana_instructions_sysvar::load_instruction_at_checked(0, instructions_sysvar_account)?; |
358 | 358 | //!
|
359 | 359 | //! // Verify it is a secp256k1 instruction.
|
360 | 360 | //! // This is security-critical - what if the transaction uses an imposter secp256k1 program?
|
|
533 | 533 | //! use solana_program_error::{ProgramError, ProgramResult};
|
534 | 534 | //! use solana_msg::msg;
|
535 | 535 | //! use solana_sdk_ids::secp256k1_program;
|
536 |
| -//! use solana_sysvar::instructions; |
| 536 | +//! use solana_instructions_sysvar::{get_instruction_relative, load_instruction_at_checked}; |
537 | 537 | //!
|
538 | 538 | //! /// A struct to hold the values specified in the `SecpSignatureOffsets` struct.
|
539 | 539 | //! struct SecpSignature {
|
|
553 | 553 | //! ) -> Result<Vec<SecpSignature>, ProgramError> {
|
554 | 554 | //! let mut sigs = vec![];
|
555 | 555 | //! for offsets in secp256k1_defs::iter_signature_offsets(secp256k1_instr_data)? {
|
556 |
| -//! let signature_instr = instructions::load_instruction_at_checked( |
| 556 | +//! let signature_instr = load_instruction_at_checked( |
557 | 557 | //! offsets.signature_instruction_index as usize,
|
558 | 558 | //! instructions_sysvar_account,
|
559 | 559 | //! )?;
|
560 |
| -//! let eth_address_instr = instructions::load_instruction_at_checked( |
| 560 | +//! let eth_address_instr = load_instruction_at_checked( |
561 | 561 | //! offsets.eth_address_instruction_index as usize,
|
562 | 562 | //! instructions_sysvar_account,
|
563 | 563 | //! )?;
|
564 |
| -//! let message_instr = instructions::load_instruction_at_checked( |
| 564 | +//! let message_instr = load_instruction_at_checked( |
565 | 565 | //! offsets.message_instruction_index as usize,
|
566 | 566 | //! instructions_sysvar_account,
|
567 | 567 | //! )?;
|
|
603 | 603 | //! ));
|
604 | 604 | //!
|
605 | 605 | //! let secp256k1_instr =
|
606 |
| -//! instructions::get_instruction_relative(-1, instructions_sysvar_account)?; |
| 606 | +//! solana_instructions_sysvar::get_instruction_relative(-1, instructions_sysvar_account)?; |
607 | 607 | //!
|
608 | 608 | //! assert!(secp256k1_program::check_id(&secp256k1_instr.program_id));
|
609 | 609 | //!
|
|
635 | 635 | //! };
|
636 | 636 | //! use solana_signer::Signer;
|
637 | 637 | //! use solana_keypair::Keypair;
|
638 |
| -//! use solana_sysvar::instructions; |
639 | 638 | //! use solana_sdk::transaction::Transaction;
|
640 | 639 | //!
|
641 | 640 | //! /// A struct to hold the values specified in the `SecpSignatureOffsets` struct.
|
|
0 commit comments