Explorar o código

cli: Properly build anchor.Wallet for shell template script (#778)

David %!s(int64=4) %!d(string=hai) anos
pai
achega
2a5e16357b
Modificáronse 1 ficheiros con 10 adicións e 7 borrados
  1. 10 7
      cli/src/template.rs

+ 10 - 7
cli/src/template.rs

@@ -282,15 +282,18 @@ pub fn node_shell(
 const anchor = require('@project-serum/anchor');
 const web3 = anchor.web3;
 const PublicKey = anchor.web3.PublicKey;
+const Keypair = anchor.web3.Keypair;
 
 const __wallet = new anchor.Wallet(
-  Buffer.from(
-    JSON.parse(
-      require('fs').readFileSync(
-        "{}",
-        {{
-          encoding: "utf-8",
-        }},
+  Keypair.fromSecretKey(
+    Buffer.from(
+      JSON.parse(
+        require('fs').readFileSync(
+          "{}",
+          {{
+            encoding: "utf-8",
+          }},
+        ),
       ),
     ),
   ),