diff --git a/Cargo.lock b/Cargo.lock index 44894c2..210961a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2553,6 +2553,7 @@ dependencies = [ "jito-restaking-sdk", "jito-tip-router-core", "jito-vault-core", + "jito-vault-program", "jito-vault-sdk", "shank", "solana-program 1.18.26", diff --git a/clients/js/jito_tip_router/instructions/adminUpdateWeightTable.ts b/clients/js/jito_tip_router/instructions/adminUpdateWeightTable.ts index 36e207f..033d67a 100644 --- a/clients/js/jito_tip_router/instructions/adminUpdateWeightTable.ts +++ b/clients/js/jito_tip_router/instructions/adminUpdateWeightTable.ts @@ -46,7 +46,7 @@ export type AdminUpdateWeightTableInstruction< TAccountWeightTable extends string | IAccountMeta = string, TAccountWeightTableAdmin extends string | IAccountMeta = string, TAccountMint extends string | IAccountMeta = string, - TAccountRestakingProgramId extends string | IAccountMeta = string, + TAccountRestakingProgram extends string | IAccountMeta = string, TRemainingAccounts extends readonly IAccountMeta[] = [], > = IInstruction & IInstructionWithData & @@ -63,9 +63,9 @@ export type AdminUpdateWeightTableInstruction< TAccountMint extends string ? ReadonlyAccount : TAccountMint, - TAccountRestakingProgramId extends string - ? ReadonlyAccount - : TAccountRestakingProgramId, + TAccountRestakingProgram extends string + ? ReadonlyAccount + : TAccountRestakingProgram, ...TRemainingAccounts, ] >; @@ -118,13 +118,13 @@ export type AdminUpdateWeightTableInput< TAccountWeightTable extends string = string, TAccountWeightTableAdmin extends string = string, TAccountMint extends string = string, - TAccountRestakingProgramId extends string = string, + TAccountRestakingProgram extends string = string, > = { ncn: Address; weightTable: Address; weightTableAdmin: TransactionSigner; mint: Address; - restakingProgramId: Address; + restakingProgram: Address; ncnEpoch: AdminUpdateWeightTableInstructionDataArgs['ncnEpoch']; weight: AdminUpdateWeightTableInstructionDataArgs['weight']; }; @@ -134,7 +134,7 @@ export function getAdminUpdateWeightTableInstruction< TAccountWeightTable extends string, TAccountWeightTableAdmin extends string, TAccountMint extends string, - TAccountRestakingProgramId extends string, + TAccountRestakingProgram extends string, TProgramAddress extends Address = typeof JITO_TIP_ROUTER_PROGRAM_ADDRESS, >( input: AdminUpdateWeightTableInput< @@ -142,7 +142,7 @@ export function getAdminUpdateWeightTableInstruction< TAccountWeightTable, TAccountWeightTableAdmin, TAccountMint, - TAccountRestakingProgramId + TAccountRestakingProgram >, config?: { programAddress?: TProgramAddress } ): AdminUpdateWeightTableInstruction< @@ -151,7 +151,7 @@ export function getAdminUpdateWeightTableInstruction< TAccountWeightTable, TAccountWeightTableAdmin, TAccountMint, - TAccountRestakingProgramId + TAccountRestakingProgram > { // Program address. const programAddress = @@ -166,8 +166,8 @@ export function getAdminUpdateWeightTableInstruction< isWritable: false, }, mint: { value: input.mint ?? null, isWritable: false }, - restakingProgramId: { - value: input.restakingProgramId ?? null, + restakingProgram: { + value: input.restakingProgram ?? null, isWritable: false, }, }; @@ -186,7 +186,7 @@ export function getAdminUpdateWeightTableInstruction< getAccountMeta(accounts.weightTable), getAccountMeta(accounts.weightTableAdmin), getAccountMeta(accounts.mint), - getAccountMeta(accounts.restakingProgramId), + getAccountMeta(accounts.restakingProgram), ], programAddress, data: getAdminUpdateWeightTableInstructionDataEncoder().encode( @@ -198,7 +198,7 @@ export function getAdminUpdateWeightTableInstruction< TAccountWeightTable, TAccountWeightTableAdmin, TAccountMint, - TAccountRestakingProgramId + TAccountRestakingProgram >; return instruction; @@ -214,7 +214,7 @@ export type ParsedAdminUpdateWeightTableInstruction< weightTable: TAccountMetas[1]; weightTableAdmin: TAccountMetas[2]; mint: TAccountMetas[3]; - restakingProgramId: TAccountMetas[4]; + restakingProgram: TAccountMetas[4]; }; data: AdminUpdateWeightTableInstructionData; }; @@ -244,7 +244,7 @@ export function parseAdminUpdateWeightTableInstruction< weightTable: getNextAccount(), weightTableAdmin: getNextAccount(), mint: getNextAccount(), - restakingProgramId: getNextAccount(), + restakingProgram: getNextAccount(), }, data: getAdminUpdateWeightTableInstructionDataDecoder().decode( instruction.data diff --git a/clients/js/jito_tip_router/instructions/initializeEpochSnapshot.ts b/clients/js/jito_tip_router/instructions/initializeEpochSnapshot.ts index 1e9857d..66cb8f9 100644 --- a/clients/js/jito_tip_router/instructions/initializeEpochSnapshot.ts +++ b/clients/js/jito_tip_router/instructions/initializeEpochSnapshot.ts @@ -50,7 +50,7 @@ export type InitializeEpochSnapshotInstruction< TAccountWeightTable extends string | IAccountMeta = string, TAccountEpochSnapshot extends string | IAccountMeta = string, TAccountPayer extends string | IAccountMeta = string, - TAccountRestakingProgramId extends string | IAccountMeta = string, + TAccountRestakingProgram extends string | IAccountMeta = string, TAccountSystemProgram extends | string | IAccountMeta = '11111111111111111111111111111111', @@ -76,9 +76,9 @@ export type InitializeEpochSnapshotInstruction< ? WritableSignerAccount & IAccountSignerMeta : TAccountPayer, - TAccountRestakingProgramId extends string - ? ReadonlyAccount - : TAccountRestakingProgramId, + TAccountRestakingProgram extends string + ? ReadonlyAccount + : TAccountRestakingProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, @@ -132,7 +132,7 @@ export type InitializeEpochSnapshotInput< TAccountWeightTable extends string = string, TAccountEpochSnapshot extends string = string, TAccountPayer extends string = string, - TAccountRestakingProgramId extends string = string, + TAccountRestakingProgram extends string = string, TAccountSystemProgram extends string = string, > = { ncnConfig: Address; @@ -141,7 +141,7 @@ export type InitializeEpochSnapshotInput< weightTable: Address; epochSnapshot: Address; payer: TransactionSigner; - restakingProgramId: Address; + restakingProgram: Address; systemProgram?: Address; firstSlotOfNcnEpoch: InitializeEpochSnapshotInstructionDataArgs['firstSlotOfNcnEpoch']; }; @@ -153,7 +153,7 @@ export function getInitializeEpochSnapshotInstruction< TAccountWeightTable extends string, TAccountEpochSnapshot extends string, TAccountPayer extends string, - TAccountRestakingProgramId extends string, + TAccountRestakingProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof JITO_TIP_ROUTER_PROGRAM_ADDRESS, >( @@ -164,7 +164,7 @@ export function getInitializeEpochSnapshotInstruction< TAccountWeightTable, TAccountEpochSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram >, config?: { programAddress?: TProgramAddress } @@ -176,7 +176,7 @@ export function getInitializeEpochSnapshotInstruction< TAccountWeightTable, TAccountEpochSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram > { // Program address. @@ -194,8 +194,8 @@ export function getInitializeEpochSnapshotInstruction< weightTable: { value: input.weightTable ?? null, isWritable: false }, epochSnapshot: { value: input.epochSnapshot ?? null, isWritable: true }, payer: { value: input.payer ?? null, isWritable: true }, - restakingProgramId: { - value: input.restakingProgramId ?? null, + restakingProgram: { + value: input.restakingProgram ?? null, isWritable: false, }, systemProgram: { value: input.systemProgram ?? null, isWritable: false }, @@ -223,7 +223,7 @@ export function getInitializeEpochSnapshotInstruction< getAccountMeta(accounts.weightTable), getAccountMeta(accounts.epochSnapshot), getAccountMeta(accounts.payer), - getAccountMeta(accounts.restakingProgramId), + getAccountMeta(accounts.restakingProgram), getAccountMeta(accounts.systemProgram), ], programAddress, @@ -238,7 +238,7 @@ export function getInitializeEpochSnapshotInstruction< TAccountWeightTable, TAccountEpochSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram >; @@ -257,7 +257,7 @@ export type ParsedInitializeEpochSnapshotInstruction< weightTable: TAccountMetas[3]; epochSnapshot: TAccountMetas[4]; payer: TAccountMetas[5]; - restakingProgramId: TAccountMetas[6]; + restakingProgram: TAccountMetas[6]; systemProgram: TAccountMetas[7]; }; data: InitializeEpochSnapshotInstructionData; @@ -290,7 +290,7 @@ export function parseInitializeEpochSnapshotInstruction< weightTable: getNextAccount(), epochSnapshot: getNextAccount(), payer: getNextAccount(), - restakingProgramId: getNextAccount(), + restakingProgram: getNextAccount(), systemProgram: getNextAccount(), }, data: getInitializeEpochSnapshotInstructionDataDecoder().decode( diff --git a/clients/js/jito_tip_router/instructions/initializeNCNConfig.ts b/clients/js/jito_tip_router/instructions/initializeNCNConfig.ts index 0f7834e..29c966b 100644 --- a/clients/js/jito_tip_router/instructions/initializeNCNConfig.ts +++ b/clients/js/jito_tip_router/instructions/initializeNCNConfig.ts @@ -46,7 +46,7 @@ export type InitializeNCNConfigInstruction< TAccountNcnAdmin extends string | IAccountMeta = string, TAccountFeeWallet extends string | IAccountMeta = string, TAccountTieBreakerAdmin extends string | IAccountMeta = string, - TAccountRestakingProgramId extends string | IAccountMeta = string, + TAccountRestakingProgram extends string | IAccountMeta = string, TAccountSystemProgram extends | string | IAccountMeta = '11111111111111111111111111111111', @@ -72,9 +72,9 @@ export type InitializeNCNConfigInstruction< TAccountTieBreakerAdmin extends string ? ReadonlyAccount : TAccountTieBreakerAdmin, - TAccountRestakingProgramId extends string - ? ReadonlyAccount - : TAccountRestakingProgramId, + TAccountRestakingProgram extends string + ? ReadonlyAccount + : TAccountRestakingProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, @@ -136,7 +136,7 @@ export type InitializeNCNConfigInput< TAccountNcnAdmin extends string = string, TAccountFeeWallet extends string = string, TAccountTieBreakerAdmin extends string = string, - TAccountRestakingProgramId extends string = string, + TAccountRestakingProgram extends string = string, TAccountSystemProgram extends string = string, > = { restakingConfig: Address; @@ -145,7 +145,7 @@ export type InitializeNCNConfigInput< ncnAdmin: TransactionSigner; feeWallet: Address; tieBreakerAdmin: Address; - restakingProgramId: Address; + restakingProgram: Address; systemProgram?: Address; daoFeeBps: InitializeNCNConfigInstructionDataArgs['daoFeeBps']; ncnFeeBps: InitializeNCNConfigInstructionDataArgs['ncnFeeBps']; @@ -159,7 +159,7 @@ export function getInitializeNCNConfigInstruction< TAccountNcnAdmin extends string, TAccountFeeWallet extends string, TAccountTieBreakerAdmin extends string, - TAccountRestakingProgramId extends string, + TAccountRestakingProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof JITO_TIP_ROUTER_PROGRAM_ADDRESS, >( @@ -170,7 +170,7 @@ export function getInitializeNCNConfigInstruction< TAccountNcnAdmin, TAccountFeeWallet, TAccountTieBreakerAdmin, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram >, config?: { programAddress?: TProgramAddress } @@ -182,7 +182,7 @@ export function getInitializeNCNConfigInstruction< TAccountNcnAdmin, TAccountFeeWallet, TAccountTieBreakerAdmin, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram > { // Program address. @@ -203,8 +203,8 @@ export function getInitializeNCNConfigInstruction< value: input.tieBreakerAdmin ?? null, isWritable: false, }, - restakingProgramId: { - value: input.restakingProgramId ?? null, + restakingProgram: { + value: input.restakingProgram ?? null, isWritable: false, }, systemProgram: { value: input.systemProgram ?? null, isWritable: false }, @@ -232,7 +232,7 @@ export function getInitializeNCNConfigInstruction< getAccountMeta(accounts.ncnAdmin), getAccountMeta(accounts.feeWallet), getAccountMeta(accounts.tieBreakerAdmin), - getAccountMeta(accounts.restakingProgramId), + getAccountMeta(accounts.restakingProgram), getAccountMeta(accounts.systemProgram), ], programAddress, @@ -247,7 +247,7 @@ export function getInitializeNCNConfigInstruction< TAccountNcnAdmin, TAccountFeeWallet, TAccountTieBreakerAdmin, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram >; @@ -266,7 +266,7 @@ export type ParsedInitializeNCNConfigInstruction< ncnAdmin: TAccountMetas[3]; feeWallet: TAccountMetas[4]; tieBreakerAdmin: TAccountMetas[5]; - restakingProgramId: TAccountMetas[6]; + restakingProgram: TAccountMetas[6]; systemProgram: TAccountMetas[7]; }; data: InitializeNCNConfigInstructionData; @@ -299,7 +299,7 @@ export function parseInitializeNCNConfigInstruction< ncnAdmin: getNextAccount(), feeWallet: getNextAccount(), tieBreakerAdmin: getNextAccount(), - restakingProgramId: getNextAccount(), + restakingProgram: getNextAccount(), systemProgram: getNextAccount(), }, data: getInitializeNCNConfigInstructionDataDecoder().decode( diff --git a/clients/js/jito_tip_router/instructions/initializeOperatorSnapshot.ts b/clients/js/jito_tip_router/instructions/initializeOperatorSnapshot.ts index aa74bff..8e70d5c 100644 --- a/clients/js/jito_tip_router/instructions/initializeOperatorSnapshot.ts +++ b/clients/js/jito_tip_router/instructions/initializeOperatorSnapshot.ts @@ -52,7 +52,7 @@ export type InitializeOperatorSnapshotInstruction< TAccountEpochSnapshot extends string | IAccountMeta = string, TAccountOperatorSnapshot extends string | IAccountMeta = string, TAccountPayer extends string | IAccountMeta = string, - TAccountRestakingProgramId extends string | IAccountMeta = string, + TAccountRestakingProgram extends string | IAccountMeta = string, TAccountSystemProgram extends | string | IAccountMeta = '11111111111111111111111111111111', @@ -84,9 +84,9 @@ export type InitializeOperatorSnapshotInstruction< ? WritableSignerAccount & IAccountSignerMeta : TAccountPayer, - TAccountRestakingProgramId extends string - ? ReadonlyAccount - : TAccountRestakingProgramId, + TAccountRestakingProgram extends string + ? ReadonlyAccount + : TAccountRestakingProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, @@ -142,7 +142,7 @@ export type InitializeOperatorSnapshotInput< TAccountEpochSnapshot extends string = string, TAccountOperatorSnapshot extends string = string, TAccountPayer extends string = string, - TAccountRestakingProgramId extends string = string, + TAccountRestakingProgram extends string = string, TAccountSystemProgram extends string = string, > = { ncnConfig: Address; @@ -153,7 +153,7 @@ export type InitializeOperatorSnapshotInput< epochSnapshot: Address; operatorSnapshot: Address; payer: TransactionSigner; - restakingProgramId: Address; + restakingProgram: Address; systemProgram?: Address; firstSlotOfNcnEpoch: InitializeOperatorSnapshotInstructionDataArgs['firstSlotOfNcnEpoch']; }; @@ -167,7 +167,7 @@ export function getInitializeOperatorSnapshotInstruction< TAccountEpochSnapshot extends string, TAccountOperatorSnapshot extends string, TAccountPayer extends string, - TAccountRestakingProgramId extends string, + TAccountRestakingProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof JITO_TIP_ROUTER_PROGRAM_ADDRESS, >( @@ -180,7 +180,7 @@ export function getInitializeOperatorSnapshotInstruction< TAccountEpochSnapshot, TAccountOperatorSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram >, config?: { programAddress?: TProgramAddress } @@ -194,7 +194,7 @@ export function getInitializeOperatorSnapshotInstruction< TAccountEpochSnapshot, TAccountOperatorSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram > { // Program address. @@ -220,8 +220,8 @@ export function getInitializeOperatorSnapshotInstruction< isWritable: true, }, payer: { value: input.payer ?? null, isWritable: true }, - restakingProgramId: { - value: input.restakingProgramId ?? null, + restakingProgram: { + value: input.restakingProgram ?? null, isWritable: false, }, systemProgram: { value: input.systemProgram ?? null, isWritable: false }, @@ -251,7 +251,7 @@ export function getInitializeOperatorSnapshotInstruction< getAccountMeta(accounts.epochSnapshot), getAccountMeta(accounts.operatorSnapshot), getAccountMeta(accounts.payer), - getAccountMeta(accounts.restakingProgramId), + getAccountMeta(accounts.restakingProgram), getAccountMeta(accounts.systemProgram), ], programAddress, @@ -268,7 +268,7 @@ export function getInitializeOperatorSnapshotInstruction< TAccountEpochSnapshot, TAccountOperatorSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram >; @@ -289,7 +289,7 @@ export type ParsedInitializeOperatorSnapshotInstruction< epochSnapshot: TAccountMetas[5]; operatorSnapshot: TAccountMetas[6]; payer: TAccountMetas[7]; - restakingProgramId: TAccountMetas[8]; + restakingProgram: TAccountMetas[8]; systemProgram: TAccountMetas[9]; }; data: InitializeOperatorSnapshotInstructionData; @@ -324,7 +324,7 @@ export function parseInitializeOperatorSnapshotInstruction< epochSnapshot: getNextAccount(), operatorSnapshot: getNextAccount(), payer: getNextAccount(), - restakingProgramId: getNextAccount(), + restakingProgram: getNextAccount(), systemProgram: getNextAccount(), }, data: getInitializeOperatorSnapshotInstructionDataDecoder().decode( diff --git a/clients/js/jito_tip_router/instructions/initializeVaultOperatorDelegationSnapshot.ts b/clients/js/jito_tip_router/instructions/initializeVaultOperatorDelegationSnapshot.ts index 9416e77..cc6c604 100644 --- a/clients/js/jito_tip_router/instructions/initializeVaultOperatorDelegationSnapshot.ts +++ b/clients/js/jito_tip_router/instructions/initializeVaultOperatorDelegationSnapshot.ts @@ -63,7 +63,8 @@ export type InitializeVaultOperatorDelegationSnapshotInstruction< | string | IAccountMeta = string, TAccountPayer extends string | IAccountMeta = string, - TAccountRestakingProgramId extends string | IAccountMeta = string, + TAccountVaultProgram extends string | IAccountMeta = string, + TAccountRestakingProgram extends string | IAccountMeta = string, TAccountSystemProgram extends | string | IAccountMeta = '11111111111111111111111111111111', @@ -110,9 +111,12 @@ export type InitializeVaultOperatorDelegationSnapshotInstruction< ? WritableSignerAccount & IAccountSignerMeta : TAccountPayer, - TAccountRestakingProgramId extends string - ? ReadonlyAccount - : TAccountRestakingProgramId, + TAccountVaultProgram extends string + ? ReadonlyAccount + : TAccountVaultProgram, + TAccountRestakingProgram extends string + ? ReadonlyAccount + : TAccountRestakingProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, @@ -174,7 +178,8 @@ export type InitializeVaultOperatorDelegationSnapshotInput< TAccountOperatorSnapshot extends string = string, TAccountVaultOperatorDelegationSnapshot extends string = string, TAccountPayer extends string = string, - TAccountRestakingProgramId extends string = string, + TAccountVaultProgram extends string = string, + TAccountRestakingProgram extends string = string, TAccountSystemProgram extends string = string, > = { ncnConfig: Address; @@ -190,7 +195,8 @@ export type InitializeVaultOperatorDelegationSnapshotInput< operatorSnapshot: Address; vaultOperatorDelegationSnapshot: Address; payer: TransactionSigner; - restakingProgramId: Address; + vaultProgram: Address; + restakingProgram: Address; systemProgram?: Address; firstSlotOfNcnEpoch: InitializeVaultOperatorDelegationSnapshotInstructionDataArgs['firstSlotOfNcnEpoch']; }; @@ -209,7 +215,8 @@ export function getInitializeVaultOperatorDelegationSnapshotInstruction< TAccountOperatorSnapshot extends string, TAccountVaultOperatorDelegationSnapshot extends string, TAccountPayer extends string, - TAccountRestakingProgramId extends string, + TAccountVaultProgram extends string, + TAccountRestakingProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof JITO_TIP_ROUTER_PROGRAM_ADDRESS, >( @@ -227,7 +234,8 @@ export function getInitializeVaultOperatorDelegationSnapshotInstruction< TAccountOperatorSnapshot, TAccountVaultOperatorDelegationSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountVaultProgram, + TAccountRestakingProgram, TAccountSystemProgram >, config?: { programAddress?: TProgramAddress } @@ -246,7 +254,8 @@ export function getInitializeVaultOperatorDelegationSnapshotInstruction< TAccountOperatorSnapshot, TAccountVaultOperatorDelegationSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountVaultProgram, + TAccountRestakingProgram, TAccountSystemProgram > { // Program address. @@ -280,8 +289,9 @@ export function getInitializeVaultOperatorDelegationSnapshotInstruction< isWritable: true, }, payer: { value: input.payer ?? null, isWritable: true }, - restakingProgramId: { - value: input.restakingProgramId ?? null, + vaultProgram: { value: input.vaultProgram ?? null, isWritable: false }, + restakingProgram: { + value: input.restakingProgram ?? null, isWritable: false, }, systemProgram: { value: input.systemProgram ?? null, isWritable: false }, @@ -316,7 +326,8 @@ export function getInitializeVaultOperatorDelegationSnapshotInstruction< getAccountMeta(accounts.operatorSnapshot), getAccountMeta(accounts.vaultOperatorDelegationSnapshot), getAccountMeta(accounts.payer), - getAccountMeta(accounts.restakingProgramId), + getAccountMeta(accounts.vaultProgram), + getAccountMeta(accounts.restakingProgram), getAccountMeta(accounts.systemProgram), ], programAddress, @@ -338,7 +349,8 @@ export function getInitializeVaultOperatorDelegationSnapshotInstruction< TAccountOperatorSnapshot, TAccountVaultOperatorDelegationSnapshot, TAccountPayer, - TAccountRestakingProgramId, + TAccountVaultProgram, + TAccountRestakingProgram, TAccountSystemProgram >; @@ -364,8 +376,9 @@ export type ParsedInitializeVaultOperatorDelegationSnapshotInstruction< operatorSnapshot: TAccountMetas[10]; vaultOperatorDelegationSnapshot: TAccountMetas[11]; payer: TAccountMetas[12]; - restakingProgramId: TAccountMetas[13]; - systemProgram: TAccountMetas[14]; + vaultProgram: TAccountMetas[13]; + restakingProgram: TAccountMetas[14]; + systemProgram: TAccountMetas[15]; }; data: InitializeVaultOperatorDelegationSnapshotInstructionData; }; @@ -381,7 +394,7 @@ export function parseInitializeVaultOperatorDelegationSnapshotInstruction< TProgram, TAccountMetas > { - if (instruction.accounts.length < 15) { + if (instruction.accounts.length < 16) { // TODO: Coded error. throw new Error('Not enough accounts'); } @@ -407,7 +420,8 @@ export function parseInitializeVaultOperatorDelegationSnapshotInstruction< operatorSnapshot: getNextAccount(), vaultOperatorDelegationSnapshot: getNextAccount(), payer: getNextAccount(), - restakingProgramId: getNextAccount(), + vaultProgram: getNextAccount(), + restakingProgram: getNextAccount(), systemProgram: getNextAccount(), }, data: getInitializeVaultOperatorDelegationSnapshotInstructionDataDecoder().decode( diff --git a/clients/js/jito_tip_router/instructions/initializeWeightTable.ts b/clients/js/jito_tip_router/instructions/initializeWeightTable.ts index fb1b904..d6719a1 100644 --- a/clients/js/jito_tip_router/instructions/initializeWeightTable.ts +++ b/clients/js/jito_tip_router/instructions/initializeWeightTable.ts @@ -49,7 +49,7 @@ export type InitializeWeightTableInstruction< TAccountNcn extends string | IAccountMeta = string, TAccountWeightTable extends string | IAccountMeta = string, TAccountPayer extends string | IAccountMeta = string, - TAccountRestakingProgramId extends string | IAccountMeta = string, + TAccountRestakingProgram extends string | IAccountMeta = string, TAccountSystemProgram extends | string | IAccountMeta = '11111111111111111111111111111111', @@ -72,9 +72,9 @@ export type InitializeWeightTableInstruction< ? WritableSignerAccount & IAccountSignerMeta : TAccountPayer, - TAccountRestakingProgramId extends string - ? ReadonlyAccount - : TAccountRestakingProgramId, + TAccountRestakingProgram extends string + ? ReadonlyAccount + : TAccountRestakingProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, @@ -127,7 +127,7 @@ export type InitializeWeightTableInput< TAccountNcn extends string = string, TAccountWeightTable extends string = string, TAccountPayer extends string = string, - TAccountRestakingProgramId extends string = string, + TAccountRestakingProgram extends string = string, TAccountSystemProgram extends string = string, > = { restakingConfig: Address; @@ -135,7 +135,7 @@ export type InitializeWeightTableInput< ncn: Address; weightTable: Address; payer: TransactionSigner; - restakingProgramId: Address; + restakingProgram: Address; systemProgram?: Address; firstSlotOfNcnEpoch: InitializeWeightTableInstructionDataArgs['firstSlotOfNcnEpoch']; }; @@ -146,7 +146,7 @@ export function getInitializeWeightTableInstruction< TAccountNcn extends string, TAccountWeightTable extends string, TAccountPayer extends string, - TAccountRestakingProgramId extends string, + TAccountRestakingProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof JITO_TIP_ROUTER_PROGRAM_ADDRESS, >( @@ -156,7 +156,7 @@ export function getInitializeWeightTableInstruction< TAccountNcn, TAccountWeightTable, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram >, config?: { programAddress?: TProgramAddress } @@ -167,7 +167,7 @@ export function getInitializeWeightTableInstruction< TAccountNcn, TAccountWeightTable, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram > { // Program address. @@ -184,8 +184,8 @@ export function getInitializeWeightTableInstruction< ncn: { value: input.ncn ?? null, isWritable: false }, weightTable: { value: input.weightTable ?? null, isWritable: true }, payer: { value: input.payer ?? null, isWritable: true }, - restakingProgramId: { - value: input.restakingProgramId ?? null, + restakingProgram: { + value: input.restakingProgram ?? null, isWritable: false, }, systemProgram: { value: input.systemProgram ?? null, isWritable: false }, @@ -212,7 +212,7 @@ export function getInitializeWeightTableInstruction< getAccountMeta(accounts.ncn), getAccountMeta(accounts.weightTable), getAccountMeta(accounts.payer), - getAccountMeta(accounts.restakingProgramId), + getAccountMeta(accounts.restakingProgram), getAccountMeta(accounts.systemProgram), ], programAddress, @@ -226,7 +226,7 @@ export function getInitializeWeightTableInstruction< TAccountNcn, TAccountWeightTable, TAccountPayer, - TAccountRestakingProgramId, + TAccountRestakingProgram, TAccountSystemProgram >; @@ -244,7 +244,7 @@ export type ParsedInitializeWeightTableInstruction< ncn: TAccountMetas[2]; weightTable: TAccountMetas[3]; payer: TAccountMetas[4]; - restakingProgramId: TAccountMetas[5]; + restakingProgram: TAccountMetas[5]; systemProgram: TAccountMetas[6]; }; data: InitializeWeightTableInstructionData; @@ -276,7 +276,7 @@ export function parseInitializeWeightTableInstruction< ncn: getNextAccount(), weightTable: getNextAccount(), payer: getNextAccount(), - restakingProgramId: getNextAccount(), + restakingProgram: getNextAccount(), systemProgram: getNextAccount(), }, data: getInitializeWeightTableInstructionDataDecoder().decode( diff --git a/clients/js/jito_tip_router/instructions/setConfigFees.ts b/clients/js/jito_tip_router/instructions/setConfigFees.ts index b6274cd..d5b0dc4 100644 --- a/clients/js/jito_tip_router/instructions/setConfigFees.ts +++ b/clients/js/jito_tip_router/instructions/setConfigFees.ts @@ -50,7 +50,7 @@ export type SetConfigFeesInstruction< TAccountConfig extends string | IAccountMeta = string, TAccountNcn extends string | IAccountMeta = string, TAccountNcnAdmin extends string | IAccountMeta = string, - TAccountRestakingProgramId extends string | IAccountMeta = string, + TAccountRestakingProgram extends string | IAccountMeta = string, TRemainingAccounts extends readonly IAccountMeta[] = [], > = IInstruction & IInstructionWithData & @@ -67,9 +67,9 @@ export type SetConfigFeesInstruction< ? ReadonlySignerAccount & IAccountSignerMeta : TAccountNcnAdmin, - TAccountRestakingProgramId extends string - ? ReadonlyAccount - : TAccountRestakingProgramId, + TAccountRestakingProgram extends string + ? ReadonlyAccount + : TAccountRestakingProgram, ...TRemainingAccounts, ] >; @@ -127,13 +127,13 @@ export type SetConfigFeesInput< TAccountConfig extends string = string, TAccountNcn extends string = string, TAccountNcnAdmin extends string = string, - TAccountRestakingProgramId extends string = string, + TAccountRestakingProgram extends string = string, > = { restakingConfig: Address; config: Address; ncn: Address; ncnAdmin: TransactionSigner; - restakingProgramId: Address; + restakingProgram: Address; newDaoFeeBps: SetConfigFeesInstructionDataArgs['newDaoFeeBps']; newNcnFeeBps: SetConfigFeesInstructionDataArgs['newNcnFeeBps']; newBlockEngineFeeBps: SetConfigFeesInstructionDataArgs['newBlockEngineFeeBps']; @@ -145,7 +145,7 @@ export function getSetConfigFeesInstruction< TAccountConfig extends string, TAccountNcn extends string, TAccountNcnAdmin extends string, - TAccountRestakingProgramId extends string, + TAccountRestakingProgram extends string, TProgramAddress extends Address = typeof JITO_TIP_ROUTER_PROGRAM_ADDRESS, >( input: SetConfigFeesInput< @@ -153,7 +153,7 @@ export function getSetConfigFeesInstruction< TAccountConfig, TAccountNcn, TAccountNcnAdmin, - TAccountRestakingProgramId + TAccountRestakingProgram >, config?: { programAddress?: TProgramAddress } ): SetConfigFeesInstruction< @@ -162,7 +162,7 @@ export function getSetConfigFeesInstruction< TAccountConfig, TAccountNcn, TAccountNcnAdmin, - TAccountRestakingProgramId + TAccountRestakingProgram > { // Program address. const programAddress = @@ -177,8 +177,8 @@ export function getSetConfigFeesInstruction< config: { value: input.config ?? null, isWritable: true }, ncn: { value: input.ncn ?? null, isWritable: false }, ncnAdmin: { value: input.ncnAdmin ?? null, isWritable: false }, - restakingProgramId: { - value: input.restakingProgramId ?? null, + restakingProgram: { + value: input.restakingProgram ?? null, isWritable: false, }, }; @@ -197,7 +197,7 @@ export function getSetConfigFeesInstruction< getAccountMeta(accounts.config), getAccountMeta(accounts.ncn), getAccountMeta(accounts.ncnAdmin), - getAccountMeta(accounts.restakingProgramId), + getAccountMeta(accounts.restakingProgram), ], programAddress, data: getSetConfigFeesInstructionDataEncoder().encode( @@ -209,7 +209,7 @@ export function getSetConfigFeesInstruction< TAccountConfig, TAccountNcn, TAccountNcnAdmin, - TAccountRestakingProgramId + TAccountRestakingProgram >; return instruction; @@ -225,7 +225,7 @@ export type ParsedSetConfigFeesInstruction< config: TAccountMetas[1]; ncn: TAccountMetas[2]; ncnAdmin: TAccountMetas[3]; - restakingProgramId: TAccountMetas[4]; + restakingProgram: TAccountMetas[4]; }; data: SetConfigFeesInstructionData; }; @@ -255,7 +255,7 @@ export function parseSetConfigFeesInstruction< config: getNextAccount(), ncn: getNextAccount(), ncnAdmin: getNextAccount(), - restakingProgramId: getNextAccount(), + restakingProgram: getNextAccount(), }, data: getSetConfigFeesInstructionDataDecoder().decode(instruction.data), }; diff --git a/clients/js/jito_tip_router/instructions/setNewAdmin.ts b/clients/js/jito_tip_router/instructions/setNewAdmin.ts index eb14e6c..74c02c5 100644 --- a/clients/js/jito_tip_router/instructions/setNewAdmin.ts +++ b/clients/js/jito_tip_router/instructions/setNewAdmin.ts @@ -48,7 +48,7 @@ export type SetNewAdminInstruction< TAccountNcn extends string | IAccountMeta = string, TAccountNcnAdmin extends string | IAccountMeta = string, TAccountNewAdmin extends string | IAccountMeta = string, - TAccountRestakingProgramId extends string | IAccountMeta = string, + TAccountRestakingProgram extends string | IAccountMeta = string, TRemainingAccounts extends readonly IAccountMeta[] = [], > = IInstruction & IInstructionWithData & @@ -65,9 +65,9 @@ export type SetNewAdminInstruction< TAccountNewAdmin extends string ? ReadonlyAccount : TAccountNewAdmin, - TAccountRestakingProgramId extends string - ? ReadonlyAccount - : TAccountRestakingProgramId, + TAccountRestakingProgram extends string + ? ReadonlyAccount + : TAccountRestakingProgram, ...TRemainingAccounts, ] >; @@ -111,13 +111,13 @@ export type SetNewAdminInput< TAccountNcn extends string = string, TAccountNcnAdmin extends string = string, TAccountNewAdmin extends string = string, - TAccountRestakingProgramId extends string = string, + TAccountRestakingProgram extends string = string, > = { config: Address; ncn: Address; ncnAdmin: TransactionSigner; newAdmin: Address; - restakingProgramId: Address; + restakingProgram: Address; role: SetNewAdminInstructionDataArgs['role']; }; @@ -126,7 +126,7 @@ export function getSetNewAdminInstruction< TAccountNcn extends string, TAccountNcnAdmin extends string, TAccountNewAdmin extends string, - TAccountRestakingProgramId extends string, + TAccountRestakingProgram extends string, TProgramAddress extends Address = typeof JITO_TIP_ROUTER_PROGRAM_ADDRESS, >( input: SetNewAdminInput< @@ -134,7 +134,7 @@ export function getSetNewAdminInstruction< TAccountNcn, TAccountNcnAdmin, TAccountNewAdmin, - TAccountRestakingProgramId + TAccountRestakingProgram >, config?: { programAddress?: TProgramAddress } ): SetNewAdminInstruction< @@ -143,7 +143,7 @@ export function getSetNewAdminInstruction< TAccountNcn, TAccountNcnAdmin, TAccountNewAdmin, - TAccountRestakingProgramId + TAccountRestakingProgram > { // Program address. const programAddress = @@ -155,8 +155,8 @@ export function getSetNewAdminInstruction< ncn: { value: input.ncn ?? null, isWritable: false }, ncnAdmin: { value: input.ncnAdmin ?? null, isWritable: false }, newAdmin: { value: input.newAdmin ?? null, isWritable: false }, - restakingProgramId: { - value: input.restakingProgramId ?? null, + restakingProgram: { + value: input.restakingProgram ?? null, isWritable: false, }, }; @@ -175,7 +175,7 @@ export function getSetNewAdminInstruction< getAccountMeta(accounts.ncn), getAccountMeta(accounts.ncnAdmin), getAccountMeta(accounts.newAdmin), - getAccountMeta(accounts.restakingProgramId), + getAccountMeta(accounts.restakingProgram), ], programAddress, data: getSetNewAdminInstructionDataEncoder().encode( @@ -187,7 +187,7 @@ export function getSetNewAdminInstruction< TAccountNcn, TAccountNcnAdmin, TAccountNewAdmin, - TAccountRestakingProgramId + TAccountRestakingProgram >; return instruction; @@ -203,7 +203,7 @@ export type ParsedSetNewAdminInstruction< ncn: TAccountMetas[1]; ncnAdmin: TAccountMetas[2]; newAdmin: TAccountMetas[3]; - restakingProgramId: TAccountMetas[4]; + restakingProgram: TAccountMetas[4]; }; data: SetNewAdminInstructionData; }; @@ -233,7 +233,7 @@ export function parseSetNewAdminInstruction< ncn: getNextAccount(), ncnAdmin: getNextAccount(), newAdmin: getNextAccount(), - restakingProgramId: getNextAccount(), + restakingProgram: getNextAccount(), }, data: getSetNewAdminInstructionDataDecoder().decode(instruction.data), }; diff --git a/clients/rust/jito_tip_router/src/generated/instructions/admin_update_weight_table.rs b/clients/rust/jito_tip_router/src/generated/instructions/admin_update_weight_table.rs index 0df738f..6de2772 100644 --- a/clients/rust/jito_tip_router/src/generated/instructions/admin_update_weight_table.rs +++ b/clients/rust/jito_tip_router/src/generated/instructions/admin_update_weight_table.rs @@ -16,7 +16,7 @@ pub struct AdminUpdateWeightTable { pub mint: solana_program::pubkey::Pubkey, - pub restaking_program_id: solana_program::pubkey::Pubkey, + pub restaking_program: solana_program::pubkey::Pubkey, } impl AdminUpdateWeightTable { @@ -48,7 +48,7 @@ impl AdminUpdateWeightTable { self.mint, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.restaking_program_id, + self.restaking_program, false, )); accounts.extend_from_slice(remaining_accounts); @@ -98,14 +98,14 @@ pub struct AdminUpdateWeightTableInstructionArgs { /// 1. `[writable]` weight_table /// 2. `[signer]` weight_table_admin /// 3. `[]` mint -/// 4. `[]` restaking_program_id +/// 4. `[]` restaking_program #[derive(Clone, Debug, Default)] pub struct AdminUpdateWeightTableBuilder { ncn: Option, weight_table: Option, weight_table_admin: Option, mint: Option, - restaking_program_id: Option, + restaking_program: Option, ncn_epoch: Option, weight: Option, __remaining_accounts: Vec, @@ -139,11 +139,11 @@ impl AdminUpdateWeightTableBuilder { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: solana_program::pubkey::Pubkey, + restaking_program: solana_program::pubkey::Pubkey, ) -> &mut Self { - self.restaking_program_id = Some(restaking_program_id); + self.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -183,9 +183,9 @@ impl AdminUpdateWeightTableBuilder { .weight_table_admin .expect("weight_table_admin is not set"), mint: self.mint.expect("mint is not set"), - restaking_program_id: self - .restaking_program_id - .expect("restaking_program_id is not set"), + restaking_program: self + .restaking_program + .expect("restaking_program is not set"), }; let args = AdminUpdateWeightTableInstructionArgs { ncn_epoch: self.ncn_epoch.clone().expect("ncn_epoch is not set"), @@ -206,7 +206,7 @@ pub struct AdminUpdateWeightTableCpiAccounts<'a, 'b> { pub mint: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, } /// `admin_update_weight_table` CPI instruction. @@ -222,7 +222,7 @@ pub struct AdminUpdateWeightTableCpi<'a, 'b> { pub mint: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, /// The arguments for the instruction. pub __args: AdminUpdateWeightTableInstructionArgs, } @@ -239,7 +239,7 @@ impl<'a, 'b> AdminUpdateWeightTableCpi<'a, 'b> { weight_table: accounts.weight_table, weight_table_admin: accounts.weight_table_admin, mint: accounts.mint, - restaking_program_id: accounts.restaking_program_id, + restaking_program: accounts.restaking_program, __args: args, } } @@ -294,7 +294,7 @@ impl<'a, 'b> AdminUpdateWeightTableCpi<'a, 'b> { false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.restaking_program_id.key, + *self.restaking_program.key, false, )); remaining_accounts.iter().for_each(|remaining_account| { @@ -321,7 +321,7 @@ impl<'a, 'b> AdminUpdateWeightTableCpi<'a, 'b> { account_infos.push(self.weight_table.clone()); account_infos.push(self.weight_table_admin.clone()); account_infos.push(self.mint.clone()); - account_infos.push(self.restaking_program_id.clone()); + account_infos.push(self.restaking_program.clone()); remaining_accounts .iter() .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); @@ -342,7 +342,7 @@ impl<'a, 'b> AdminUpdateWeightTableCpi<'a, 'b> { /// 1. `[writable]` weight_table /// 2. `[signer]` weight_table_admin /// 3. `[]` mint -/// 4. `[]` restaking_program_id +/// 4. `[]` restaking_program #[derive(Clone, Debug)] pub struct AdminUpdateWeightTableCpiBuilder<'a, 'b> { instruction: Box>, @@ -356,7 +356,7 @@ impl<'a, 'b> AdminUpdateWeightTableCpiBuilder<'a, 'b> { weight_table: None, weight_table_admin: None, mint: None, - restaking_program_id: None, + restaking_program: None, ncn_epoch: None, weight: None, __remaining_accounts: Vec::new(), @@ -390,11 +390,11 @@ impl<'a, 'b> AdminUpdateWeightTableCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + restaking_program: &'b solana_program::account_info::AccountInfo<'a>, ) -> &mut Self { - self.instruction.restaking_program_id = Some(restaking_program_id); + self.instruction.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -473,10 +473,10 @@ impl<'a, 'b> AdminUpdateWeightTableCpiBuilder<'a, 'b> { mint: self.instruction.mint.expect("mint is not set"), - restaking_program_id: self + restaking_program: self .instruction - .restaking_program_id - .expect("restaking_program_id is not set"), + .restaking_program + .expect("restaking_program is not set"), __args: args, }; instruction.invoke_signed_with_remaining_accounts( @@ -493,7 +493,7 @@ struct AdminUpdateWeightTableCpiBuilderInstruction<'a, 'b> { weight_table: Option<&'b solana_program::account_info::AccountInfo<'a>>, weight_table_admin: Option<&'b solana_program::account_info::AccountInfo<'a>>, mint: Option<&'b solana_program::account_info::AccountInfo<'a>>, - restaking_program_id: Option<&'b solana_program::account_info::AccountInfo<'a>>, + restaking_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, ncn_epoch: Option, weight: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. diff --git a/clients/rust/jito_tip_router/src/generated/instructions/initialize_epoch_snapshot.rs b/clients/rust/jito_tip_router/src/generated/instructions/initialize_epoch_snapshot.rs index 520d8b9..d19e7ae 100644 --- a/clients/rust/jito_tip_router/src/generated/instructions/initialize_epoch_snapshot.rs +++ b/clients/rust/jito_tip_router/src/generated/instructions/initialize_epoch_snapshot.rs @@ -20,7 +20,7 @@ pub struct InitializeEpochSnapshot { pub payer: solana_program::pubkey::Pubkey, - pub restaking_program_id: solana_program::pubkey::Pubkey, + pub restaking_program: solana_program::pubkey::Pubkey, pub system_program: solana_program::pubkey::Pubkey, } @@ -62,7 +62,7 @@ impl InitializeEpochSnapshot { self.payer, true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.restaking_program_id, + self.restaking_program, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -117,7 +117,7 @@ pub struct InitializeEpochSnapshotInstructionArgs { /// 3. `[]` weight_table /// 4. `[writable]` epoch_snapshot /// 5. `[writable, signer]` payer -/// 6. `[]` restaking_program_id +/// 6. `[]` restaking_program /// 7. `[optional]` system_program (default to `11111111111111111111111111111111`) #[derive(Clone, Debug, Default)] pub struct InitializeEpochSnapshotBuilder { @@ -127,7 +127,7 @@ pub struct InitializeEpochSnapshotBuilder { weight_table: Option, epoch_snapshot: Option, payer: Option, - restaking_program_id: Option, + restaking_program: Option, system_program: Option, first_slot_of_ncn_epoch: Option, __remaining_accounts: Vec, @@ -171,11 +171,11 @@ impl InitializeEpochSnapshotBuilder { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: solana_program::pubkey::Pubkey, + restaking_program: solana_program::pubkey::Pubkey, ) -> &mut Self { - self.restaking_program_id = Some(restaking_program_id); + self.restaking_program = Some(restaking_program); self } /// `[optional account, default to '11111111111111111111111111111111']` @@ -217,9 +217,9 @@ impl InitializeEpochSnapshotBuilder { weight_table: self.weight_table.expect("weight_table is not set"), epoch_snapshot: self.epoch_snapshot.expect("epoch_snapshot is not set"), payer: self.payer.expect("payer is not set"), - restaking_program_id: self - .restaking_program_id - .expect("restaking_program_id is not set"), + restaking_program: self + .restaking_program + .expect("restaking_program is not set"), system_program: self .system_program .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), @@ -246,7 +246,7 @@ pub struct InitializeEpochSnapshotCpiAccounts<'a, 'b> { pub payer: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, } @@ -268,7 +268,7 @@ pub struct InitializeEpochSnapshotCpi<'a, 'b> { pub payer: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, /// The arguments for the instruction. @@ -289,7 +289,7 @@ impl<'a, 'b> InitializeEpochSnapshotCpi<'a, 'b> { weight_table: accounts.weight_table, epoch_snapshot: accounts.epoch_snapshot, payer: accounts.payer, - restaking_program_id: accounts.restaking_program_id, + restaking_program: accounts.restaking_program, system_program: accounts.system_program, __args: args, } @@ -353,7 +353,7 @@ impl<'a, 'b> InitializeEpochSnapshotCpi<'a, 'b> { true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.restaking_program_id.key, + *self.restaking_program.key, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -386,7 +386,7 @@ impl<'a, 'b> InitializeEpochSnapshotCpi<'a, 'b> { account_infos.push(self.weight_table.clone()); account_infos.push(self.epoch_snapshot.clone()); account_infos.push(self.payer.clone()); - account_infos.push(self.restaking_program_id.clone()); + account_infos.push(self.restaking_program.clone()); account_infos.push(self.system_program.clone()); remaining_accounts .iter() @@ -410,7 +410,7 @@ impl<'a, 'b> InitializeEpochSnapshotCpi<'a, 'b> { /// 3. `[]` weight_table /// 4. `[writable]` epoch_snapshot /// 5. `[writable, signer]` payer -/// 6. `[]` restaking_program_id +/// 6. `[]` restaking_program /// 7. `[]` system_program #[derive(Clone, Debug)] pub struct InitializeEpochSnapshotCpiBuilder<'a, 'b> { @@ -427,7 +427,7 @@ impl<'a, 'b> InitializeEpochSnapshotCpiBuilder<'a, 'b> { weight_table: None, epoch_snapshot: None, payer: None, - restaking_program_id: None, + restaking_program: None, system_program: None, first_slot_of_ncn_epoch: None, __remaining_accounts: Vec::new(), @@ -477,11 +477,11 @@ impl<'a, 'b> InitializeEpochSnapshotCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + restaking_program: &'b solana_program::account_info::AccountInfo<'a>, ) -> &mut Self { - self.instruction.restaking_program_id = Some(restaking_program_id); + self.instruction.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -566,10 +566,10 @@ impl<'a, 'b> InitializeEpochSnapshotCpiBuilder<'a, 'b> { payer: self.instruction.payer.expect("payer is not set"), - restaking_program_id: self + restaking_program: self .instruction - .restaking_program_id - .expect("restaking_program_id is not set"), + .restaking_program + .expect("restaking_program is not set"), system_program: self .instruction @@ -593,7 +593,7 @@ struct InitializeEpochSnapshotCpiBuilderInstruction<'a, 'b> { weight_table: Option<&'b solana_program::account_info::AccountInfo<'a>>, epoch_snapshot: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, - restaking_program_id: Option<&'b solana_program::account_info::AccountInfo<'a>>, + restaking_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, first_slot_of_ncn_epoch: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. diff --git a/clients/rust/jito_tip_router/src/generated/instructions/initialize_n_c_n_config.rs b/clients/rust/jito_tip_router/src/generated/instructions/initialize_n_c_n_config.rs index 1806829..6c83fd6 100644 --- a/clients/rust/jito_tip_router/src/generated/instructions/initialize_n_c_n_config.rs +++ b/clients/rust/jito_tip_router/src/generated/instructions/initialize_n_c_n_config.rs @@ -20,7 +20,7 @@ pub struct InitializeNCNConfig { pub tie_breaker_admin: solana_program::pubkey::Pubkey, - pub restaking_program_id: solana_program::pubkey::Pubkey, + pub restaking_program: solana_program::pubkey::Pubkey, pub system_program: solana_program::pubkey::Pubkey, } @@ -63,7 +63,7 @@ impl InitializeNCNConfig { false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.restaking_program_id, + self.restaking_program, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -120,7 +120,7 @@ pub struct InitializeNCNConfigInstructionArgs { /// 3. `[signer]` ncn_admin /// 4. `[]` fee_wallet /// 5. `[]` tie_breaker_admin -/// 6. `[]` restaking_program_id +/// 6. `[]` restaking_program /// 7. `[optional]` system_program (default to `11111111111111111111111111111111`) #[derive(Clone, Debug, Default)] pub struct InitializeNCNConfigBuilder { @@ -130,7 +130,7 @@ pub struct InitializeNCNConfigBuilder { ncn_admin: Option, fee_wallet: Option, tie_breaker_admin: Option, - restaking_program_id: Option, + restaking_program: Option, system_program: Option, dao_fee_bps: Option, ncn_fee_bps: Option, @@ -179,11 +179,11 @@ impl InitializeNCNConfigBuilder { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: solana_program::pubkey::Pubkey, + restaking_program: solana_program::pubkey::Pubkey, ) -> &mut Self { - self.restaking_program_id = Some(restaking_program_id); + self.restaking_program = Some(restaking_program); self } /// `[optional account, default to '11111111111111111111111111111111']` @@ -236,9 +236,9 @@ impl InitializeNCNConfigBuilder { tie_breaker_admin: self .tie_breaker_admin .expect("tie_breaker_admin is not set"), - restaking_program_id: self - .restaking_program_id - .expect("restaking_program_id is not set"), + restaking_program: self + .restaking_program + .expect("restaking_program is not set"), system_program: self .system_program .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), @@ -270,7 +270,7 @@ pub struct InitializeNCNConfigCpiAccounts<'a, 'b> { pub tie_breaker_admin: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, } @@ -292,7 +292,7 @@ pub struct InitializeNCNConfigCpi<'a, 'b> { pub tie_breaker_admin: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, /// The arguments for the instruction. @@ -313,7 +313,7 @@ impl<'a, 'b> InitializeNCNConfigCpi<'a, 'b> { ncn_admin: accounts.ncn_admin, fee_wallet: accounts.fee_wallet, tie_breaker_admin: accounts.tie_breaker_admin, - restaking_program_id: accounts.restaking_program_id, + restaking_program: accounts.restaking_program, system_program: accounts.system_program, __args: args, } @@ -377,7 +377,7 @@ impl<'a, 'b> InitializeNCNConfigCpi<'a, 'b> { false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.restaking_program_id.key, + *self.restaking_program.key, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -410,7 +410,7 @@ impl<'a, 'b> InitializeNCNConfigCpi<'a, 'b> { account_infos.push(self.ncn_admin.clone()); account_infos.push(self.fee_wallet.clone()); account_infos.push(self.tie_breaker_admin.clone()); - account_infos.push(self.restaking_program_id.clone()); + account_infos.push(self.restaking_program.clone()); account_infos.push(self.system_program.clone()); remaining_accounts .iter() @@ -434,7 +434,7 @@ impl<'a, 'b> InitializeNCNConfigCpi<'a, 'b> { /// 3. `[signer]` ncn_admin /// 4. `[]` fee_wallet /// 5. `[]` tie_breaker_admin -/// 6. `[]` restaking_program_id +/// 6. `[]` restaking_program /// 7. `[]` system_program #[derive(Clone, Debug)] pub struct InitializeNCNConfigCpiBuilder<'a, 'b> { @@ -451,7 +451,7 @@ impl<'a, 'b> InitializeNCNConfigCpiBuilder<'a, 'b> { ncn_admin: None, fee_wallet: None, tie_breaker_admin: None, - restaking_program_id: None, + restaking_program: None, system_program: None, dao_fee_bps: None, ncn_fee_bps: None, @@ -506,11 +506,11 @@ impl<'a, 'b> InitializeNCNConfigCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + restaking_program: &'b solana_program::account_info::AccountInfo<'a>, ) -> &mut Self { - self.instruction.restaking_program_id = Some(restaking_program_id); + self.instruction.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -615,10 +615,10 @@ impl<'a, 'b> InitializeNCNConfigCpiBuilder<'a, 'b> { .tie_breaker_admin .expect("tie_breaker_admin is not set"), - restaking_program_id: self + restaking_program: self .instruction - .restaking_program_id - .expect("restaking_program_id is not set"), + .restaking_program + .expect("restaking_program is not set"), system_program: self .instruction @@ -642,7 +642,7 @@ struct InitializeNCNConfigCpiBuilderInstruction<'a, 'b> { ncn_admin: Option<&'b solana_program::account_info::AccountInfo<'a>>, fee_wallet: Option<&'b solana_program::account_info::AccountInfo<'a>>, tie_breaker_admin: Option<&'b solana_program::account_info::AccountInfo<'a>>, - restaking_program_id: Option<&'b solana_program::account_info::AccountInfo<'a>>, + restaking_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, dao_fee_bps: Option, ncn_fee_bps: Option, diff --git a/clients/rust/jito_tip_router/src/generated/instructions/initialize_operator_snapshot.rs b/clients/rust/jito_tip_router/src/generated/instructions/initialize_operator_snapshot.rs index c367681..f28c3f0 100644 --- a/clients/rust/jito_tip_router/src/generated/instructions/initialize_operator_snapshot.rs +++ b/clients/rust/jito_tip_router/src/generated/instructions/initialize_operator_snapshot.rs @@ -24,7 +24,7 @@ pub struct InitializeOperatorSnapshot { pub payer: solana_program::pubkey::Pubkey, - pub restaking_program_id: solana_program::pubkey::Pubkey, + pub restaking_program: solana_program::pubkey::Pubkey, pub system_program: solana_program::pubkey::Pubkey, } @@ -74,7 +74,7 @@ impl InitializeOperatorSnapshot { self.payer, true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.restaking_program_id, + self.restaking_program, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -131,7 +131,7 @@ pub struct InitializeOperatorSnapshotInstructionArgs { /// 5. `[writable]` epoch_snapshot /// 6. `[writable]` operator_snapshot /// 7. `[writable, signer]` payer -/// 8. `[]` restaking_program_id +/// 8. `[]` restaking_program /// 9. `[optional]` system_program (default to `11111111111111111111111111111111`) #[derive(Clone, Debug, Default)] pub struct InitializeOperatorSnapshotBuilder { @@ -143,7 +143,7 @@ pub struct InitializeOperatorSnapshotBuilder { epoch_snapshot: Option, operator_snapshot: Option, payer: Option, - restaking_program_id: Option, + restaking_program: Option, system_program: Option, first_slot_of_ncn_epoch: Option, __remaining_accounts: Vec, @@ -203,11 +203,11 @@ impl InitializeOperatorSnapshotBuilder { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: solana_program::pubkey::Pubkey, + restaking_program: solana_program::pubkey::Pubkey, ) -> &mut Self { - self.restaking_program_id = Some(restaking_program_id); + self.restaking_program = Some(restaking_program); self } /// `[optional account, default to '11111111111111111111111111111111']` @@ -255,9 +255,9 @@ impl InitializeOperatorSnapshotBuilder { .operator_snapshot .expect("operator_snapshot is not set"), payer: self.payer.expect("payer is not set"), - restaking_program_id: self - .restaking_program_id - .expect("restaking_program_id is not set"), + restaking_program: self + .restaking_program + .expect("restaking_program is not set"), system_program: self .system_program .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), @@ -288,7 +288,7 @@ pub struct InitializeOperatorSnapshotCpiAccounts<'a, 'b> { pub payer: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, } @@ -314,7 +314,7 @@ pub struct InitializeOperatorSnapshotCpi<'a, 'b> { pub payer: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, /// The arguments for the instruction. @@ -337,7 +337,7 @@ impl<'a, 'b> InitializeOperatorSnapshotCpi<'a, 'b> { epoch_snapshot: accounts.epoch_snapshot, operator_snapshot: accounts.operator_snapshot, payer: accounts.payer, - restaking_program_id: accounts.restaking_program_id, + restaking_program: accounts.restaking_program, system_program: accounts.system_program, __args: args, } @@ -409,7 +409,7 @@ impl<'a, 'b> InitializeOperatorSnapshotCpi<'a, 'b> { true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.restaking_program_id.key, + *self.restaking_program.key, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -444,7 +444,7 @@ impl<'a, 'b> InitializeOperatorSnapshotCpi<'a, 'b> { account_infos.push(self.epoch_snapshot.clone()); account_infos.push(self.operator_snapshot.clone()); account_infos.push(self.payer.clone()); - account_infos.push(self.restaking_program_id.clone()); + account_infos.push(self.restaking_program.clone()); account_infos.push(self.system_program.clone()); remaining_accounts .iter() @@ -470,7 +470,7 @@ impl<'a, 'b> InitializeOperatorSnapshotCpi<'a, 'b> { /// 5. `[writable]` epoch_snapshot /// 6. `[writable]` operator_snapshot /// 7. `[writable, signer]` payer -/// 8. `[]` restaking_program_id +/// 8. `[]` restaking_program /// 9. `[]` system_program #[derive(Clone, Debug)] pub struct InitializeOperatorSnapshotCpiBuilder<'a, 'b> { @@ -489,7 +489,7 @@ impl<'a, 'b> InitializeOperatorSnapshotCpiBuilder<'a, 'b> { epoch_snapshot: None, operator_snapshot: None, payer: None, - restaking_program_id: None, + restaking_program: None, system_program: None, first_slot_of_ncn_epoch: None, __remaining_accounts: Vec::new(), @@ -555,11 +555,11 @@ impl<'a, 'b> InitializeOperatorSnapshotCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + restaking_program: &'b solana_program::account_info::AccountInfo<'a>, ) -> &mut Self { - self.instruction.restaking_program_id = Some(restaking_program_id); + self.instruction.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -651,10 +651,10 @@ impl<'a, 'b> InitializeOperatorSnapshotCpiBuilder<'a, 'b> { payer: self.instruction.payer.expect("payer is not set"), - restaking_program_id: self + restaking_program: self .instruction - .restaking_program_id - .expect("restaking_program_id is not set"), + .restaking_program + .expect("restaking_program is not set"), system_program: self .instruction @@ -680,7 +680,7 @@ struct InitializeOperatorSnapshotCpiBuilderInstruction<'a, 'b> { epoch_snapshot: Option<&'b solana_program::account_info::AccountInfo<'a>>, operator_snapshot: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, - restaking_program_id: Option<&'b solana_program::account_info::AccountInfo<'a>>, + restaking_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, first_slot_of_ncn_epoch: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. diff --git a/clients/rust/jito_tip_router/src/generated/instructions/initialize_vault_operator_delegation_snapshot.rs b/clients/rust/jito_tip_router/src/generated/instructions/initialize_vault_operator_delegation_snapshot.rs index 2652400..840bc41 100644 --- a/clients/rust/jito_tip_router/src/generated/instructions/initialize_vault_operator_delegation_snapshot.rs +++ b/clients/rust/jito_tip_router/src/generated/instructions/initialize_vault_operator_delegation_snapshot.rs @@ -34,7 +34,9 @@ pub struct InitializeVaultOperatorDelegationSnapshot { pub payer: solana_program::pubkey::Pubkey, - pub restaking_program_id: solana_program::pubkey::Pubkey, + pub vault_program: solana_program::pubkey::Pubkey, + + pub restaking_program: solana_program::pubkey::Pubkey, pub system_program: solana_program::pubkey::Pubkey, } @@ -52,7 +54,7 @@ impl InitializeVaultOperatorDelegationSnapshot { args: InitializeVaultOperatorDelegationSnapshotInstructionArgs, remaining_accounts: &[solana_program::instruction::AccountMeta], ) -> solana_program::instruction::Instruction { - let mut accounts = Vec::with_capacity(15 + remaining_accounts.len()); + let mut accounts = Vec::with_capacity(16 + remaining_accounts.len()); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.ncn_config, false, @@ -103,7 +105,11 @@ impl InitializeVaultOperatorDelegationSnapshot { self.payer, true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.restaking_program_id, + self.vault_program, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + self.restaking_program, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -165,8 +171,9 @@ pub struct InitializeVaultOperatorDelegationSnapshotInstructionArgs { /// 10. `[writable]` operator_snapshot /// 11. `[writable]` vault_operator_delegation_snapshot /// 12. `[writable, signer]` payer -/// 13. `[]` restaking_program_id -/// 14. `[optional]` system_program (default to `11111111111111111111111111111111`) +/// 13. `[]` vault_program +/// 14. `[]` restaking_program +/// 15. `[optional]` system_program (default to `11111111111111111111111111111111`) #[derive(Clone, Debug, Default)] pub struct InitializeVaultOperatorDelegationSnapshotBuilder { ncn_config: Option, @@ -182,7 +189,8 @@ pub struct InitializeVaultOperatorDelegationSnapshotBuilder { operator_snapshot: Option, vault_operator_delegation_snapshot: Option, payer: Option, - restaking_program_id: Option, + vault_program: Option, + restaking_program: Option, system_program: Option, first_slot_of_ncn_epoch: Option, __remaining_accounts: Vec, @@ -276,11 +284,16 @@ impl InitializeVaultOperatorDelegationSnapshotBuilder { self } #[inline(always)] - pub fn restaking_program_id( + pub fn vault_program(&mut self, vault_program: solana_program::pubkey::Pubkey) -> &mut Self { + self.vault_program = Some(vault_program); + self + } + #[inline(always)] + pub fn restaking_program( &mut self, - restaking_program_id: solana_program::pubkey::Pubkey, + restaking_program: solana_program::pubkey::Pubkey, ) -> &mut Self { - self.restaking_program_id = Some(restaking_program_id); + self.restaking_program = Some(restaking_program); self } /// `[optional account, default to '11111111111111111111111111111111']` @@ -335,9 +348,10 @@ impl InitializeVaultOperatorDelegationSnapshotBuilder { .vault_operator_delegation_snapshot .expect("vault_operator_delegation_snapshot is not set"), payer: self.payer.expect("payer is not set"), - restaking_program_id: self - .restaking_program_id - .expect("restaking_program_id is not set"), + vault_program: self.vault_program.expect("vault_program is not set"), + restaking_program: self + .restaking_program + .expect("restaking_program is not set"), system_program: self .system_program .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), @@ -378,7 +392,9 @@ pub struct InitializeVaultOperatorDelegationSnapshotCpiAccounts<'a, 'b> { pub payer: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub vault_program: &'b solana_program::account_info::AccountInfo<'a>, + + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, } @@ -414,7 +430,9 @@ pub struct InitializeVaultOperatorDelegationSnapshotCpi<'a, 'b> { pub payer: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub vault_program: &'b solana_program::account_info::AccountInfo<'a>, + + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, /// The arguments for the instruction. @@ -442,7 +460,8 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpi<'a, 'b> { operator_snapshot: accounts.operator_snapshot, vault_operator_delegation_snapshot: accounts.vault_operator_delegation_snapshot, payer: accounts.payer, - restaking_program_id: accounts.restaking_program_id, + vault_program: accounts.vault_program, + restaking_program: accounts.restaking_program, system_program: accounts.system_program, __args: args, } @@ -480,7 +499,7 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpi<'a, 'b> { bool, )], ) -> solana_program::entrypoint::ProgramResult { - let mut accounts = Vec::with_capacity(15 + remaining_accounts.len()); + let mut accounts = Vec::with_capacity(16 + remaining_accounts.len()); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.ncn_config.key, false, @@ -534,7 +553,11 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpi<'a, 'b> { true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.restaking_program_id.key, + *self.vault_program.key, + false, + )); + accounts.push(solana_program::instruction::AccountMeta::new_readonly( + *self.restaking_program.key, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -559,7 +582,7 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpi<'a, 'b> { accounts, data, }; - let mut account_infos = Vec::with_capacity(15 + 1 + remaining_accounts.len()); + let mut account_infos = Vec::with_capacity(16 + 1 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.ncn_config.clone()); account_infos.push(self.restaking_config.clone()); @@ -574,7 +597,8 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpi<'a, 'b> { account_infos.push(self.operator_snapshot.clone()); account_infos.push(self.vault_operator_delegation_snapshot.clone()); account_infos.push(self.payer.clone()); - account_infos.push(self.restaking_program_id.clone()); + account_infos.push(self.vault_program.clone()); + account_infos.push(self.restaking_program.clone()); account_infos.push(self.system_program.clone()); remaining_accounts .iter() @@ -605,8 +629,9 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpi<'a, 'b> { /// 10. `[writable]` operator_snapshot /// 11. `[writable]` vault_operator_delegation_snapshot /// 12. `[writable, signer]` payer -/// 13. `[]` restaking_program_id -/// 14. `[]` system_program +/// 13. `[]` vault_program +/// 14. `[]` restaking_program +/// 15. `[]` system_program #[derive(Clone, Debug)] pub struct InitializeVaultOperatorDelegationSnapshotCpiBuilder<'a, 'b> { instruction: Box>, @@ -630,7 +655,8 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpiBuilder<'a, 'b> { operator_snapshot: None, vault_operator_delegation_snapshot: None, payer: None, - restaking_program_id: None, + vault_program: None, + restaking_program: None, system_program: None, first_slot_of_ncn_epoch: None, __remaining_accounts: Vec::new(), @@ -735,11 +761,19 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn restaking_program_id( + pub fn vault_program( &mut self, - restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + vault_program: &'b solana_program::account_info::AccountInfo<'a>, ) -> &mut Self { - self.instruction.restaking_program_id = Some(restaking_program_id); + self.instruction.vault_program = Some(vault_program); + self + } + #[inline(always)] + pub fn restaking_program( + &mut self, + restaking_program: &'b solana_program::account_info::AccountInfo<'a>, + ) -> &mut Self { + self.instruction.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -853,10 +887,15 @@ impl<'a, 'b> InitializeVaultOperatorDelegationSnapshotCpiBuilder<'a, 'b> { payer: self.instruction.payer.expect("payer is not set"), - restaking_program_id: self + vault_program: self + .instruction + .vault_program + .expect("vault_program is not set"), + + restaking_program: self .instruction - .restaking_program_id - .expect("restaking_program_id is not set"), + .restaking_program + .expect("restaking_program is not set"), system_program: self .instruction @@ -887,7 +926,8 @@ struct InitializeVaultOperatorDelegationSnapshotCpiBuilderInstruction<'a, 'b> { operator_snapshot: Option<&'b solana_program::account_info::AccountInfo<'a>>, vault_operator_delegation_snapshot: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, - restaking_program_id: Option<&'b solana_program::account_info::AccountInfo<'a>>, + vault_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, + restaking_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, first_slot_of_ncn_epoch: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. diff --git a/clients/rust/jito_tip_router/src/generated/instructions/initialize_weight_table.rs b/clients/rust/jito_tip_router/src/generated/instructions/initialize_weight_table.rs index 1c703fc..b8e20d3 100644 --- a/clients/rust/jito_tip_router/src/generated/instructions/initialize_weight_table.rs +++ b/clients/rust/jito_tip_router/src/generated/instructions/initialize_weight_table.rs @@ -18,7 +18,7 @@ pub struct InitializeWeightTable { pub payer: solana_program::pubkey::Pubkey, - pub restaking_program_id: solana_program::pubkey::Pubkey, + pub restaking_program: solana_program::pubkey::Pubkey, pub system_program: solana_program::pubkey::Pubkey, } @@ -56,7 +56,7 @@ impl InitializeWeightTable { self.payer, true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.restaking_program_id, + self.restaking_program, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -110,7 +110,7 @@ pub struct InitializeWeightTableInstructionArgs { /// 2. `[]` ncn /// 3. `[writable]` weight_table /// 4. `[writable, signer]` payer -/// 5. `[]` restaking_program_id +/// 5. `[]` restaking_program /// 6. `[optional]` system_program (default to `11111111111111111111111111111111`) #[derive(Clone, Debug, Default)] pub struct InitializeWeightTableBuilder { @@ -119,7 +119,7 @@ pub struct InitializeWeightTableBuilder { ncn: Option, weight_table: Option, payer: Option, - restaking_program_id: Option, + restaking_program: Option, system_program: Option, first_slot_of_ncn_epoch: Option, __remaining_accounts: Vec, @@ -158,11 +158,11 @@ impl InitializeWeightTableBuilder { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: solana_program::pubkey::Pubkey, + restaking_program: solana_program::pubkey::Pubkey, ) -> &mut Self { - self.restaking_program_id = Some(restaking_program_id); + self.restaking_program = Some(restaking_program); self } /// `[optional account, default to '11111111111111111111111111111111']` @@ -203,9 +203,9 @@ impl InitializeWeightTableBuilder { ncn: self.ncn.expect("ncn is not set"), weight_table: self.weight_table.expect("weight_table is not set"), payer: self.payer.expect("payer is not set"), - restaking_program_id: self - .restaking_program_id - .expect("restaking_program_id is not set"), + restaking_program: self + .restaking_program + .expect("restaking_program is not set"), system_program: self .system_program .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")), @@ -230,7 +230,7 @@ pub struct InitializeWeightTableCpiAccounts<'a, 'b> { pub payer: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, } @@ -250,7 +250,7 @@ pub struct InitializeWeightTableCpi<'a, 'b> { pub payer: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, pub system_program: &'b solana_program::account_info::AccountInfo<'a>, /// The arguments for the instruction. @@ -270,7 +270,7 @@ impl<'a, 'b> InitializeWeightTableCpi<'a, 'b> { ncn: accounts.ncn, weight_table: accounts.weight_table, payer: accounts.payer, - restaking_program_id: accounts.restaking_program_id, + restaking_program: accounts.restaking_program, system_program: accounts.system_program, __args: args, } @@ -330,7 +330,7 @@ impl<'a, 'b> InitializeWeightTableCpi<'a, 'b> { true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.restaking_program_id.key, + *self.restaking_program.key, false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( @@ -362,7 +362,7 @@ impl<'a, 'b> InitializeWeightTableCpi<'a, 'b> { account_infos.push(self.ncn.clone()); account_infos.push(self.weight_table.clone()); account_infos.push(self.payer.clone()); - account_infos.push(self.restaking_program_id.clone()); + account_infos.push(self.restaking_program.clone()); account_infos.push(self.system_program.clone()); remaining_accounts .iter() @@ -385,7 +385,7 @@ impl<'a, 'b> InitializeWeightTableCpi<'a, 'b> { /// 2. `[]` ncn /// 3. `[writable]` weight_table /// 4. `[writable, signer]` payer -/// 5. `[]` restaking_program_id +/// 5. `[]` restaking_program /// 6. `[]` system_program #[derive(Clone, Debug)] pub struct InitializeWeightTableCpiBuilder<'a, 'b> { @@ -401,7 +401,7 @@ impl<'a, 'b> InitializeWeightTableCpiBuilder<'a, 'b> { ncn: None, weight_table: None, payer: None, - restaking_program_id: None, + restaking_program: None, system_program: None, first_slot_of_ncn_epoch: None, __remaining_accounts: Vec::new(), @@ -443,11 +443,11 @@ impl<'a, 'b> InitializeWeightTableCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + restaking_program: &'b solana_program::account_info::AccountInfo<'a>, ) -> &mut Self { - self.instruction.restaking_program_id = Some(restaking_program_id); + self.instruction.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -527,10 +527,10 @@ impl<'a, 'b> InitializeWeightTableCpiBuilder<'a, 'b> { payer: self.instruction.payer.expect("payer is not set"), - restaking_program_id: self + restaking_program: self .instruction - .restaking_program_id - .expect("restaking_program_id is not set"), + .restaking_program + .expect("restaking_program is not set"), system_program: self .instruction @@ -553,7 +553,7 @@ struct InitializeWeightTableCpiBuilderInstruction<'a, 'b> { ncn: Option<&'b solana_program::account_info::AccountInfo<'a>>, weight_table: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, - restaking_program_id: Option<&'b solana_program::account_info::AccountInfo<'a>>, + restaking_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, first_slot_of_ncn_epoch: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. diff --git a/clients/rust/jito_tip_router/src/generated/instructions/set_config_fees.rs b/clients/rust/jito_tip_router/src/generated/instructions/set_config_fees.rs index 71a4cb2..877c04f 100644 --- a/clients/rust/jito_tip_router/src/generated/instructions/set_config_fees.rs +++ b/clients/rust/jito_tip_router/src/generated/instructions/set_config_fees.rs @@ -17,7 +17,7 @@ pub struct SetConfigFees { pub ncn_admin: solana_program::pubkey::Pubkey, - pub restaking_program_id: solana_program::pubkey::Pubkey, + pub restaking_program: solana_program::pubkey::Pubkey, } impl SetConfigFees { @@ -50,7 +50,7 @@ impl SetConfigFees { true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.restaking_program_id, + self.restaking_program, false, )); accounts.extend_from_slice(remaining_accounts); @@ -100,14 +100,14 @@ pub struct SetConfigFeesInstructionArgs { /// 1. `[writable]` config /// 2. `[]` ncn /// 3. `[signer]` ncn_admin -/// 4. `[]` restaking_program_id +/// 4. `[]` restaking_program #[derive(Clone, Debug, Default)] pub struct SetConfigFeesBuilder { restaking_config: Option, config: Option, ncn: Option, ncn_admin: Option, - restaking_program_id: Option, + restaking_program: Option, new_dao_fee_bps: Option, new_ncn_fee_bps: Option, new_block_engine_fee_bps: Option, @@ -143,11 +143,11 @@ impl SetConfigFeesBuilder { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: solana_program::pubkey::Pubkey, + restaking_program: solana_program::pubkey::Pubkey, ) -> &mut Self { - self.restaking_program_id = Some(restaking_program_id); + self.restaking_program = Some(restaking_program); self } /// `[optional argument]` @@ -199,9 +199,9 @@ impl SetConfigFeesBuilder { config: self.config.expect("config is not set"), ncn: self.ncn.expect("ncn is not set"), ncn_admin: self.ncn_admin.expect("ncn_admin is not set"), - restaking_program_id: self - .restaking_program_id - .expect("restaking_program_id is not set"), + restaking_program: self + .restaking_program + .expect("restaking_program is not set"), }; let args = SetConfigFeesInstructionArgs { new_dao_fee_bps: self.new_dao_fee_bps.clone(), @@ -224,7 +224,7 @@ pub struct SetConfigFeesCpiAccounts<'a, 'b> { pub ncn_admin: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, } /// `set_config_fees` CPI instruction. @@ -240,7 +240,7 @@ pub struct SetConfigFeesCpi<'a, 'b> { pub ncn_admin: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, /// The arguments for the instruction. pub __args: SetConfigFeesInstructionArgs, } @@ -257,7 +257,7 @@ impl<'a, 'b> SetConfigFeesCpi<'a, 'b> { config: accounts.config, ncn: accounts.ncn, ncn_admin: accounts.ncn_admin, - restaking_program_id: accounts.restaking_program_id, + restaking_program: accounts.restaking_program, __args: args, } } @@ -312,7 +312,7 @@ impl<'a, 'b> SetConfigFeesCpi<'a, 'b> { true, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.restaking_program_id.key, + *self.restaking_program.key, false, )); remaining_accounts.iter().for_each(|remaining_account| { @@ -337,7 +337,7 @@ impl<'a, 'b> SetConfigFeesCpi<'a, 'b> { account_infos.push(self.config.clone()); account_infos.push(self.ncn.clone()); account_infos.push(self.ncn_admin.clone()); - account_infos.push(self.restaking_program_id.clone()); + account_infos.push(self.restaking_program.clone()); remaining_accounts .iter() .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); @@ -358,7 +358,7 @@ impl<'a, 'b> SetConfigFeesCpi<'a, 'b> { /// 1. `[writable]` config /// 2. `[]` ncn /// 3. `[signer]` ncn_admin -/// 4. `[]` restaking_program_id +/// 4. `[]` restaking_program #[derive(Clone, Debug)] pub struct SetConfigFeesCpiBuilder<'a, 'b> { instruction: Box>, @@ -372,7 +372,7 @@ impl<'a, 'b> SetConfigFeesCpiBuilder<'a, 'b> { config: None, ncn: None, ncn_admin: None, - restaking_program_id: None, + restaking_program: None, new_dao_fee_bps: None, new_ncn_fee_bps: None, new_block_engine_fee_bps: None, @@ -411,11 +411,11 @@ impl<'a, 'b> SetConfigFeesCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + restaking_program: &'b solana_program::account_info::AccountInfo<'a>, ) -> &mut Self { - self.instruction.restaking_program_id = Some(restaking_program_id); + self.instruction.restaking_program = Some(restaking_program); self } /// `[optional argument]` @@ -503,10 +503,10 @@ impl<'a, 'b> SetConfigFeesCpiBuilder<'a, 'b> { ncn_admin: self.instruction.ncn_admin.expect("ncn_admin is not set"), - restaking_program_id: self + restaking_program: self .instruction - .restaking_program_id - .expect("restaking_program_id is not set"), + .restaking_program + .expect("restaking_program is not set"), __args: args, }; instruction.invoke_signed_with_remaining_accounts( @@ -523,7 +523,7 @@ struct SetConfigFeesCpiBuilderInstruction<'a, 'b> { config: Option<&'b solana_program::account_info::AccountInfo<'a>>, ncn: Option<&'b solana_program::account_info::AccountInfo<'a>>, ncn_admin: Option<&'b solana_program::account_info::AccountInfo<'a>>, - restaking_program_id: Option<&'b solana_program::account_info::AccountInfo<'a>>, + restaking_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, new_dao_fee_bps: Option, new_ncn_fee_bps: Option, new_block_engine_fee_bps: Option, diff --git a/clients/rust/jito_tip_router/src/generated/instructions/set_new_admin.rs b/clients/rust/jito_tip_router/src/generated/instructions/set_new_admin.rs index c46086d..66b1443 100644 --- a/clients/rust/jito_tip_router/src/generated/instructions/set_new_admin.rs +++ b/clients/rust/jito_tip_router/src/generated/instructions/set_new_admin.rs @@ -18,7 +18,7 @@ pub struct SetNewAdmin { pub new_admin: solana_program::pubkey::Pubkey, - pub restaking_program_id: solana_program::pubkey::Pubkey, + pub restaking_program: solana_program::pubkey::Pubkey, } impl SetNewAdmin { @@ -51,7 +51,7 @@ impl SetNewAdmin { false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.restaking_program_id, + self.restaking_program, false, )); accounts.extend_from_slice(remaining_accounts); @@ -98,14 +98,14 @@ pub struct SetNewAdminInstructionArgs { /// 1. `[]` ncn /// 2. `[signer]` ncn_admin /// 3. `[]` new_admin -/// 4. `[]` restaking_program_id +/// 4. `[]` restaking_program #[derive(Clone, Debug, Default)] pub struct SetNewAdminBuilder { config: Option, ncn: Option, ncn_admin: Option, new_admin: Option, - restaking_program_id: Option, + restaking_program: Option, role: Option, __remaining_accounts: Vec, } @@ -135,11 +135,11 @@ impl SetNewAdminBuilder { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: solana_program::pubkey::Pubkey, + restaking_program: solana_program::pubkey::Pubkey, ) -> &mut Self { - self.restaking_program_id = Some(restaking_program_id); + self.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -172,9 +172,9 @@ impl SetNewAdminBuilder { ncn: self.ncn.expect("ncn is not set"), ncn_admin: self.ncn_admin.expect("ncn_admin is not set"), new_admin: self.new_admin.expect("new_admin is not set"), - restaking_program_id: self - .restaking_program_id - .expect("restaking_program_id is not set"), + restaking_program: self + .restaking_program + .expect("restaking_program is not set"), }; let args = SetNewAdminInstructionArgs { role: self.role.clone().expect("role is not set"), @@ -194,7 +194,7 @@ pub struct SetNewAdminCpiAccounts<'a, 'b> { pub new_admin: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, } /// `set_new_admin` CPI instruction. @@ -210,7 +210,7 @@ pub struct SetNewAdminCpi<'a, 'b> { pub new_admin: &'b solana_program::account_info::AccountInfo<'a>, - pub restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + pub restaking_program: &'b solana_program::account_info::AccountInfo<'a>, /// The arguments for the instruction. pub __args: SetNewAdminInstructionArgs, } @@ -227,7 +227,7 @@ impl<'a, 'b> SetNewAdminCpi<'a, 'b> { ncn: accounts.ncn, ncn_admin: accounts.ncn_admin, new_admin: accounts.new_admin, - restaking_program_id: accounts.restaking_program_id, + restaking_program: accounts.restaking_program, __args: args, } } @@ -282,7 +282,7 @@ impl<'a, 'b> SetNewAdminCpi<'a, 'b> { false, )); accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.restaking_program_id.key, + *self.restaking_program.key, false, )); remaining_accounts.iter().for_each(|remaining_account| { @@ -307,7 +307,7 @@ impl<'a, 'b> SetNewAdminCpi<'a, 'b> { account_infos.push(self.ncn.clone()); account_infos.push(self.ncn_admin.clone()); account_infos.push(self.new_admin.clone()); - account_infos.push(self.restaking_program_id.clone()); + account_infos.push(self.restaking_program.clone()); remaining_accounts .iter() .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); @@ -328,7 +328,7 @@ impl<'a, 'b> SetNewAdminCpi<'a, 'b> { /// 1. `[]` ncn /// 2. `[signer]` ncn_admin /// 3. `[]` new_admin -/// 4. `[]` restaking_program_id +/// 4. `[]` restaking_program #[derive(Clone, Debug)] pub struct SetNewAdminCpiBuilder<'a, 'b> { instruction: Box>, @@ -342,7 +342,7 @@ impl<'a, 'b> SetNewAdminCpiBuilder<'a, 'b> { ncn: None, ncn_admin: None, new_admin: None, - restaking_program_id: None, + restaking_program: None, role: None, __remaining_accounts: Vec::new(), }); @@ -378,11 +378,11 @@ impl<'a, 'b> SetNewAdminCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn restaking_program_id( + pub fn restaking_program( &mut self, - restaking_program_id: &'b solana_program::account_info::AccountInfo<'a>, + restaking_program: &'b solana_program::account_info::AccountInfo<'a>, ) -> &mut Self { - self.instruction.restaking_program_id = Some(restaking_program_id); + self.instruction.restaking_program = Some(restaking_program); self } #[inline(always)] @@ -445,10 +445,10 @@ impl<'a, 'b> SetNewAdminCpiBuilder<'a, 'b> { new_admin: self.instruction.new_admin.expect("new_admin is not set"), - restaking_program_id: self + restaking_program: self .instruction - .restaking_program_id - .expect("restaking_program_id is not set"), + .restaking_program + .expect("restaking_program is not set"), __args: args, }; instruction.invoke_signed_with_remaining_accounts( @@ -465,7 +465,7 @@ struct SetNewAdminCpiBuilderInstruction<'a, 'b> { ncn: Option<&'b solana_program::account_info::AccountInfo<'a>>, ncn_admin: Option<&'b solana_program::account_info::AccountInfo<'a>>, new_admin: Option<&'b solana_program::account_info::AccountInfo<'a>>, - restaking_program_id: Option<&'b solana_program::account_info::AccountInfo<'a>>, + restaking_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, role: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( diff --git a/core/src/instruction.rs b/core/src/instruction.rs index df12d59..5e9a6d6 100644 --- a/core/src/instruction.rs +++ b/core/src/instruction.rs @@ -20,7 +20,7 @@ pub enum TipRouterInstruction { #[account(3, signer, name = "ncn_admin")] #[account(4, name = "fee_wallet")] #[account(5, name = "tie_breaker_admin")] - #[account(6, name = "restaking_program_id")] + #[account(6, name = "restaking_program")] #[account(7, name = "system_program")] InitializeNCNConfig { dao_fee_bps: u64, @@ -33,7 +33,7 @@ pub enum TipRouterInstruction { #[account(1, writable, name = "config")] #[account(2, name = "ncn")] #[account(3, signer, name = "ncn_admin")] - #[account(4, name = "restaking_program_id")] + #[account(4, name = "restaking_program")] SetConfigFees { new_dao_fee_bps: Option, new_ncn_fee_bps: Option, @@ -46,7 +46,7 @@ pub enum TipRouterInstruction { #[account(1, name = "ncn")] #[account(2, signer, name = "ncn_admin")] #[account(3, name = "new_admin")] - #[account(4, name = "restaking_program_id")] + #[account(4, name = "restaking_program")] SetNewAdmin { role: ConfigAdminRole, }, @@ -57,7 +57,7 @@ pub enum TipRouterInstruction { #[account(2, name = "ncn")] #[account(3, writable, name = "weight_table")] #[account(4, writable, signer, name = "payer")] - #[account(5, name = "restaking_program_id")] + #[account(5, name = "restaking_program")] #[account(6, name = "system_program")] InitializeWeightTable{ first_slot_of_ncn_epoch: Option, @@ -68,7 +68,7 @@ pub enum TipRouterInstruction { #[account(1, writable, name = "weight_table")] #[account(2, signer, name = "weight_table_admin")] #[account(3, name = "mint")] - #[account(4, name = "restaking_program_id")] + #[account(4, name = "restaking_program")] AdminUpdateWeightTable{ ncn_epoch: u64, weight: u128, @@ -81,7 +81,7 @@ pub enum TipRouterInstruction { #[account(3, name = "weight_table")] #[account(4, writable, name = "epoch_snapshot")] #[account(5, writable, signer, name = "payer")] - #[account(6, name = "restaking_program_id")] + #[account(6, name = "restaking_program")] #[account(7, name = "system_program")] InitializeEpochSnapshot{ first_slot_of_ncn_epoch: Option, @@ -96,7 +96,7 @@ pub enum TipRouterInstruction { #[account(5, writable, name = "epoch_snapshot")] #[account(6, writable, name = "operator_snapshot")] #[account(7, writable, signer, name = "payer")] - #[account(8, name = "restaking_program_id")] + #[account(8, name = "restaking_program")] #[account(9, name = "system_program")] InitializeOperatorSnapshot{ first_slot_of_ncn_epoch: Option, @@ -116,8 +116,9 @@ pub enum TipRouterInstruction { #[account(10, writable, name = "operator_snapshot")] #[account(11, writable, name = "vault_operator_delegation_snapshot")] #[account(12, writable, signer, name = "payer")] - #[account(13, name = "restaking_program_id")] - #[account(14, name = "system_program")] + #[account(13, name = "vault_program")] + #[account(14, name = "restaking_program")] + #[account(15, name = "system_program")] InitializeVaultOperatorDelegationSnapshot{ first_slot_of_ncn_epoch: Option, }, diff --git a/idl/jito_tip_router.json b/idl/jito_tip_router.json index 62150a7..7e5c046 100644 --- a/idl/jito_tip_router.json +++ b/idl/jito_tip_router.json @@ -36,7 +36,7 @@ "isSigner": false }, { - "name": "restakingProgramId", + "name": "restakingProgram", "isMut": false, "isSigner": false }, @@ -89,7 +89,7 @@ "isSigner": true }, { - "name": "restakingProgramId", + "name": "restakingProgram", "isMut": false, "isSigner": false } @@ -149,7 +149,7 @@ "isSigner": false }, { - "name": "restakingProgramId", + "name": "restakingProgram", "isMut": false, "isSigner": false } @@ -196,7 +196,7 @@ "isSigner": true }, { - "name": "restakingProgramId", + "name": "restakingProgram", "isMut": false, "isSigner": false }, @@ -243,7 +243,7 @@ "isSigner": false }, { - "name": "restakingProgramId", + "name": "restakingProgram", "isMut": false, "isSigner": false } @@ -297,7 +297,7 @@ "isSigner": true }, { - "name": "restakingProgramId", + "name": "restakingProgram", "isMut": false, "isSigner": false }, @@ -364,7 +364,7 @@ "isSigner": true }, { - "name": "restakingProgramId", + "name": "restakingProgram", "isMut": false, "isSigner": false }, @@ -456,7 +456,12 @@ "isSigner": true }, { - "name": "restakingProgramId", + "name": "vaultProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "restakingProgram", "isMut": false, "isSigner": false }, diff --git a/integration_tests/tests/fixtures/tip_router_client.rs b/integration_tests/tests/fixtures/tip_router_client.rs index ec3a09d..3eb0d6b 100644 --- a/integration_tests/tests/fixtures/tip_router_client.rs +++ b/integration_tests/tests/fixtures/tip_router_client.rs @@ -1,16 +1,24 @@ use jito_bytemuck::AccountDeserialize; -use jito_restaking_core::config::Config; +use jito_restaking_core::{ + config::Config, ncn_operator_state::NcnOperatorState, ncn_vault_ticket::NcnVaultTicket, +}; use jito_tip_router_client::{ instructions::{ AdminUpdateWeightTableBuilder, InitializeEpochSnapshotBuilder, InitializeNCNConfigBuilder, + InitializeOperatorSnapshotBuilder, InitializeVaultOperatorDelegationSnapshotBuilder, InitializeWeightTableBuilder, SetConfigFeesBuilder, SetNewAdminBuilder, }, types::ConfigAdminRole, }; use jito_tip_router_core::{ - epoch_snapshot::EpochSnapshot, error::TipRouterError, ncn_config::NcnConfig, + epoch_snapshot::{EpochSnapshot, OperatorSnapshot, VaultOperatorDelegationSnapshot}, + error::TipRouterError, + ncn_config::NcnConfig, weight_table::WeightTable, }; +use jito_vault_core::{ + vault_ncn_ticket::VaultNcnTicket, vault_operator_delegation::VaultOperatorDelegation, +}; use solana_program::{ instruction::InstructionError, native_token::sol_to_lamports, pubkey::Pubkey, system_instruction::transfer, @@ -114,7 +122,7 @@ impl TipRouterClient { .ncn_admin(ncn_admin.pubkey()) .fee_wallet(fee_wallet) .tie_breaker_admin(tie_breaker_admin) - .restaking_program_id(jito_restaking_program::id()) + .restaking_program(jito_restaking_program::id()) .dao_fee_bps(dao_fee_bps) .ncn_fee_bps(ncn_fee_bps) .block_engine_fee_bps(block_engine_fee_bps) @@ -168,7 +176,7 @@ impl TipRouterClient { .config(config_pda) .ncn(ncn_root.ncn_pubkey) .ncn_admin(ncn_root.ncn_admin.pubkey()) - .restaking_program_id(jito_restaking_program::id()) + .restaking_program(jito_restaking_program::id()) .new_dao_fee_bps(dao_fee_bps) .new_ncn_fee_bps(ncn_fee_bps) .new_block_engine_fee_bps(block_engine_fee_bps) @@ -210,7 +218,7 @@ impl TipRouterClient { .ncn(ncn_root.ncn_pubkey) .ncn_admin(ncn_root.ncn_admin.pubkey()) .new_admin(new_admin) - .restaking_program_id(jito_restaking_program::id()) + .restaking_program(jito_restaking_program::id()) .role(role) .instruction(); @@ -252,7 +260,7 @@ impl TipRouterClient { .ncn(ncn) .weight_table(weight_table) .payer(self.payer.pubkey()) - .restaking_program_id(jito_restaking_program::id()) + .restaking_program(jito_restaking_program::id()) .system_program(system_program::id()) .instruction(); @@ -295,7 +303,7 @@ impl TipRouterClient { .weight_table(weight_table) .weight_table_admin(self.payer.pubkey()) .mint(mint) - .restaking_program_id(jito_restaking_program::id()) + .restaking_program(jito_restaking_program::id()) .weight(weight) .instruction(); @@ -309,40 +317,186 @@ impl TipRouterClient { .await } - pub async fn do_initialize_epoch_snapshot( + pub async fn do_initialize_epoch_snapshot(&mut self, ncn: Pubkey, slot: u64) -> TestResult<()> { + self.initialize_epoch_snapshot(ncn, slot).await + } + + pub async fn initialize_epoch_snapshot(&mut self, ncn: Pubkey, slot: u64) -> TestResult<()> { + let restaking_config = Config::find_program_address(&jito_restaking_program::id()).0; + + let restaking_config_account = self.get_restaking_config().await?; + let ncn_epoch = slot / restaking_config_account.epoch_length(); + + let config_pda = NcnConfig::find_program_address(&jito_tip_router_program::id(), &ncn).0; + let weight_table = + WeightTable::find_program_address(&jito_tip_router_program::id(), &ncn, ncn_epoch).0; + + let epoch_snapshot = + EpochSnapshot::find_program_address(&jito_tip_router_program::id(), &ncn, ncn_epoch).0; + + let ix = InitializeEpochSnapshotBuilder::new() + .ncn_config(config_pda) + .restaking_config(restaking_config) + .ncn(ncn) + .weight_table(weight_table) + .epoch_snapshot(epoch_snapshot) + .payer(self.payer.pubkey()) + .restaking_program(jito_restaking_program::id()) + .system_program(system_program::id()) + .first_slot_of_ncn_epoch(slot) + .instruction(); + + let blockhash = self.banks_client.get_latest_blockhash().await?; + self.process_transaction(&Transaction::new_signed_with_payer( + &[ix], + Some(&self.payer.pubkey()), + &[&self.payer], + blockhash, + )) + .await + } + + pub async fn do_initalize_operator_snapshot( &mut self, + operator: Pubkey, ncn: Pubkey, - current_slot: u64, + slot: u64, ) -> TestResult<()> { - self.initialize_epoch_snapshot(ncn, current_slot).await + self.initalize_operator_snapshot(operator, ncn, slot).await } - pub async fn initialize_epoch_snapshot( + pub async fn initalize_operator_snapshot( &mut self, + operator: Pubkey, ncn: Pubkey, - current_slot: u64, + slot: u64, ) -> TestResult<()> { let restaking_config = Config::find_program_address(&jito_restaking_program::id()).0; let restaking_config_account = self.get_restaking_config().await?; - let ncn_epoch = current_slot / restaking_config_account.epoch_length(); + let ncn_epoch = slot / restaking_config_account.epoch_length(); let config_pda = NcnConfig::find_program_address(&jito_tip_router_program::id(), &ncn).0; - let weight_table = - WeightTable::find_program_address(&jito_tip_router_program::id(), &ncn, ncn_epoch).0; let epoch_snapshot = EpochSnapshot::find_program_address(&jito_tip_router_program::id(), &ncn, ncn_epoch).0; - let ix = InitializeEpochSnapshotBuilder::new() + let ncn_operator_state = + NcnOperatorState::find_program_address(&jito_restaking_program::id(), &ncn, &operator) + .0; + + let operator_snapshot = OperatorSnapshot::find_program_address( + &jito_tip_router_program::id(), + &operator, + &ncn, + ncn_epoch, + ) + .0; + + let ix = InitializeOperatorSnapshotBuilder::new() + .ncn_config(config_pda) .restaking_config(restaking_config) + .ncn(ncn) + .operator(operator) + .ncn_operator_state(ncn_operator_state) + .epoch_snapshot(epoch_snapshot) + .operator_snapshot(operator_snapshot) + .payer(self.payer.pubkey()) + .restaking_program(jito_restaking_program::id()) + .system_program(system_program::id()) + .first_slot_of_ncn_epoch(slot) + .instruction(); + + let blockhash = self.banks_client.get_latest_blockhash().await?; + self.process_transaction(&Transaction::new_signed_with_payer( + &[ix], + Some(&self.payer.pubkey()), + &[&self.payer], + blockhash, + )) + .await + } + + pub async fn do_initalize_vault_operator_delegation_snapshot( + &mut self, + vault: Pubkey, + operator: Pubkey, + ncn: Pubkey, + slot: u64, + ) -> TestResult<()> { + self.initalize_vault_operator_delegation_snapshot(vault, operator, ncn, slot) + .await + } + + pub async fn initalize_vault_operator_delegation_snapshot( + &mut self, + vault: Pubkey, + operator: Pubkey, + ncn: Pubkey, + slot: u64, + ) -> TestResult<()> { + let restaking_config = Config::find_program_address(&jito_restaking_program::id()).0; + + let restaking_config_account = self.get_restaking_config().await?; + let ncn_epoch = slot / restaking_config_account.epoch_length(); + + let config_pda = NcnConfig::find_program_address(&jito_tip_router_program::id(), &ncn).0; + + let epoch_snapshot = + EpochSnapshot::find_program_address(&jito_tip_router_program::id(), &ncn, ncn_epoch).0; + + let operator_snapshot = OperatorSnapshot::find_program_address( + &jito_tip_router_program::id(), + &operator, + &ncn, + ncn_epoch, + ) + .0; + + let vault_ncn_ticket = + VaultNcnTicket::find_program_address(&jito_vault_program::id(), &vault, &ncn).0; + + let ncn_vault_ticket = + NcnVaultTicket::find_program_address(&jito_restaking_program::id(), &ncn, &vault).0; + + let vault_operator_delegation = VaultOperatorDelegation::find_program_address( + &jito_vault_program::id(), + &vault, + &operator, + ) + .0; + + let weight_table = + WeightTable::find_program_address(&jito_tip_router_program::id(), &ncn, ncn_epoch).0; + + let vault_operator_delegation_snapshot = + VaultOperatorDelegationSnapshot::find_program_address( + &jito_tip_router_program::id(), + &vault, + &operator, + &ncn, + ncn_epoch, + ) + .0; + + let ix = InitializeVaultOperatorDelegationSnapshotBuilder::new() .ncn_config(config_pda) + .restaking_config(restaking_config) .ncn(ncn) + .operator(operator) + .vault(vault) + .vault_ncn_ticket(vault_ncn_ticket) + .ncn_vault_ticket(ncn_vault_ticket) + .vault_operator_delegation(vault_operator_delegation) .weight_table(weight_table) .epoch_snapshot(epoch_snapshot) + .operator_snapshot(operator_snapshot) + .vault_operator_delegation_snapshot(vault_operator_delegation_snapshot) .payer(self.payer.pubkey()) - .restaking_program_id(jito_restaking_program::id()) + .vault_program(jito_vault_program::id()) + .restaking_program(jito_restaking_program::id()) .system_program(system_program::id()) + .first_slot_of_ncn_epoch(slot) .instruction(); let blockhash = self.banks_client.get_latest_blockhash().await?; diff --git a/program/Cargo.toml b/program/Cargo.toml index a7819c4..78f6afb 100644 --- a/program/Cargo.toml +++ b/program/Cargo.toml @@ -36,6 +36,7 @@ jito-restaking-program = { workspace = true } jito-restaking-sdk = { workspace = true } jito-tip-router-core = { workspace = true } jito-vault-core = { workspace = true } +jito-vault-program = { workspace = true } jito-vault-sdk = { workspace = true } shank = { workspace = true } solana-program = { workspace = true } diff --git a/program/src/admin_update_weight_table.rs b/program/src/admin_update_weight_table.rs index ea52234..c27ddf5 100644 --- a/program/src/admin_update_weight_table.rs +++ b/program/src/admin_update_weight_table.rs @@ -14,11 +14,11 @@ pub fn process_admin_update_weight_table( ncn_epoch: u64, weight: u128, ) -> ProgramResult { - let [ncn, weight_table, weight_table_admin, mint, restaking_program_id] = accounts else { + let [ncn, weight_table, weight_table_admin, mint, restaking_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; - Ncn::load(restaking_program_id.key, ncn, false)?; + Ncn::load(restaking_program.key, ncn, false)?; let ncn_weight_table_admin = { let ncn_data = ncn.data.borrow(); let ncn = Ncn::try_from_slice_unchecked(&ncn_data)?; @@ -29,7 +29,7 @@ pub fn process_admin_update_weight_table( load_token_mint(mint)?; WeightTable::load(program_id, weight_table, ncn, ncn_epoch, true)?; - if restaking_program_id.key.ne(&jito_restaking_program::id()) { + if restaking_program.key.ne(&jito_restaking_program::id()) { msg!("Incorrect restaking program ID"); return Err(ProgramError::InvalidAccountData); } diff --git a/program/src/initialize_epoch_snapshot.rs b/program/src/initialize_epoch_snapshot.rs index 92c2bb4..8ae74a1 100644 --- a/program/src/initialize_epoch_snapshot.rs +++ b/program/src/initialize_epoch_snapshot.rs @@ -19,20 +19,20 @@ pub fn process_initialize_epoch_snapshot( accounts: &[AccountInfo], first_slot_of_ncn_epoch: Option, ) -> ProgramResult { - let [ncn_config, restaking_config, ncn, weight_table, epoch_snapshot, payer, restaking_program_id, system_program] = + let [ncn_config, restaking_config, ncn, weight_table, epoch_snapshot, payer, restaking_program, system_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; - if restaking_program_id.key.ne(&jito_restaking_program::id()) { + if restaking_program.key.ne(&jito_restaking_program::id()) { msg!("Incorrect restaking program ID"); return Err(ProgramError::InvalidAccountData); } NcnConfig::load(program_id, ncn.key, ncn_config, false)?; - Config::load(restaking_program_id.key, restaking_config, false)?; - Ncn::load(restaking_program_id.key, ncn, false)?; + Config::load(restaking_program.key, restaking_config, false)?; + Ncn::load(restaking_program.key, ncn, false)?; load_system_account(epoch_snapshot, true)?; load_system_program(system_program)?; diff --git a/program/src/initialize_ncn_config.rs b/program/src/initialize_ncn_config.rs index 3d4cad2..83b450e 100644 --- a/program/src/initialize_ncn_config.rs +++ b/program/src/initialize_ncn_config.rs @@ -19,7 +19,7 @@ pub fn process_initialize_ncn_config( ncn_fee_bps: u64, block_engine_fee_bps: u64, ) -> ProgramResult { - let [restaking_config, ncn_config, ncn_account, fee_wallet, ncn_admin, tie_breaker_admin, restaking_program_id, system_program] = + let [restaking_config, ncn_config, ncn_account, fee_wallet, ncn_admin, tie_breaker_admin, restaking_program, system_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); @@ -29,8 +29,8 @@ pub fn process_initialize_ncn_config( load_system_program(system_program)?; load_signer(ncn_admin, false)?; - Ncn::load(restaking_program_id.key, ncn_account, false)?; - Config::load(restaking_program_id.key, restaking_config, false)?; + Ncn::load(restaking_program.key, ncn_account, false)?; + Config::load(restaking_program.key, restaking_config, false)?; let ncn_epoch_length = { let config_data = restaking_config.data.borrow(); diff --git a/program/src/initialize_operator_snapshot.rs b/program/src/initialize_operator_snapshot.rs index dbc6726..75ff1ac 100644 --- a/program/src/initialize_operator_snapshot.rs +++ b/program/src/initialize_operator_snapshot.rs @@ -22,23 +22,23 @@ pub fn process_initialize_operator_snapshot( accounts: &[AccountInfo], first_slot_of_ncn_epoch: Option, ) -> ProgramResult { - let [ncn_config, restaking_config, ncn, operator, ncn_operator_state, epoch_snapshot, operator_snapshot, payer, restaking_program_id, system_program] = + let [ncn_config, restaking_config, ncn, operator, ncn_operator_state, epoch_snapshot, operator_snapshot, payer, restaking_program, system_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; - if restaking_program_id.key.ne(&jito_restaking_program::id()) { + if restaking_program.key.ne(&jito_restaking_program::id()) { msg!("Incorrect restaking program ID"); return Err(ProgramError::InvalidAccountData); } NcnConfig::load(program_id, ncn.key, ncn_config, false)?; - Config::load(restaking_program_id.key, restaking_config, false)?; - Ncn::load(restaking_program_id.key, ncn, false)?; - Operator::load(restaking_program_id.key, operator, false)?; + Config::load(restaking_program.key, restaking_config, false)?; + Ncn::load(restaking_program.key, ncn, false)?; + Operator::load(restaking_program.key, operator, false)?; NcnOperatorState::load( - restaking_program_id.key, + restaking_program.key, ncn_operator_state, ncn, operator, diff --git a/program/src/initialize_vault_operator_delegation_snapshot.rs b/program/src/initialize_vault_operator_delegation_snapshot.rs index 12b9f4a..147095e 100644 --- a/program/src/initialize_vault_operator_delegation_snapshot.rs +++ b/program/src/initialize_vault_operator_delegation_snapshot.rs @@ -26,43 +26,44 @@ pub fn process_initialize_vault_operator_delegation_snapshot( accounts: &[AccountInfo], first_slot_of_ncn_epoch: Option, ) -> ProgramResult { - let [ncn_config, restaking_config, ncn, operator, vault, vault_ncn_ticket, ncn_vault_ticket, vault_operator_delegation, weight_table, epoch_snapshot, operator_snapshot, vault_operator_delegation_snapshot, payer, restaking_program_id, system_program] = + let [ncn_config, restaking_config, ncn, operator, vault, vault_ncn_ticket, ncn_vault_ticket, vault_operator_delegation, weight_table, epoch_snapshot, operator_snapshot, vault_operator_delegation_snapshot, payer, vault_program, restaking_program, system_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; - if restaking_program_id.key.ne(&jito_restaking_program::id()) { + if vault_program.key.ne(&jito_vault_program::id()) { + msg!("Incorrect vault program ID"); + return Err(ProgramError::InvalidAccountData); + } + + if restaking_program.key.ne(&jito_restaking_program::id()) { msg!("Incorrect restaking program ID"); return Err(ProgramError::InvalidAccountData); } NcnConfig::load(program_id, ncn.key, ncn_config, false)?; - Config::load(restaking_program_id.key, restaking_config, false)?; - Ncn::load(restaking_program_id.key, ncn, false)?; - Operator::load(restaking_program_id.key, operator, false)?; - Vault::load(restaking_program_id.key, vault, false)?; - - VaultNcnTicket::load( - restaking_program_id.key, - vault_ncn_ticket, - vault, - ncn, - false, - )?; - NcnVaultTicket::load( - restaking_program_id.key, - ncn_vault_ticket, - ncn, + Config::load(restaking_program.key, restaking_config, false)?; + Ncn::load(restaking_program.key, ncn, false)?; + Operator::load(restaking_program.key, operator, false)?; + Vault::load(vault_program.key, vault, false)?; + + VaultOperatorDelegation::load( + vault_program.key, + vault_operator_delegation, vault, + operator, false, )?; + VaultNcnTicket::load(vault_program.key, vault_ncn_ticket, vault, ncn, false)?; + NcnVaultTicket::load(restaking_program.key, ncn_vault_ticket, ncn, vault, false)?; //TODO check that st mint is supported? //TODO may not exist + //TODO what happens if a new Vault is added inbetween weight table creation and this? - There could be a count mismatch if !vault_operator_delegation.data_is_empty() { VaultOperatorDelegation::load( - restaking_program_id.key, + restaking_program.key, vault_operator_delegation, vault, operator, diff --git a/program/src/initialize_weight_table.rs b/program/src/initialize_weight_table.rs index 384a8be..538ceba 100644 --- a/program/src/initialize_weight_table.rs +++ b/program/src/initialize_weight_table.rs @@ -21,20 +21,20 @@ pub fn process_initialize_weight_table( accounts: &[AccountInfo], first_slot_of_ncn_epoch: Option, ) -> ProgramResult { - let [restaking_config, ncn_config, ncn, weight_table, payer, restaking_program_id, system_program] = + let [restaking_config, ncn_config, ncn, weight_table, payer, restaking_program, system_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; - if restaking_program_id.key.ne(&jito_restaking_program::id()) { + if restaking_program.key.ne(&jito_restaking_program::id()) { msg!("Incorrect restaking program ID"); return Err(ProgramError::InvalidAccountData); } NcnConfig::load(program_id, ncn.key, ncn_config, false)?; - Config::load(restaking_program_id.key, restaking_config, false)?; - Ncn::load(restaking_program_id.key, ncn, false)?; + Config::load(restaking_program.key, restaking_config, false)?; + Ncn::load(restaking_program.key, ncn, false)?; load_system_account(weight_table, true)?; load_system_program(system_program)?; diff --git a/program/src/set_config_fees.rs b/program/src/set_config_fees.rs index 0a25946..7df9a95 100644 --- a/program/src/set_config_fees.rs +++ b/program/src/set_config_fees.rs @@ -15,15 +15,15 @@ pub fn process_set_config_fees( new_block_engine_fee_bps: Option, new_fee_wallet: Option, ) -> ProgramResult { - let [restaking_config, config, ncn_account, fee_admin, restaking_program_id] = accounts else { + let [restaking_config, config, ncn_account, fee_admin, restaking_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; load_signer(fee_admin, true)?; NcnConfig::load(program_id, ncn_account.key, config, true)?; - Ncn::load(restaking_program_id.key, ncn_account, false)?; - Config::load(restaking_program_id.key, restaking_config, false)?; + Ncn::load(restaking_program.key, ncn_account, false)?; + Config::load(restaking_program.key, restaking_config, false)?; let ncn_epoch_length = { let config_data = restaking_config.data.borrow(); diff --git a/program/src/set_new_admin.rs b/program/src/set_new_admin.rs index 1e1f09f..578bcc2 100644 --- a/program/src/set_new_admin.rs +++ b/program/src/set_new_admin.rs @@ -14,14 +14,14 @@ pub fn process_set_new_admin( accounts: &[AccountInfo], role: ConfigAdminRole, ) -> ProgramResult { - let [config, ncn_account, ncn_admin, new_admin, restaking_program_id] = accounts else { + let [config, ncn_account, ncn_admin, new_admin, restaking_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; load_signer(ncn_admin, true)?; NcnConfig::load(program_id, ncn_account.key, config, true)?; - Ncn::load(restaking_program_id.key, ncn_account, false)?; + Ncn::load(restaking_program.key, ncn_account, false)?; let mut config_data = config.try_borrow_mut_data()?; if config_data[0] != NcnConfig::DISCRIMINATOR {