Skip to content

Commit 9c888e6

Browse files
committed
fix group 3 errors
1 parent 3fdd6f7 commit 9c888e6

File tree

7 files changed

+258
-296
lines changed

7 files changed

+258
-296
lines changed

basics/rent/anchor/package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"type": "module",
3-
"dependencies": {
4-
"@coral-xyz/anchor": "^0.30.0",
5-
"@solana/web3.js": "^1.95.2"
6-
},
7-
"devDependencies": {
8-
"anchor-bankrun": "^0.4.0",
9-
"solana-bankrun": "^0.3.0",
10-
"@types/bn.js": "^5.1.0",
11-
"@types/chai": "^4.3.0",
12-
"@types/mocha": "^9.0.0",
13-
"chai": "^4.3.4",
14-
"mocha": "^9.0.3",
15-
"ts-mocha": "^10.0.0",
16-
"typescript": "^4.3.5"
17-
}
2+
"type": "module",
3+
"dependencies": {
4+
"@coral-xyz/anchor": "0.31.1",
5+
"@solana/web3.js": "^1.95.2"
6+
},
7+
"devDependencies": {
8+
"@types/bn.js": "^5.1.0",
9+
"@types/chai": "^4.3.0",
10+
"@types/mocha": "^9.0.0",
11+
"anchor-bankrun": "^0.4.0",
12+
"chai": "^4.3.4",
13+
"mocha": "^9.0.3",
14+
"solana-bankrun": "^0.3.0",
15+
"ts-mocha": "^10.0.0",
16+
"typescript": "^4.3.5"
17+
}
1818
}

basics/rent/anchor/pnpm-lock.yaml

Lines changed: 21 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

basics/rent/anchor/tests/test.ts

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1-
import * as anchor from '@coral-xyz/anchor';
2-
import Idl from '../target/idl/rent_example.json';
3-
import type { RentExample } from '../target/types/rent_example';
1+
import * as anchor from "@coral-xyz/anchor";
2+
import Idl from "../target/idl/rent_example.json" with { type: "json" };
3+
import type { RentExample } from "../target/types/rent_example";
44

5-
describe('Create a system account', () => {
6-
const provider = anchor.AnchorProvider.env();
7-
anchor.setProvider(provider);
8-
const wallet = provider.wallet as anchor.Wallet;
9-
const program = anchor.workspace.RentExample as anchor.Program<RentExample>;
5+
describe("Create a system account", () => {
6+
const provider = anchor.AnchorProvider.env();
7+
anchor.setProvider(provider);
8+
const wallet = provider.wallet as anchor.Wallet;
9+
const program = anchor.workspace.RentExample as anchor.Program<RentExample>;
1010

11-
it('Create the account', async () => {
12-
const newKeypair = anchor.web3.Keypair.generate();
11+
it("Create the account", async () => {
12+
const newKeypair = anchor.web3.Keypair.generate();
1313

14-
const addressData: anchor.IdlTypes<RentExample>['addressData'] = {
15-
name: 'Marcus',
16-
address: '123 Main St. San Francisco, CA',
17-
};
14+
const addressData: anchor.IdlTypes<RentExample>["addressData"] = {
15+
name: "Marcus",
16+
address: "123 Main St. San Francisco, CA",
17+
};
1818

19-
// We're just going to serialize our object here so we can check
20-
// the size on the client side against the program logs
21-
//
22-
const addressDataBuffer = new anchor.BorshCoder(Idl as anchor.Idl).types.encode('AddressData', addressData);
23-
console.log(`Address data buffer length: ${addressDataBuffer.length}`);
19+
// We're just going to serialize our object here so we can check
20+
// the size on the client side against the program logs
21+
//
22+
const addressDataBuffer = new anchor.BorshCoder(
23+
Idl as anchor.Idl,
24+
).types.encode("AddressData", addressData);
25+
console.log(`Address data buffer length: ${addressDataBuffer.length}`);
2426

25-
await program.methods
26-
.createSystemAccount(addressData)
27-
.accounts({
28-
payer: wallet.publicKey,
29-
newAccount: newKeypair.publicKey,
30-
})
31-
.signers([wallet.payer, newKeypair])
32-
.rpc();
33-
});
27+
await program.methods
28+
.createSystemAccount(addressData)
29+
.accounts({
30+
payer: wallet.publicKey,
31+
newAccount: newKeypair.publicKey,
32+
})
33+
.signers([wallet.payer, newKeypair])
34+
.rpc();
35+
});
3436
});
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"type": "module",
3-
"dependencies": {
4-
"@coral-xyz/anchor": "^0.30.0",
5-
"@solana/web3.js": "^1.95.2"
6-
},
7-
"devDependencies": {
8-
"anchor-bankrun": "^0.4.0",
9-
"solana-bankrun": "^0.3.0",
10-
"@types/bn.js": "^5.1.0",
11-
"@types/chai": "^4.3.0",
12-
"@types/mocha": "^9.0.0",
13-
"chai": "^4.3.4",
14-
"mocha": "^9.0.3",
15-
"ts-mocha": "^10.0.0",
16-
"typescript": "^4.3.5"
17-
}
2+
"type": "module",
3+
"dependencies": {
4+
"@coral-xyz/anchor": "0.31.1",
5+
"@solana/web3.js": "^1.95.2"
6+
},
7+
"devDependencies": {
8+
"@types/bn.js": "^5.1.0",
9+
"@types/chai": "^4.3.0",
10+
"@types/mocha": "^9.0.0",
11+
"anchor-bankrun": "^0.4.0",
12+
"chai": "^4.3.4",
13+
"mocha": "^9.0.3",
14+
"solana-bankrun": "^0.3.0",
15+
"ts-mocha": "^10.0.0",
16+
"typescript": "^4.3.5"
17+
}
1818
}

0 commit comments

Comments
 (0)