Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 48 additions & 0 deletions basics/hello-solana/poseidon/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "16"

- name: Install Solana
run: sh -c "$(curl -sSfL https://release.solana.com/v1.17.0/install)"

- name: Install Dependencies
run: |
npm install -g pnpm
pnpm install

- name: Build Program
run: anchor build

- name: Run Tests
run: |
solana-test-validator &
sleep 5
anchor test

- name: Run Rust Tests
run: |
cd programs/poseidon
cargo test

- name: Run Bankrun Tests
run: |
cd programs/poseidon
cargo test --features "test-bpf"
9 changes: 9 additions & 0 deletions basics/hello-solana/poseidon/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.anchor
.DS_Store
target
**/*.rs.bk
*-keypair.json
node_modules
test-ledger
dist
build
12 changes: 12 additions & 0 deletions basics/hello-solana/poseidon/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[features]
seeds = false

[programs.localnet]
poseidon = "7fkznAWPGcMC1ck9Y1c16gMh8wqf1J4NgyJ9NFzGfRaV"

[provider]
cluster = "localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "pnpm run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
8 changes: 8 additions & 0 deletions basics/hello-solana/poseidon/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]
members = ["programs/poseidon"]
resolver = "2"

[profile.release]
overflow-checks = true
lto = "fat"
codegen-units = 1
23 changes: 23 additions & 0 deletions basics/hello-solana/poseidon/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "hello-solana",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"test": "pnpm run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts",
"lint": "eslint '**/*.ts'",
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w"
},
"dependencies": {
"@coral-xyz/anchor": "^0.30.1",
"@solanaturbine/poseidon": "^0.0.6"
},
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"chai": "^4.3.4",
"mocha": "^9.0.3",
"ts-mocha": "^10.0.0",
"typescript": "^4.3.5",
"prettier": "^2.6.2"
}
}
Loading