Skip to content

Commit

Permalink
Merge pull request #5 from rarible/feature/testing-suite
Browse files Browse the repository at this point in the history
[FEATURE]: Merkle Tree Integration + Test Suite
  • Loading branch information
ifelsedeveloper authored Oct 22, 2024
2 parents 966b9c1 + afc2b56 commit 2e5d964
Show file tree
Hide file tree
Showing 77 changed files with 2,647 additions and 3,188 deletions.
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

0 comments on commit 2e5d964

Please sign in to comment.