Просмотр исходного кода

Test base64ct patch for Anchor

Loris Leiva 4 месяцев назад
Родитель
Сommit
ec939b6f44
2 измененных файлов с 9 добавлено и 4 удалено
  1. 0 3
      template/anchor/base/program/Cargo.toml.njk
  2. 9 1
      utils/solanaCli.ts

+ 0 - 3
template/anchor/base/program/Cargo.toml.njk

@@ -22,6 +22,3 @@ idl-build = ["anchor-lang/idl-build"]
 [dependencies]
 anchor-lang = "{{ anchorVersion.full }}"
 solana-program = "~{{ solanaVersion.withoutPatch }}"
-
-[patch.crates-io]
-base64ct = "1.7.3"

+ 9 - 1
utils/solanaCli.ts

@@ -9,13 +9,21 @@ import {
 import { VersionWithoutPatch } from './versionCore';
 
 export async function patchSolanaDependencies(
-  ctx: Pick<RenderContext, 'solanaVersion' | 'targetDirectory'>
+  ctx: Pick<
+    RenderContext,
+    'solanaVersion' | 'targetDirectory' | 'programFramework'
+  >
 ): Promise<void> {
   const patchMap: Record<VersionWithoutPatch, string[]> = {
     '1.17': ['-p ahash@0.8.12 --precise 0.8.6'],
   };
 
   const patches = patchMap[ctx.solanaVersion.withoutPatch] ?? [];
+
+  if (ctx.programFramework === 'anchor') {
+    patches.push('-p base64ct@1.8.0 --precise 1.7.3');
+  }
+
   await Promise.all(
     patches.map(async (patch) =>
       waitForCommand(