Skip to content

Commit

Permalink
feat: added compressed pda escrow, tested and fixed write access chec…
Browse files Browse the repository at this point in the history
…ks (#626)

* added compressed pda escrow, tested and fixed write access checks

* try cargo-test-sbf

* added retries to indexer

* test only system program tests
  • Loading branch information
ananas-block authored Apr 25, 2024
1 parent 1ea359d commit 424f144
Show file tree
Hide file tree
Showing 62 changed files with 5,079 additions and 875 deletions.
59 changes: 0 additions & 59 deletions .github/workflows/examples.yml

This file was deleted.

21 changes: 15 additions & 6 deletions .github/workflows/light-system-programs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,27 @@ jobs:
include:
- program: account-compression
sub-tests: '[
"@lightprotocol/programs:test-account-compression"
"cargo-test-sbf -p account-compression"
]'
- program: light-compressed-pda
sub-tests: '[
"@lightprotocol/programs:test-compressed-pda"
"cargo-test-sbf -p light-compressed-pda -- --test-threads=1"
]'
- program: light-registry
sub-tests: '[
"@lightprotocol/programs:test-registry"
"cargo-test-sbf -p light-registry"
]'
- program: light-compressed-token
sub-tests: '[
"@lightprotocol/programs:test-compressed-token"
"cargo-test-sbf -p light-compressed-token -- --test-threads=1"
]'
- program: token-escrow
sub-tests: '[
"cargo-test-sbf -p token-escrow"
]'
- program: program-owned-account-test
sub-tests: '[
"cargo-test-sbf -p program-owned-account-test"
]'

steps:
Expand All @@ -65,8 +73,9 @@ jobs:
anchor build
IFS=', ' read -r -a sub_tests <<< "${{ join(fromJSON(matrix['sub-tests']), ', ') }}"
IFS=',' read -r -a sub_tests <<< "${{ join(fromJSON(matrix['sub-tests']), ', ') }}"
for subtest in "${sub_tests[@]}"
do
npx nx run "$subtest"
echo "$subtest"
eval "$subtest"
done
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
elif [[ "$CRATE_NAME" == *"light-compressed-pda"* ]]; then
ARTIFACT="light_compressed_pda.so"
elif [[ "$CRATE_NAME" == *"light-compressed-token"* ]]; then
ARTIFACT="psp_compressed_token.so"
ARTIFACT="light_compressed_token.so"
elif [[ "$CRATE_NAME" == *"light-user-registry"* ]]; then
ARTIFACT="light_user_registry.so"
elif [[ "$CRATE_NAME" == *"light-registry"* ]]; then
Expand Down
24 changes: 24 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"utils",
"xtask",
"examples/token-escrow/programs/*",
"test-programs/*",
]

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion circuit-lib/circuitlib-rs/src/gnark/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use sysinfo::{Signal, System};
use crate::gnark::constants::{HEALTH_CHECK, SERVER_ADDRESS};

static IS_LOADING: AtomicBool = AtomicBool::new(false);

#[derive(Debug)]
pub enum ProofType {
Inclusion,
NonInclusion,
Expand Down
3 changes: 2 additions & 1 deletion examples/token-escrow/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"scripts": {
"lint:fix": "prettier \"*/**/*{.js,.ts}\" -w",
"lint": "prettier \"*/**/*{.js,.ts}\" --check"
"lint": "prettier \"*/**/*{.js,.ts}\" --check",
"test": "cargo test-sbf -p token-escrow -- --test-threads 1"
},
"dependencies": {
"@coral-xyz/anchor": "^0.29.0"
Expand Down
1 change: 1 addition & 0 deletions examples/token-escrow/programs/token-escrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ anchor-lang ={ version="0.29.0", features = ["init-if-needed"] }
light-compressed-token = { path = "../../../../programs/compressed-token" , features = ["cpi"]}
light-compressed-pda = { path = "../../../../programs/compressed-pda" , features = ["cpi"]}
account-compression = { path = "../../../../programs/account-compression" , features = ["cpi"] }
light-hasher = { path = "../../../../merkle-tree/hasher" }

[target.'cfg(not(target_os = "solana"))'.dependencies]
solana-sdk = "1.18.11"
Expand Down
Loading

0 comments on commit 424f144

Please sign in to comment.