Skip to content

Commit

Permalink
Fix regexes in default instruction account rules (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed Apr 16, 2024
1 parent 19a2d42 commit 56508b2
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/visitors/setInstructionAccountDefaultValuesVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,46 +31,46 @@ export type InstructionAccountDefaultRule = {
export const DEFAULT_INSTRUCTION_ACCOUNT_DEFAULT_RULES: InstructionAccountDefaultRule[] =
[
{
account: /^payer|feePayer$/,
account: /^(payer|feePayer)$/,
defaultValue: payerValueNode(),
ignoreIfOptional: true,
},
{
account: /^authority$/,
account: /^(authority)$/,
defaultValue: identityValueNode(),
ignoreIfOptional: true,
},
{
account: /^programId$/,
account: /^(programId)$/,
defaultValue: programIdValueNode(),
ignoreIfOptional: true,
},
{
account: /^systemProgram|splSystemProgram$/,
account: /^(systemProgram|splSystemProgram)$/,
defaultValue: publicKeyValueNode(
'11111111111111111111111111111111',
'splSystem'
),
ignoreIfOptional: true,
},
{
account: /^tokenProgram|splTokenProgram$/,
account: /^(tokenProgram|splTokenProgram)$/,
defaultValue: publicKeyValueNode(
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
'splToken'
),
ignoreIfOptional: true,
},
{
account: /^ataProgram|splAtaProgram$/,
account: /^(ataProgram|splAtaProgram)$/,
defaultValue: publicKeyValueNode(
'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
'splAssociatedToken'
),
ignoreIfOptional: true,
},
{
account: /^tokenMetadataProgram|mplTokenMetadataProgram$/,
account: /^(tokenMetadataProgram|mplTokenMetadataProgram)$/,
defaultValue: publicKeyValueNode(
'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
'mplTokenMetadata'
Expand All @@ -87,30 +87,30 @@ export const DEFAULT_INSTRUCTION_ACCOUNT_DEFAULT_RULES: InstructionAccountDefaul
ignoreIfOptional: true,
},
{
account: /^candyMachineProgram|mplCandyMachineProgram$/,
account: /^(candyMachineProgram|mplCandyMachineProgram)$/,
defaultValue: publicKeyValueNode(
'CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR',
'mplCandyMachine'
),
ignoreIfOptional: true,
},
{
account: /^candyGuardProgram|mplCandyGuardProgram$/,
account: /^(candyGuardProgram|mplCandyGuardProgram)$/,
defaultValue: publicKeyValueNode(
'Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g',
'mplCandyGuard'
),
ignoreIfOptional: true,
},
{
account: /^clockSysvar|sysvarClock$/,
account: /^(clockSysvar|sysvarClock)$/,
defaultValue: publicKeyValueNode(
'SysvarC1ock11111111111111111111111111111111'
),
ignoreIfOptional: true,
},
{
account: /^epochScheduleSysvar|sysvarEpochSchedule$/,
account: /^(epochScheduleSysvar|sysvarEpochSchedule)$/,
defaultValue: publicKeyValueNode(
'SysvarEpochSchedu1e111111111111111111111111'
),
Expand All @@ -124,49 +124,49 @@ export const DEFAULT_INSTRUCTION_ACCOUNT_DEFAULT_RULES: InstructionAccountDefaul
ignoreIfOptional: true,
},
{
account: /^recentBlockhashesSysvar|sysvarRecentBlockhashes$/,
account: /^(recentBlockhashesSysvar|sysvarRecentBlockhashes)$/,
defaultValue: publicKeyValueNode(
'SysvarRecentB1ockHashes11111111111111111111'
),
ignoreIfOptional: true,
},
{
account: /^rent|rentSysvar|sysvarRent$/,
account: /^(rent|rentSysvar|sysvarRent)$/,
defaultValue: publicKeyValueNode(
'SysvarRent111111111111111111111111111111111'
),
ignoreIfOptional: true,
},
{
account: /^rewardsSysvar|sysvarRewards$/,
account: /^(rewardsSysvar|sysvarRewards)$/,
defaultValue: publicKeyValueNode(
'SysvarRewards111111111111111111111111111111'
),
ignoreIfOptional: true,
},
{
account: /^slotHashesSysvar|sysvarSlotHashes$/,
account: /^(slotHashesSysvar|sysvarSlotHashes)$/,
defaultValue: publicKeyValueNode(
'SysvarS1otHashes111111111111111111111111111'
),
ignoreIfOptional: true,
},
{
account: /^slotHistorySysvar|sysvarSlotHistory$/,
account: /^(slotHistorySysvar|sysvarSlotHistory)$/,
defaultValue: publicKeyValueNode(
'SysvarS1otHistory11111111111111111111111111'
),
ignoreIfOptional: true,
},
{
account: /^stakeHistorySysvar|sysvarStakeHistory$/,
account: /^(stakeHistorySysvar|sysvarStakeHistory)$/,
defaultValue: publicKeyValueNode(
'SysvarStakeHistory1111111111111111111111111'
),
ignoreIfOptional: true,
},
{
account: /^mplCoreProgram$/,
account: /^(mplCoreProgram)$/,
defaultValue: publicKeyValueNode(
'CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d',
'mplCore'
Expand Down

0 comments on commit 56508b2

Please sign in to comment.