瀏覽代碼

cli: Use ESM imports and annote provider type in the default migration script (#3234)

Co-authored-by: acheron <98934430+acheroncrypto@users.noreply.github.com>
Yash Goyal 1 年之前
父節點
當前提交
8a634c757b
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      cli/src/rust_template.rs

+ 2 - 2
cli/src/rust_template.rs

@@ -303,9 +303,9 @@ pub fn ts_deploy_script() -> &'static str {
 // single deploy script that's invoked from the CLI, injecting a provider
 // single deploy script that's invoked from the CLI, injecting a provider
 // configured from the workspace's Anchor.toml.
 // configured from the workspace's Anchor.toml.
 
 
-const anchor = require("@coral-xyz/anchor");
+import * as anchor from "@coral-xyz/anchor";
 
 
-module.exports = async function (provider) {
+module.exports = async function (provider: anchor.AnchorProvider) {
   // Configure client to use the provider.
   // Configure client to use the provider.
   anchor.setProvider(provider);
   anchor.setProvider(provider);