Selaa lähdekoodia

ts: Use workspace dependencies and fix tests (#2685)

acheron 1 vuosi sitten
vanhempi
sitoutus
5a655b0f65

+ 1 - 4
ts/tests/package.json

@@ -12,8 +12,5 @@
     "ts-node": "*",
     "typescript": "*"
   },
-  "dependencies": {
-    "@coral-xyz/anchor": "=0.28.1-beta.2",
-    "@solana/web3.js": "*"
-  }
+  "dependencies": {}
 }

+ 3 - 3
ts/tests/src/spl/feature-proposal.ts

@@ -86,9 +86,9 @@ export async function featureProposalTests() {
   }
 
   async function fetchFeatureProposal() {
-    const featureProposal: { expired?: Buffer } =
-      await program.account.featureProposal.fetch(featureProposalPk);
-
+    const featureProposal = await program.account.featureProposal.fetch(
+      featureProposalPk
+    );
     if (!featureProposal.expired) {
       throw new Error("Feature should be expired.");
     }

+ 1 - 1
ts/tests/src/spl/record.ts

@@ -20,7 +20,7 @@ export async function recordTests() {
   });
   const kp = await loadKp();
 
-  const RECORD_DATA = new Uint8Array(8).fill(1);
+  const RECORD_DATA = Buffer.alloc(8).fill(1);
   const newAuthorityKp = new Keypair();
   let recordPk: PublicKey;
 

+ 1 - 1
ts/tests/src/spl/stake-pool.ts

@@ -454,7 +454,7 @@ export async function stakePoolTests() {
 
   async function setFee() {
     await program.methods
-      .setFee({ solReferral: 5 })
+      .setFee({ solReferral: [5] })
       .accounts({
         stakePool: stakePoolPk,
         manager: kp.publicKey,

+ 1 - 1
ts/yarn.lock

@@ -880,7 +880,7 @@
   dependencies:
     buffer "~6.0.3"
 
-"@solana/web3.js@*", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.68.0":
+"@solana/web3.js@^1.32.0", "@solana/web3.js@^1.68.0":
   version "1.68.0"
   resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.68.0.tgz#ded078d6e72f9f4b46e0f69925d4fe5c6cdcef54"
   integrity sha512-i41x4ArQrjdy/iQf75vKwZa+Mx1hOVquamHHe+5lNbObF4CT57oHOTvG9m9DTypuip3O9ucLoryywd6LfP2eEw==