فهرست منبع

Add SDK support for creating transactions with address table lookups (#23728)

* Add SDK support for creating transactions with address table lookups

* fix bpf compilation

* rename compile error variants to indicate overflow

* Add doc tests

* fix bpf compatibility

* use constant for overflow tests

* Use cfg_attr for dead code attribute

* resolve merge conflict
Justin Starry 3 سال پیش
والد
کامیت
449f485089
1فایلهای تغییر یافته به همراه9 افزوده شده و 1 حذف شده
  1. 9 1
      interface/src/instruction.rs

+ 9 - 1
interface/src/instruction.rs

@@ -683,6 +683,7 @@ pub fn create_nonce_account(
 ///     system_instruction,
 ///     transaction::Transaction,
 /// };
+/// # use solana_sdk::account::Account;
 /// use std::path::Path;
 /// use anyhow::Result;
 /// # use anyhow::anyhow;
@@ -722,7 +723,14 @@ pub fn create_nonce_account(
 ///
 ///     // Sign the tx with nonce_account's `blockhash` instead of the
 ///     // network's latest blockhash.
-///     let nonce_account = client.get_account(&nonce_account_pubkey)?;
+///     # client.set_get_account_response(*nonce_account_pubkey, Account {
+///     #   lamports: 1,
+///     #   data: vec![0],
+///     #   owner: solana_sdk::system_program::ID,
+///     #   executable: false,
+///     #   rent_epoch: 1,
+///     # });
+///     let nonce_account = client.get_account(nonce_account_pubkey)?;
 ///     let nonce_data = nonce_utils::data_from_account(&nonce_account)?;
 ///     let blockhash = nonce_data.blockhash;
 ///