diff --git a/test-helpers/package.json b/test-helpers/package.json index 84e6060..dae30b7 100644 --- a/test-helpers/package.json +++ b/test-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@tensor-foundation/test-helpers", - "version": "0.4.1", + "version": "0.4.2", "description": "Utility functions for testing Solana programs with the Solana Web3.js library", "sideEffects": false, "module": "./dist/src/index.mjs", diff --git a/test-helpers/src/index.ts b/test-helpers/src/index.ts index 1fd1719..49fc122 100644 --- a/test-helpers/src/index.ts +++ b/test-helpers/src/index.ts @@ -2,5 +2,6 @@ export * from './addresses'; export * from './constants'; export * from './programIds'; export * from './setup'; +export * from './shared'; export * from './token'; export * from './wns'; diff --git a/test-helpers/src/shared/errors.ts b/test-helpers/src/shared/errors.ts index 4c5937d..736333d 100644 --- a/test-helpers/src/shared/errors.ts +++ b/test-helpers/src/shared/errors.ts @@ -7,3 +7,81 @@ export const TENSOR_ERROR__BAD_METADATA = 9006; export const TENSOR_ERROR__BAD_RULE_SET = 9007; export const TENSOR_ERROR__INVALID_CORE_ASSET = 9008; export const TENSOR_ERROR__INVALID_FEE_ACCOUNT = 9009; + +export const ANCHOR_ERROR__INSTRUCTION_MISSING = 100; +export const ANCHOR_ERROR__INSTRUCTION_FALLBACK_NOT_FOUND = 101; +export const ANCHOR_ERROR__INSTRUCTION_DID_NOT_DESERIALIZE = 102; +export const ANCHOR_ERROR__INSTRUCTION_DID_NOT_SERIALIZE = 103; +export const ANCHOR_ERROR__IDL_INSTRUCTION_STUB = 1000; +export const ANCHOR_ERROR__IDL_INSTRUCTION_INVALID_PROGRAM = 1001; +export const ANCHOR_ERROR__IDL_ACCOUNT_NOT_EMPTY = 1002; +export const ANCHOR_ERROR__EVENT_INSTRUCTION_STUB = 1500; +export const ANCHOR_ERROR__CONSTRAINT_MUT = 2000; +export const ANCHOR_ERROR__CONSTRAINT_HAS_ONE = 2001; +export const ANCHOR_ERROR__CONSTRAINT_SIGNER = 2002; +export const ANCHOR_ERROR__CONSTRAINT_RAW = 2003; +export const ANCHOR_ERROR__CONSTRAINT_OWNER = 2004; +export const ANCHOR_ERROR__CONSTRAINT_RENT_EXEMPT = 2005; +export const ANCHOR_ERROR__CONSTRAINT_SEEDS = 2006; +export const ANCHOR_ERROR__CONSTRAINT_EXECUTABLE = 2007; +export const ANCHOR_ERROR__CONSTRAINT_STATE = 2008; +export const ANCHOR_ERROR__CONSTRAINT_ASSOCIATED = 2009; +export const ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_INIT = 2010; +export const ANCHOR_ERROR__CONSTRAINT_CLOSE = 2011; +export const ANCHOR_ERROR__CONSTRAINT_ADDRESS = 2012; +export const ANCHOR_ERROR__CONSTRAINT_ZERO = 2013; +export const ANCHOR_ERROR__CONSTRAINT_TOKEN_MINT = 2014; +export const ANCHOR_ERROR__CONSTRAINT_TOKEN_OWNER = 2015; +export const ANCHOR_ERROR__CONSTRAINT_MINT_MINT_AUTHORITY = 2016; +export const ANCHOR_ERROR__CONSTRAINT_MINT_FREEZE_AUTHORITY = 2017; +export const ANCHOR_ERROR__CONSTRAINT_MINT_DECIMALS = 2018; +export const ANCHOR_ERROR__CONSTRAINT_SPACE = 2019; +export const ANCHOR_ERROR__CONSTRAINT_ACCOUNT_IS_NONE = 2020; +export const ANCHOR_ERROR__CONSTRAINT_TOKEN_TOKEN_PROGRAM = 2021; +export const ANCHOR_ERROR__CONSTRAINT_MINT_TOKEN_PROGRAM = 2022; +export const ANCHOR_ERROR__CONSTRAINT_ASSOCIATED_TOKEN_TOKEN_PROGRAM = 2023; +export const ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION = 2024; +export const ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_AUTHORITY = 2025; +export const ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_POINTER_EXTENSION_GROUP_ADDRESS = 2026; +export const ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION = 2027; +export const ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_AUTHORITY = 2028; +export const ANCHOR_ERROR__CONSTRAINT_MINT_GROUP_MEMBER_POINTER_EXTENSION_MEMBER_ADDRESS = 2029; +export const ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION = 2030; +export const ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_AUTHORITY = 2031; +export const ANCHOR_ERROR__CONSTRAINT_MINT_METADATA_POINTER_EXTENSION_METADATA_ADDRESS = 2032; +export const ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION = 2033; +export const ANCHOR_ERROR__CONSTRAINT_MINT_CLOSE_AUTHORITY_EXTENSION_AUTHORITY = 2034; +export const ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION = 2035; +export const ANCHOR_ERROR__CONSTRAINT_MINT_PERMANENT_DELEGATE_EXTENSION_DELEGATE = 2036; +export const ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION = 2037; +export const ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_AUTHORITY = 2038; +export const ANCHOR_ERROR__CONSTRAINT_MINT_TRANSFER_HOOK_EXTENSION_PROGRAM_ID = 2039; +export const ANCHOR_ERROR__REQUIRE_VIOLATED = 2500; +export const ANCHOR_ERROR__REQUIRE_EQ_VIOLATED = 2501; +export const ANCHOR_ERROR__REQUIRE_KEYS_EQ_VIOLATED = 2502; +export const ANCHOR_ERROR__REQUIRE_NEQ_VIOLATED = 2503; +export const ANCHOR_ERROR__REQUIRE_KEYS_NEQ_VIOLATED = 2504; +export const ANCHOR_ERROR__REQUIRE_GT_VIOLATED = 2505; +export const ANCHOR_ERROR__REQUIRE_GTE_VIOLATED = 2506; +export const ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_ALREADY_SET = 3000; +export const ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_NOT_FOUND = 3001; +export const ANCHOR_ERROR__ACCOUNT_DISCRIMINATOR_MISMATCH = 3002; +export const ANCHOR_ERROR__ACCOUNT_DID_NOT_DESERIALIZE = 3003; +export const ANCHOR_ERROR__ACCOUNT_DID_NOT_SERIALIZE = 3004; +export const ANCHOR_ERROR__ACCOUNT_NOT_ENOUGH_KEYS = 3005; +export const ANCHOR_ERROR__ACCOUNT_NOT_MUTABLE = 3006; +export const ANCHOR_ERROR__ACCOUNT_OWNED_BY_WRONG_PROGRAM = 3007; +export const ANCHOR_ERROR__INVALID_PROGRAM_ID = 3008; +export const ANCHOR_ERROR__INVALID_PROGRAM_EXECUTABLE = 3009; +export const ANCHOR_ERROR__ACCOUNT_NOT_SIGNER = 3010; +export const ANCHOR_ERROR__ACCOUNT_NOT_SYSTEM_OWNED = 3011; +export const ANCHOR_ERROR__ACCOUNT_NOT_INITIALIZED = 3012; +export const ANCHOR_ERROR__ACCOUNT_NOT_PROGRAM_DATA = 3013; +export const ANCHOR_ERROR__ACCOUNT_NOT_ASSOCIATED_TOKEN_ACCOUNT = 3014; +export const ANCHOR_ERROR__ACCOUNT_SYSVAR_MISMATCH = 3015; +export const ANCHOR_ERROR__ACCOUNT_REALLOC_EXCEEDS_LIMIT = 3016; +export const ANCHOR_ERROR__ACCOUNT_DUPLICATE_REALLOCS = 3017; +export const ANCHOR_ERROR__DECLARED_PROGRAM_ID_MISMATCH = 4100; +export const ANCHOR_ERROR__TRYING_TO_INIT_PAYER_AS_PROGRAM_ACCOUNT = 4101; +export const ANCHOR_ERROR__INVALID_NUMERIC_CONVERSION = 4102; +export const ANCHOR_ERROR__DEPRECATED = 5000;