Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Merkle Tree Integration + Test Suite #5

Merged
merged 35 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
375a64b
added merkle tree verification lib
gonzaotc Sep 26, 2024
e7efbb8
Advances on leaf generation during verification
gonzaotc Sep 26, 2024
4063dc9
pulled latest changes
gonzaotc Sep 27, 2024
871f123
Implemented tree node generation and verification
gonzaotc Sep 27, 2024
8d01586
refactored public and private phase constraints
gonzaotc Sep 27, 2024
5d44a50
merged incoming changes
gonzaotc Sep 30, 2024
023875b
Advances on proof verification
gonzaotc Oct 1, 2024
9550021
advances on restructuring constraints
gonzaotc Oct 1, 2024
e985fe9
merged with latest changes
gonzaotc Oct 1, 2024
7449bff
stabilized with incoming changes
gonzaotc Oct 1, 2024
d52d8ef
chore: struct sizes fix
gonzaotc Oct 1, 2024
4540727
chore: struct sizes fix
gonzaotc Oct 1, 2024
29c08b1
chore: add phase struct input resize
gonzaotc Oct 1, 2024
aed164b
chore: add phase struct input resize
gonzaotc Oct 1, 2024
69e1eda
chore: redeployed programs
gonzaotc Oct 1, 2024
ae6bccd
advances on merkle tree cli integration
gonzaotc Oct 2, 2024
01c4e09
merged latest changes
gonzaotc Oct 3, 2024
d12139e
merged incoming changes
gonzaotc Oct 4, 2024
c9ae761
chore:lint
gonzaotc Oct 4, 2024
03dad55
chore: improved errors
gonzaotc Oct 4, 2024
a6871ef
new deployment
gonzaotc Oct 4, 2024
aef188f
fixed dependency and max CU per tx issue
gonzaotc Oct 8, 2024
a85dada
Advances on test suite up to executing claim
gonzaotc Oct 9, 2024
71b5cc4
Added token metadata pulling & verification
gonzaotc Oct 10, 2024
8a62844
Implemented minting state test, minter stats pulling
gonzaotc Oct 10, 2024
a93b957
Add test for minting with allowlist, including verification
gonzaotc Oct 10, 2024
fd0360b
advances on testing suite structure, patched check_allow_list_contrai…
gonzaotc Oct 11, 2024
3746626
restructure divided on different nature phases
gonzaotc Oct 11, 2024
6458f5b
Covered more testing cases
gonzaotc Oct 14, 2024
7328573
merged origin changes
gonzaotc Oct 15, 2024
37aa3d3
Added instruction to run tests
gonzaotc Oct 15, 2024
9de8a5c
lint pr
gonzaotc Oct 15, 2024
4d04dd9
lint pr
gonzaotc Oct 15, 2024
2d56669
rollback anchor config to solana mainnet
gonzaotc Oct 15, 2024
afc2b56
added config for testing on anchor.toml
gonzaotc Oct 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
**/target/*
!**/target/types

.cursorrules

local-scripts

.anchor
Expand Down
3 changes: 3 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"timeout": 1000000
}
10 changes: 6 additions & 4 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: true,
singleQuote: true,
trailingComma: 'es5',
tabWidth: 2,
printWidth: 160,

semi: true,
singleQuote: true,
};
14 changes: 11 additions & 3 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ resolution = true
skip-lint = false

[programs.localnet]
libreplex_editions = "587DoLBH2H39i5bToWBc6zRgbD2iJZtc4Kb8nYsskYTq"
libreplex_editions_controls = "5hEa5j38yNJRM9vQA44Q6gXVj4Db8y3mWxkDtQeofKKs"
libreplex_editions = "GHVmd43GebD2SSedqG1AAh76izf5CPAhz6KotkZyRzUD"
libreplex_editions_controls = "CCWfNBFcrjbKSjKes9DqgiQYsnmCFgCVKx21mmV2xWgN"

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
### @dev testing wallet
# wallet = "~/.config/solana/id.json"
wallet = "usb://ledger"

[scripts]
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 js-tests/**/*.ts"
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 test/tests/**/*.ts"

[test]
startup_wait = 100000
Expand All @@ -25,6 +27,8 @@ upgradeable = false

[test.validator]
bind_address = "0.0.0.0"
### @dev: Utilize the testnet cluster for running the testsuite
# url = "https://api.testnet.solana.com"
url = "https://api.mainnet-beta.solana.com"
ledger = ".anchor/test-ledger"
rpc_port = 8899
Expand All @@ -40,3 +44,7 @@ address = "cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK"

[[test.validator.clone]]
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"

[[test.validator.clone]]
address = "5hx15GaPPqsYA61v6QpcGPpo125v7rfvEfZQ4dJErG5V"

10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ codegen-units = 1
[profile.release.build-override]
opt-level = 3
incremental = false
codegen-units = 1
codegen-units = 1
115 changes: 65 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,66 @@
<div align="center">
<img src="https://avatars.githubusercontent.com/u/134429862?s=200&v=4" width="150" />
# Eclipse Program Library Testing Guide

This guide provides step-by-step instructions for setting up and running tests for the Eclipse Program Library.

## Prerequisites

- [Rust](https://www.rust-lang.org/tools/install)
- [Solana CLI](https://docs.solana.com/cli/install-solana-cli-tools)
- [Anchor](https://www.anchor-lang.com/docs/installation)
- [Node.js and npm](https://nodejs.org/en/download/)
- [Yarn](https://classic.yarnpkg.com/en/docs/install)

## Setup and Testing Steps

1. Clone the repository:
```
git clone https://github.com/rarible/eclipse-program-library.git
cd eclipse-program-library
```

2. Install dependencies:
```
yarn install
```

3. Sync program IDs:
- Open `Anchor.toml` and `constants.ts`
- Ensure that the program IDs in both files match
- Example:
```toml
# In Anchor.toml
[programs.localnet]
libreplex_editions = "587DoLBH2H39i5bToWBc6zRgbD2iJZtc4Kb8nYsskYTq"
libreplex_editions_controls = "5hEa5j38yNJRM9vQA44Q6gXVj4Db8y3mWxkDtQeofKKs"
```
```typescript
// In constants.ts
export const LIBREPLEX_EDITIONS_PROGRAM_ID = new PublicKey("587DoLBH2H39i5bToWBc6zRgbD2iJZtc4Kb8nYsskYTq");
export const LIBREPLEX_EDITIONS_CONTROLS_PROGRAM_ID = new PublicKey("5hEa5j38yNJRM9vQA44Q6gXVj4Db8y3mWxkDtQeofKKs");
```

4. Run tests:
- To build and run tests:
```
anchor test
```
- To skip building and only run tests (faster for repeated testing):
```
anchor test --skip-build
```

## Notes

- If you encounter wallet-related errors, ensure your `Anchor.toml` is configured to use your local keypair:
```toml
[provider]
cluster = "localnet"
wallet = "~/.config/solana/id.json"
```

- For any issues or questions, please open an issue in the GitHub repository.

## Contributing

We welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) file for details on how to contribute to this project.

<h1>Libreplex</h1>

<h4>
<a href="https://libreplex.github.io/libreplex-program-library/">Documentation (stable)</a>
</h4>
</div>



The mission of Libreplex is to provide a community-driven, open license protocol to the Solana SPL Token and NFT community. The protocol must meet the following criteria:

1) Distributed deployment keys

To ensure that no single entity can unilaterally make changes that impact or jeopardise the integrity of the applications that depend on the protocol.

2) Open license held by a Trust / Foundation

The licensing must ensure that any applications utilising the protocol can do so knowing that the nature of the protocol remains constant, to minimise uncertainty and maximise transparency.

3) Guaranteed fees-free for life

The fee-free nature of the protocol ensures that even though applications built on top of the protocol may introduce fees, the protocol itself will never do so. This establishes a level playing field to all and enforces predictability and transparency.

4) Open source

The source of the protocol will be made available on github or similar. After initial launch, any changes will be subject to 30-day vetting and a community vote.

INSTRUCTIONS:

Install dependencies

```
yarn
```

Build

```
anchor build
```

To run unit tests (cargo):

`cargo test`

To run unit tests (cargo, for a single program):

`cargo test libreplex_metadata`
4 changes: 4 additions & 0 deletions constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @dev: sync with Anchor.toml to ensure correct program ids are used on tests
export const EDITIONS_PROGRAM_ID = 'GHVmd43GebD2SSedqG1AAh76izf5CPAhz6KotkZyRzUD';
export const EDITIONS_CONTROLS_PROGRAM_ID = 'CCWfNBFcrjbKSjKes9DqgiQYsnmCFgCVKx21mmV2xWgN';
export const TOKEN_GROUP_EXTENSION_PROGRAM_ID = '5hx15GaPPqsYA61v6QpcGPpo125v7rfvEfZQ4dJErG5V';
9 changes: 0 additions & 9 deletions docs/book.toml

This file was deleted.

Binary file removed docs/pdf/20231130-fairlaunch-base-architecture.pdf
Binary file not shown.
6 changes: 0 additions & 6 deletions docs/src/SUMMARY.md

This file was deleted.

95 changes: 0 additions & 95 deletions docs/src/chapter_1.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/creator_machine.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs/src/data_model.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/src/programs.md

This file was deleted.

Loading
Loading