Crates.io | magicblock-delegation-program |
lib.rs | magicblock-delegation-program |
version | 0.0.0 |
source | src |
created_at | 2024-12-11 10:18:25.400385 |
updated_at | 2024-12-11 19:28:47.022465 |
description | Delegation program for the Ephemeral Rollups |
homepage | https://www.magicblock.gg/ |
repository | https://github.com/magicblock-labs/delegation-program |
max_upload_size | |
id | 1479917 |
size | 382,000 |
Delegation module for https://arxiv.org/pdf/2311.02650.pdf
Consts
– Program constants.
Entrypoint
– The program entrypoint.
Errors
– Custom program errors.
Idl
– Interface for clients, explorers, and programs.
Instruction
– Declared instructions and arguments.
Loaders
– Validation logic for loading Solana accounts.
Delegate
- Delegate an account
CommitState
– Commit a new state
Finalize
– Finalize a new state
Undelegate
– Undelegate an account
CommitState
– Commit state account state.Delegator
– Delegator account state.To run the test suite, use the Solana toolchain:
cargo test-sbf
For line coverage, use llvm-cov:
cargo llvm-cov --test test_commit_state
(llvm-cov currently does not work with instructions with CPIs e.g.: delegate, undelegate)
The integration tests are located in the tests/integration
directory.
The tests consist of a Bolt/Anchor program that uses the delegation program to delegate, commit, and undelegate accounts.
This can be also used a reference for how to interact with the program.
To run the integration test, use Bolt or Anchor:
cd tests/integration && bolt test
or:
cd tests/integration && anchor test
RUSTFLAGS="--cfg mainnet" cargo build-sbf