Skip to content

Commit 02e7803

Browse files
committed
fix: use accountsPartial
1 parent 4bd69b6 commit 02e7803

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

tests/cpi-returns/tests/cpi-return.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("CPI return", () => {
3333
it("can initialize", async () => {
3434
await calleeProgram.methods
3535
.initialize()
36-
.accounts({
36+
.accountsPartial({
3737
account: cpiReturn.publicKey,
3838
user: provider.wallet.publicKey,
3939
systemProgram: SystemProgram.programId,
@@ -86,7 +86,7 @@ describe("CPI return", () => {
8686
it("can return a struct from a cpi", async () => {
8787
const tx = await callerProgram.methods
8888
.cpiCallReturnStruct()
89-
.accounts({
89+
.accountsPartial({
9090
cpiReturn: cpiReturn.publicKey,
9191
cpiReturnProgram: calleeProgram.programId,
9292
})
@@ -124,7 +124,7 @@ describe("CPI return", () => {
124124
it("can return a vec from a cpi", async () => {
125125
const tx = await callerProgram.methods
126126
.cpiCallReturnVec()
127-
.accounts({
127+
.accountsPartial({
128128
cpiReturn: cpiReturn.publicKey,
129129
cpiReturnProgram: calleeProgram.programId,
130130
})
@@ -134,7 +134,7 @@ describe("CPI return", () => {
134134
});
135135

136136
const [key, data, buffer] = getReturnLog(t);
137-
assert.equal(key, calleeProgram.programId);
137+
assert.strictEqual(key, calleeProgram.programId);
138138

139139
// Check for matching log on receive side
140140
let receiveLog = t.meta.logMessages.find(
@@ -213,7 +213,7 @@ describe("CPI return", () => {
213213
try {
214214
await calleeProgram.methods
215215
.initialize()
216-
.accounts({
216+
.accountsPartial({
217217
account: cpiReturn.publicKey,
218218
user: provider.wallet.publicKey,
219219
systemProgram: SystemProgram.programId,

tests/custom-coder/tests/spl-associated-token-coder.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("spl-associated-token-coder", () => {
3434
// act
3535
await program.methods
3636
.create()
37-
.accounts({
37+
.accountsPartial({
3838
associatedAccountAddress: associatedToken,
3939
fundingAddress: provider.wallet.publicKey,
4040
systemProgram: systemProgram.programId,
@@ -47,7 +47,7 @@ describe("spl-associated-token-coder", () => {
4747
tokenProgram.account.mint.createInstruction(mintKeypair),
4848
tokenProgram.methods
4949
.initializeMint(mintDecimals, provider.wallet.publicKey, null)
50-
.accounts({
50+
.accountsPartial({
5151
mint: mintKeypair.publicKey,
5252
rent: SYSVAR_RENT_PUBKEY,
5353
})

tests/custom-coder/tests/spl-token-coder.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("spl-token", () => {
2323
it("Creates a mint", async () => {
2424
await program.methods
2525
.initializeMint(6, provider.wallet.publicKey, null)
26-
.accounts({
26+
.accountsPartial({
2727
mint: mintKeypair.publicKey,
2828
rent,
2929
})
@@ -45,7 +45,7 @@ describe("spl-token", () => {
4545
it("Creates a token account for alice", async () => {
4646
await program.methods
4747
.initializeAccount()
48-
.accounts({
48+
.accountsPartial({
4949
account: aliceTokenKeypair.publicKey,
5050
mint: mintKeypair.publicKey,
5151
owner: provider.wallet.publicKey,
@@ -90,7 +90,7 @@ describe("spl-token", () => {
9090
it("Creates a token for bob", async () => {
9191
await program.methods
9292
.initializeAccount()
93-
.accounts({
93+
.accountsPartial({
9494
account: bobTokenKeypair.publicKey,
9595
mint: mintKeypair.publicKey,
9696
owner: provider.wallet.publicKey,

tests/floats/tests/floats.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as anchor from "@coral-xyz/anchor";
2-
import { Program, getProvider } from "@coral-xyz/anchor";
2+
import { Program } from "@coral-xyz/anchor";
33
import { Keypair, SystemProgram } from "@solana/web3.js";
44
import { Floats } from "../target/types/floats";
55
import { assert } from "chai";
@@ -16,7 +16,7 @@ describe("floats", () => {
1616

1717
await program.methods
1818
.create(1.0, 2.0)
19-
.accounts({
19+
.accountsPartial({
2020
account: accountKeypair.publicKey,
2121
authority: provider.wallet.publicKey,
2222
systemProgram: SystemProgram.programId,
@@ -38,7 +38,7 @@ describe("floats", () => {
3838

3939
await program.methods
4040
.create(1.0, 2.0)
41-
.accounts({
41+
.accountsStrict({
4242
account: accountKeypair.publicKey,
4343
authority: authorityPublicKey,
4444
systemProgram: SystemProgram.programId,
@@ -52,7 +52,7 @@ describe("floats", () => {
5252

5353
await program.methods
5454
.update(3.0, 4.0)
55-
.accounts({
55+
.accountsStrict({
5656
account: accountKeypair.publicKey,
5757
authority: authorityPublicKey,
5858
})

0 commit comments

Comments
 (0)