Expand description
Local registry SDK for program-test.
This module provides the minimal registry program SDK functionality needed
for forester and compressible modules without requiring the devenv feature.
It reimplements the necessary constants, PDA derivation, type definitions,
and instruction builders locally to avoid anchor program dependencies.
Structs§
- Compress
AndClose Indices - Indices for CompressAndClose operation (matches registry program’s definition).
- Epoch
Pda - EpochPda account structure for serialization.
- Forester
Config - Configuration for a forester.
- Forester
Epoch Pda - ForesterEpochPda account structure for serialization.
- Forester
Pda - Forester PDA account structure.
- Protocol
Config - Protocol configuration.
- Protocol
Config Pda - Protocol config PDA account structure. Includes Anchor’s 8-byte discriminator at the start.
Constants§
- CLAIM_
DISCRIMINATOR - Claim instruction discriminator
- COMPRESS_
AND_ CLOSE_ DISCRIMINATOR - CompressAndClose instruction discriminator
- EPOCH_
PDA_ DISCRIMINATOR - EpochPda account discriminator
- FINALIZE_
REGISTRATION_ DISCRIMINATOR - FinalizeRegistration instruction discriminator
- FORESTER_
EPOCH_ PDA_ DISCRIMINATOR - ForesterEpochPda account discriminator
- FORESTER_
EPOCH_ SEED - FORESTER_
PDA_ DISCRIMINATOR - ForesterPda account discriminator
- FORESTER_
SEED - PROTOCOL_
CONFIG_ PDA_ DISCRIMINATOR - ProtocolConfigPda account discriminator
- PROTOCOL_
CONFIG_ PDA_ SEED - REGISTER_
FORESTER_ DISCRIMINATOR - RegisterForester instruction discriminator
- REGISTER_
FORESTER_ EPOCH_ DISCRIMINATOR - RegisterForesterEpoch instruction discriminator
- REGISTRY_
PROGRAM_ ID - Registry program ID
- REPORT_
WORK_ DISCRIMINATOR - ReportWork instruction discriminator
Functions§
- build_
claim_ instruction - Builds the Claim instruction.
- build_
compress_ and_ close_ instruction - Builds the CompressAndClose instruction.
- create_
finalize_ registration_ instruction - Builds the FinalizeRegistration instruction.
- create_
register_ forester_ epoch_ pda_ instruction - Builds the RegisterForesterEpoch instruction.
- create_
register_ forester_ instruction - Builds the RegisterForester instruction.
- deserialize_
forester_ pda - Deserializes a ForesterPda from account data. Skips the 8-byte Anchor discriminator automatically.
- deserialize_
protocol_ config_ pda - Deserializes a ProtocolConfigPda from account data. Skips the 8-byte Anchor discriminator automatically.
- get_
epoch_ pda_ address - Derives the epoch PDA address for a given epoch.
- get_
forester_ epoch_ pda - Derives the forester epoch PDA from forester PDA and epoch.
- get_
forester_ epoch_ pda_ from_ authority - Derives the forester epoch PDA from authority and epoch.
- get_
forester_ pda - Derives the forester PDA for a given authority.
- get_
protocol_ config_ pda_ address - Derives the protocol config PDA address.
- protocol_
config_ for_ tests - Creates a ProtocolConfig with a very long active phase (effectively infinite). This allows any slot to be in epoch 0’s active phase.
- serialize_
epoch_ pda - Serializes an EpochPda to account data with Anchor discriminator.
- serialize_
forester_ epoch_ pda - Serializes a ForesterEpochPda to account data with Anchor discriminator.
- serialize_
forester_ pda - Serializes a ForesterPda to account data with Anchor discriminator.
- serialize_
protocol_ config_ pda - Serializes a ProtocolConfigPda to account data with Anchor discriminator.
- setup_
test_ protocol_ accounts - Sets up protocol config, forester, and forester epoch accounts for testing. Uses a very long active phase so any slot is valid for epoch 0.