Skip to content

Commit 929564e

Browse files
committed
style(shank-and-codama): biome-format generated client, test, and IDL
1 parent b1fe2a8 commit 929564e

11 files changed

Lines changed: 182 additions & 389 deletions

File tree

tools/shank-and-codama/native/codama.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { readFileSync, rmSync } from "node:fs";
1212
import { dirname, join } from "node:path";
1313
import { fileURLToPath } from "node:url";
1414

15-
import { rootNodeFromAnchor, type AnchorIdl } from "@codama/nodes-from-anchor";
15+
import { type AnchorIdl, rootNodeFromAnchor } from "@codama/nodes-from-anchor";
1616
import { renderVisitor } from "@codama/renderers-js";
1717
import { createFromRoot } from "codama";
1818

tools/shank-and-codama/native/program/idl/car_rental_service.json

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,19 @@
99
"name": "carAccount",
1010
"isMut": true,
1111
"isSigner": false,
12-
"docs": [
13-
"The account that will represent the Car being created"
14-
]
12+
"docs": ["The account that will represent the Car being created"]
1513
},
1614
{
1715
"name": "payer",
1816
"isMut": true,
1917
"isSigner": false,
20-
"docs": [
21-
"Fee payer"
22-
]
18+
"docs": ["Fee payer"]
2319
},
2420
{
2521
"name": "systemProgram",
2622
"isMut": false,
2723
"isSigner": false,
28-
"docs": [
29-
"The System Program"
30-
]
24+
"docs": ["The System Program"]
3125
}
3226
],
3327
"args": [
@@ -50,33 +44,25 @@
5044
"name": "rentalAccount",
5145
"isMut": true,
5246
"isSigner": false,
53-
"docs": [
54-
"The account that will represent the actual order for the rental"
55-
]
47+
"docs": ["The account that will represent the actual order for the rental"]
5648
},
5749
{
5850
"name": "carAccount",
5951
"isMut": false,
6052
"isSigner": false,
61-
"docs": [
62-
"The account representing the Car being rented in this order"
63-
]
53+
"docs": ["The account representing the Car being rented in this order"]
6454
},
6555
{
6656
"name": "payer",
6757
"isMut": true,
6858
"isSigner": false,
69-
"docs": [
70-
"Fee payer"
71-
]
59+
"docs": ["Fee payer"]
7260
},
7361
{
7462
"name": "systemProgram",
7563
"isMut": false,
7664
"isSigner": false,
77-
"docs": [
78-
"The System Program"
79-
]
65+
"docs": ["The System Program"]
8066
}
8167
],
8268
"args": [
@@ -99,25 +85,19 @@
9985
"name": "rentalAccount",
10086
"isMut": true,
10187
"isSigner": false,
102-
"docs": [
103-
"The account representing the active rental"
104-
]
88+
"docs": ["The account representing the active rental"]
10589
},
10690
{
10791
"name": "carAccount",
10892
"isMut": false,
10993
"isSigner": false,
110-
"docs": [
111-
"The account representing the Car being rented in this order"
112-
]
94+
"docs": ["The account representing the Car being rented in this order"]
11395
},
11496
{
11597
"name": "payer",
11698
"isMut": true,
11799
"isSigner": false,
118-
"docs": [
119-
"Fee payer"
120-
]
100+
"docs": ["Fee payer"]
121101
}
122102
],
123103
"args": [],
@@ -133,25 +113,19 @@
133113
"name": "rentalAccount",
134114
"isMut": true,
135115
"isSigner": false,
136-
"docs": [
137-
"The account representing the active rental"
138-
]
116+
"docs": ["The account representing the active rental"]
139117
},
140118
{
141119
"name": "carAccount",
142120
"isMut": false,
143121
"isSigner": false,
144-
"docs": [
145-
"The account representing the Car being rented in this order"
146-
]
122+
"docs": ["The account representing the Car being rented in this order"]
147123
},
148124
{
149125
"name": "payer",
150126
"isMut": true,
151127
"isSigner": false,
152-
"docs": [
153-
"Fee payer"
154-
]
128+
"docs": ["Fee payer"]
155129
}
156130
],
157131
"args": [],
@@ -284,4 +258,4 @@
284258
"origin": "shank",
285259
"address": "8avNGHVXDwsELJaWMSoUZ44CirQd4zyU9Ez4ZmP4jNjZ"
286260
}
287-
}
261+
}

tools/shank-and-codama/native/tests/generated/src/generated/accounts/car.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@
77
*/
88

99
import {
10+
type Account,
11+
type Address,
1012
addDecoderSizePrefix,
1113
addEncoderSizePrefix,
1214
assertAccountExists,
1315
assertAccountsExist,
16+
type Codec,
1417
combineCodec,
18+
type Decoder,
1519
decodeAccount,
20+
type EncodedAccount,
21+
type Encoder,
22+
type FetchAccountConfig,
23+
type FetchAccountsConfig,
1624
fetchEncodedAccount,
1725
fetchEncodedAccounts,
1826
getStructDecoder,
@@ -23,14 +31,6 @@ import {
2331
getU32Encoder,
2432
getUtf8Decoder,
2533
getUtf8Encoder,
26-
type Account,
27-
type Address,
28-
type Codec,
29-
type Decoder,
30-
type EncodedAccount,
31-
type Encoder,
32-
type FetchAccountConfig,
33-
type FetchAccountsConfig,
3434
type MaybeAccount,
3535
type MaybeEncodedAccount,
3636
} from "@solana/kit";
@@ -71,10 +71,7 @@ export function decodeCar<TAddress extends string = string>(
7171
export function decodeCar<TAddress extends string = string>(
7272
encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,
7373
): Account<Car, TAddress> | MaybeAccount<Car, TAddress> {
74-
return decodeAccount(
75-
encodedAccount as MaybeEncodedAccount<TAddress>,
76-
getCarDecoder(),
77-
);
74+
return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getCarDecoder());
7875
}
7976

8077
export async function fetchCar<TAddress extends string = string>(

tools/shank-and-codama/native/tests/generated/src/generated/accounts/rentalOrder.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@
77
*/
88

99
import {
10+
type Account,
11+
type Address,
1012
addDecoderSizePrefix,
1113
addEncoderSizePrefix,
1214
assertAccountExists,
1315
assertAccountsExist,
16+
type Codec,
1417
combineCodec,
18+
type Decoder,
1519
decodeAccount,
20+
type EncodedAccount,
21+
type Encoder,
22+
type FetchAccountConfig,
23+
type FetchAccountsConfig,
1624
fetchEncodedAccount,
1725
fetchEncodedAccounts,
1826
getAddressDecoder,
@@ -25,14 +33,6 @@ import {
2533
getU64Encoder,
2634
getUtf8Decoder,
2735
getUtf8Encoder,
28-
type Account,
29-
type Address,
30-
type Codec,
31-
type Decoder,
32-
type EncodedAccount,
33-
type Encoder,
34-
type FetchAccountConfig,
35-
type FetchAccountsConfig,
3636
type MaybeAccount,
3737
type MaybeEncodedAccount,
3838
} from "@solana/kit";
@@ -99,10 +99,7 @@ export function decodeRentalOrder<TAddress extends string = string>(
9999
export function decodeRentalOrder<TAddress extends string = string>(
100100
encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,
101101
): Account<RentalOrder, TAddress> | MaybeAccount<RentalOrder, TAddress> {
102-
return decodeAccount(
103-
encodedAccount as MaybeEncodedAccount<TAddress>,
104-
getRentalOrderDecoder(),
105-
);
102+
return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getRentalOrderDecoder());
106103
}
107104

108105
export async function fetchRentalOrder<TAddress extends string = string>(

0 commit comments

Comments
 (0)