Jelajahi Sumber

update docs on format of method dispatch identifier (#2017)

Jesse Eisses 3 tahun lalu
induk
melakukan
df9627e952
2 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 1 1
      lang/src/lib.rs
  2. 1 1
      lang/syn/src/codegen/program/dispatch.rs

+ 1 - 1
lang/src/lib.rs

@@ -178,7 +178,7 @@ pub trait AccountDeserialize: Sized {
 pub trait ZeroCopy: Discriminator + Copy + Clone + Zeroable + Pod {}
 
 /// Calculates the data for an instruction invocation, where the data is
-/// `Sha256(<namespace>::<method_name>)[..8] || BorshSerialize(args)`.
+/// `Sha256(<namespace>:<method_name>)[..8] || BorshSerialize(args)`.
 /// `args` is a borsh serialized struct of named fields for each argument given
 /// to an instruction.
 pub trait InstructionData: AnchorSerialize {

+ 1 - 1
lang/syn/src/codegen/program/dispatch.rs

@@ -124,7 +124,7 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream {
         /// two pieces can be combined to creater a method identifier,
         /// specifically, Anchor uses
         ///
-        /// Sha256("<namespace>::<rust-identifier>")[..8],
+        /// Sha256("<namespace>:<rust-identifier>")[..8],
         ///
         /// where the namespace can be one of three types. 1) "global" for a
         /// regular instruction, 2) "state" for a state struct instruction