Quellcode durchsuchen

Expand docs on InstructionContext (#187)

Expand docs
Fernando Otero vor 4 Monaten
Ursprung
Commit
0fe3db9262
1 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
  1. 9 1
      sdk/pinocchio/src/entrypoint/lazy.rs

+ 9 - 1
sdk/pinocchio/src/entrypoint/lazy.rs

@@ -132,7 +132,15 @@ impl InstructionContext {
     /// # Safety
     /// # Safety
     ///
     ///
     /// The caller must ensure that the input buffer is valid, i.e., it represents
     /// The caller must ensure that the input buffer is valid, i.e., it represents
-    /// the program input parameters serialized by the SVM loader.
+    /// the program input parameters serialized by the SVM loader. The SVM loader
+    /// serializes the input parameters aligned to `8` bytes, with the first
+    /// `8` bytes representing the number of accounts, followed by the accounts
+    /// themselves, the instruction data and the program id.
+    ///
+    /// More information on the input buffer format can be found in the
+    /// [SVM documentation].
+    ///
+    /// [SVM documentation]: https://solana.com/docs/programs/faq#input-parameter-serialization
     #[inline(always)]
     #[inline(always)]
     pub unsafe fn new_unchecked(input: *mut u8) -> Self {
     pub unsafe fn new_unchecked(input: *mut u8) -> Self {
         Self {
         Self {