Skip to content

Commit

Permalink
Fix resolver arguments from Kinobi
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed Dec 12, 2023
1 parent 1c3c592 commit 31a5153
Show file tree
Hide file tree
Showing 21 changed files with 129 additions and 139 deletions.
11 changes: 5 additions & 6 deletions clients/js/src/generated/instructions/advanceNonceAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ export function getAdvanceNonceAccountInstruction<
accounts.recentBlockhashesSysvar.value =
'SysvarRecentB1ockHashes11111111111111111111' as Address<'SysvarRecentB1ockHashes11111111111111111111'>;
}
// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
Expand All @@ -282,12 +287,6 @@ export function getAdvanceNonceAccountInstruction<
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getAdvanceNonceAccountInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/allocate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,19 @@ export function getAllocateInstruction<
// Original args.
const args = { ...input };

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getAllocateInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/allocateWithSeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,19 +262,19 @@ export function getAllocateWithSeedInstruction<
// Original args.
const args = { ...input };

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getAllocateWithSeedInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/assign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,19 @@ export function getAssignInstruction<
// Original args.
const args = { ...input };

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getAssignInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/assignWithSeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,19 @@ export function getAssignWithSeedInstruction<
// Original args.
const args = { ...input };

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getAssignWithSeedInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
11 changes: 5 additions & 6 deletions clients/js/src/generated/instructions/authorizeNonceAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ export function getAuthorizeNonceAccountInstruction<
if (!args.nonceAccountArg) {
args.nonceAccountArg = expectAddress(accounts.nonceAccount.value);
}
// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
Expand All @@ -254,12 +259,6 @@ export function getAuthorizeNonceAccountInstruction<
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getAuthorizeNonceAccountInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/closeLookupTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,19 @@ export function getCloseLookupTableInstruction<
recipient: { value: input.recipient ?? null, isWritable: true },
};

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getCloseLookupTableInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/createAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,19 +241,19 @@ export function getCreateAccountInstruction<
// Original args.
const args = { ...input };

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = Number(args.space) + BASE_ACCOUNT_SIZE;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = Number(args.space) + BASE_ACCOUNT_SIZE;

return Object.freeze({
...getCreateAccountInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/createAccountWithSeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,19 @@ export function getCreateAccountWithSeedInstruction<
// Original args.
const args = { ...input };

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getCreateAccountWithSeedInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
22 changes: 10 additions & 12 deletions clients/js/src/generated/instructions/createLookupTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ export async function getCreateLookupTableInstructionAsync<
if (!args.bump) {
args.bump = expectProgramDerivedAddress(accounts.address.value)[1];
}
// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 56 + BASE_ACCOUNT_SIZE;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
Expand All @@ -367,12 +372,6 @@ export async function getCreateLookupTableInstructionAsync<
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 56 + BASE_ACCOUNT_SIZE;

return Object.freeze({
...getCreateLookupTableInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down Expand Up @@ -574,6 +573,11 @@ export function getCreateLookupTableInstruction<
if (!args.bump) {
args.bump = expectProgramDerivedAddress(accounts.address.value)[1];
}
// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 56 + BASE_ACCOUNT_SIZE;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
Expand All @@ -582,12 +586,6 @@ export function getCreateLookupTableInstruction<
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 56 + BASE_ACCOUNT_SIZE;

return Object.freeze({
...getCreateLookupTableInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/deactivateLookupTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,19 @@ export function getDeactivateLookupTableInstruction<
authority: { value: input.authority ?? null, isWritable: false },
};

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getDeactivateLookupTableInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
19 changes: 8 additions & 11 deletions clients/js/src/generated/instructions/extendLookupTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ export function getExtendLookupTableInstruction<
// Original args.
const args = { ...input };

// Resolver scope.
const resolverScope = { context, programAddress, accounts, args };

// Resolve default values.
if (!accounts.systemProgram.value) {
accounts.systemProgram.value = getProgramAddress(
Expand All @@ -338,6 +341,11 @@ export function getExtendLookupTableInstruction<
);
accounts.systemProgram.isWritable = false;
}
// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = resolveExtendLookupTableBytes(resolverScope);

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
Expand All @@ -346,17 +354,6 @@ export function getExtendLookupTableInstruction<
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = await resolveExtendLookupTableBytes(
context,
resolvedAccounts,
resolvedArgs,
programId
);

return Object.freeze({
...getExtendLookupTableInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
12 changes: 6 additions & 6 deletions clients/js/src/generated/instructions/freezeLookupTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,19 @@ export function getFreezeLookupTableInstruction<
authority: { value: input.authority ?? null, isWritable: false },
};

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
accounts,
'programId',
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getFreezeLookupTableInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
11 changes: 5 additions & 6 deletions clients/js/src/generated/instructions/initializeNonceAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ export function getInitializeNonceAccountInstruction<
if (!args.nonceAccountArg) {
args.nonceAccountArg = expectAddress(accounts.nonceAccount.value);
}
// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

// Get account metas and signers.
const accountMetas = getAccountMetasWithSigners(
Expand All @@ -307,12 +312,6 @@ export function getInitializeNonceAccountInstruction<
programAddress
);

// Remaining accounts.
const remainingAccounts: IAccountMeta[] = [];

// Bytes created on chain.
const bytesCreatedOnChain = 0;

return Object.freeze({
...getInitializeNonceAccountInstructionRaw(
accountMetas as Record<keyof AccountMetas, IAccountMeta>,
Expand Down
Loading

0 comments on commit 31a5153

Please sign in to comment.