Skip to content

Commit 38c6456

Browse files
authored
program: Fix build, bump everything to v3 (#58)
* program: Fix build, bump everything to v3 #### Problem After merging #32, dependabot went wild and started merging everything, because we didn't have status checks in place in our branch protection. This has left the program build broken. #### Summary of changes Finish bumping everything to v3! There's a slight regression on CUs, but nothing too ridiculous. * Update CLI version, regenerate clients
1 parent 51512a0 commit 38c6456

File tree

23 files changed

+1179
-2962
lines changed

23 files changed

+1179
-2962
lines changed

Cargo.lock

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

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
RUST_TOOLCHAIN_NIGHTLY = nightly-2025-02-16
2-
SOLANA_CLI_VERSION = 2.3.4
2+
SOLANA_CLI_VERSION = 3.0.0
33

44
nightly = +${RUST_TOOLCHAIN_NIGHTLY}
55

@@ -33,6 +33,7 @@ spellcheck:
3333
clippy-%:
3434
cargo $(nightly) clippy --manifest-path $(call make-path,$*)/Cargo.toml \
3535
--all-targets \
36+
--all-features \
3637
-- \
3738
--deny=warnings \
3839
--deny=clippy::default_trait_access \

clients/js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
},
3535
"license": "MIT",
3636
"peerDependencies": {
37-
"@solana/web3.js": "2.0.0-preview.4"
37+
"@solana/kit": "3.0.0"
3838
},
3939
"devDependencies": {
4040
"@ava/typescript": "^6.0.0",
4141
"@solana/eslint-config-solana": "^3.0.3",
42-
"@solana/web3.js": "2.0.0-preview.4",
42+
"@solana/kit": "3.0.0",
4343
"@solana/webcrypto-ed25519-polyfill": "3.0.3",
4444
"@types/node": "^24",
4545
"@typescript-eslint/eslint-plugin": "^7.16.1",

clients/js/pnpm-lock.yaml

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

clients/js/src/generated/errors/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* This code was AUTOGENERATED using the codama library.
2+
* This code was AUTOGENERATED using the Codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun codama to update it.
4+
* to add features, then rerun Codama to update it.
55
*
66
* @see https://github.com/codama-idl/codama
77
*/

clients/js/src/generated/errors/solanaFeatureGate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* This code was AUTOGENERATED using the codama library.
2+
* This code was AUTOGENERATED using the Codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun codama to update it.
4+
* to add features, then rerun Codama to update it.
55
*
66
* @see https://github.com/codama-idl/codama
77
*/
@@ -11,7 +11,7 @@ import {
1111
type Address,
1212
type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,
1313
type SolanaError,
14-
} from '@solana/web3.js';
14+
} from '@solana/kit';
1515
import { SOLANA_FEATURE_GATE_PROGRAM_ADDRESS } from '../programs';
1616

1717
/** FeatureAlreadyActivated: Feature already activated */

clients/js/src/generated/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* This code was AUTOGENERATED using the codama library.
2+
* This code was AUTOGENERATED using the Codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun codama to update it.
4+
* to add features, then rerun Codama to update it.
55
*
66
* @see https://github.com/codama-idl/codama
77
*/

clients/js/src/generated/instructions/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* This code was AUTOGENERATED using the codama library.
2+
* This code was AUTOGENERATED using the Codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun codama to update it.
4+
* to add features, then rerun Codama to update it.
55
*
66
* @see https://github.com/codama-idl/codama
77
*/

clients/js/src/generated/instructions/revokePendingActivation.ts

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* This code was AUTOGENERATED using the codama library.
2+
* This code was AUTOGENERATED using the Codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun codama to update it.
4+
* to add features, then rerun Codama to update it.
55
*
66
* @see https://github.com/codama-idl/codama
77
*/
@@ -13,20 +13,21 @@ import {
1313
getU8Decoder,
1414
getU8Encoder,
1515
transformEncoder,
16+
type AccountMeta,
17+
type AccountSignerMeta,
1618
type Address,
17-
type Codec,
18-
type Decoder,
19-
type Encoder,
20-
type IAccountMeta,
21-
type IAccountSignerMeta,
22-
type IInstruction,
23-
type IInstructionWithAccounts,
24-
type IInstructionWithData,
19+
type FixedSizeCodec,
20+
type FixedSizeDecoder,
21+
type FixedSizeEncoder,
22+
type Instruction,
23+
type InstructionWithAccounts,
24+
type InstructionWithData,
2525
type ReadonlyAccount,
26+
type ReadonlyUint8Array,
2627
type TransactionSigner,
2728
type WritableAccount,
2829
type WritableSignerAccount,
29-
} from '@solana/web3.js';
30+
} from '@solana/kit';
3031
import { SOLANA_FEATURE_GATE_PROGRAM_ADDRESS } from '../programs';
3132
import { getAccountMetaFactory, type ResolvedAccount } from '../shared';
3233

@@ -38,19 +39,19 @@ export function getRevokePendingActivationDiscriminatorBytes() {
3839

3940
export type RevokePendingActivationInstruction<
4041
TProgram extends string = typeof SOLANA_FEATURE_GATE_PROGRAM_ADDRESS,
41-
TAccountFeature extends string | IAccountMeta<string> = string,
42-
TAccountIncinerator extends string | IAccountMeta<string> = string,
42+
TAccountFeature extends string | AccountMeta<string> = string,
43+
TAccountIncinerator extends string | AccountMeta<string> = string,
4344
TAccountSystemProgram extends
4445
| string
45-
| IAccountMeta<string> = '11111111111111111111111111111111',
46-
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
47-
> = IInstruction<TProgram> &
48-
IInstructionWithData<Uint8Array> &
49-
IInstructionWithAccounts<
46+
| AccountMeta<string> = '11111111111111111111111111111111',
47+
TRemainingAccounts extends readonly AccountMeta<string>[] = [],
48+
> = Instruction<TProgram> &
49+
InstructionWithData<ReadonlyUint8Array> &
50+
InstructionWithAccounts<
5051
[
5152
TAccountFeature extends string
5253
? WritableSignerAccount<TAccountFeature> &
53-
IAccountSignerMeta<TAccountFeature>
54+
AccountSignerMeta<TAccountFeature>
5455
: TAccountFeature,
5556
TAccountIncinerator extends string
5657
? WritableAccount<TAccountIncinerator>
@@ -66,7 +67,7 @@ export type RevokePendingActivationInstructionData = { discriminator: number };
6667

6768
export type RevokePendingActivationInstructionDataArgs = {};
6869

69-
export function getRevokePendingActivationInstructionDataEncoder(): Encoder<RevokePendingActivationInstructionDataArgs> {
70+
export function getRevokePendingActivationInstructionDataEncoder(): FixedSizeEncoder<RevokePendingActivationInstructionDataArgs> {
7071
return transformEncoder(
7172
getStructEncoder([['discriminator', getU8Encoder()]]),
7273
(value) => ({
@@ -76,11 +77,11 @@ export function getRevokePendingActivationInstructionDataEncoder(): Encoder<Revo
7677
);
7778
}
7879

79-
export function getRevokePendingActivationInstructionDataDecoder(): Decoder<RevokePendingActivationInstructionData> {
80+
export function getRevokePendingActivationInstructionDataDecoder(): FixedSizeDecoder<RevokePendingActivationInstructionData> {
8081
return getStructDecoder([['discriminator', getU8Decoder()]]);
8182
}
8283

83-
export function getRevokePendingActivationInstructionDataCodec(): Codec<
84+
export function getRevokePendingActivationInstructionDataCodec(): FixedSizeCodec<
8485
RevokePendingActivationInstructionDataArgs,
8586
RevokePendingActivationInstructionData
8687
> {
@@ -143,27 +144,25 @@ export function getRevokePendingActivationInstruction<
143144
}
144145

145146
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
146-
const instruction = {
147+
return Object.freeze({
147148
accounts: [
148149
getAccountMeta(accounts.feature),
149150
getAccountMeta(accounts.incinerator),
150151
getAccountMeta(accounts.systemProgram),
151152
],
152-
programAddress,
153153
data: getRevokePendingActivationInstructionDataEncoder().encode({}),
154+
programAddress,
154155
} as RevokePendingActivationInstruction<
155156
TProgramAddress,
156157
TAccountFeature,
157158
TAccountIncinerator,
158159
TAccountSystemProgram
159-
>;
160-
161-
return instruction;
160+
>);
162161
}
163162

164163
export type ParsedRevokePendingActivationInstruction<
165164
TProgram extends string = typeof SOLANA_FEATURE_GATE_PROGRAM_ADDRESS,
166-
TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],
165+
TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
167166
> = {
168167
programAddress: Address<TProgram>;
169168
accounts: {
@@ -179,19 +178,19 @@ export type ParsedRevokePendingActivationInstruction<
179178

180179
export function parseRevokePendingActivationInstruction<
181180
TProgram extends string,
182-
TAccountMetas extends readonly IAccountMeta[],
181+
TAccountMetas extends readonly AccountMeta[],
183182
>(
184-
instruction: IInstruction<TProgram> &
185-
IInstructionWithAccounts<TAccountMetas> &
186-
IInstructionWithData<Uint8Array>
183+
instruction: Instruction<TProgram> &
184+
InstructionWithAccounts<TAccountMetas> &
185+
InstructionWithData<ReadonlyUint8Array>
187186
): ParsedRevokePendingActivationInstruction<TProgram, TAccountMetas> {
188187
if (instruction.accounts.length < 3) {
189188
// TODO: Coded error.
190189
throw new Error('Not enough accounts');
191190
}
192191
let accountIndex = 0;
193192
const getNextAccount = () => {
194-
const accountMeta = instruction.accounts![accountIndex]!;
193+
const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
195194
accountIndex += 1;
196195
return accountMeta;
197196
};

clients/js/src/generated/programs/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* This code was AUTOGENERATED using the codama library.
2+
* This code was AUTOGENERATED using the Codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun codama to update it.
4+
* to add features, then rerun Codama to update it.
55
*
66
* @see https://github.com/codama-idl/codama
77
*/

0 commit comments

Comments
 (0)