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

Add IF stake and unstake CPIs #57

Merged
merged 62 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
7fe4191
Squashed to deal with merge conflicts
wphan Oct 6, 2024
ba02262
Merge branch 'master' into wphan/tokenized_vault_depositors
wphan Oct 6, 2024
6dbdfec
fix tests
wphan Oct 6, 2024
8679abc
whitespace
wphan Oct 6, 2024
9152b27
whitespace
wphan Oct 6, 2024
6afa71e
whitespace
wphan Oct 6, 2024
9a92f14
refactor tests, reduce boilerplate
wphan Oct 7, 2024
ed11a81
restrict issuing new tokens after rebase
wphan Oct 7, 2024
94aa9fd
fix clippy
wphan Oct 8, 2024
1d5b0bf
Merge remote-tracking branch 'origin/master' into wphan/wphan/tokeniz…
wphan Oct 8, 2024
d4b86f3
fix clippy in gh action
wphan Oct 8, 2024
04b19ee
fix tests with adminclient
wphan Oct 8, 2024
b0c7363
fix test equality
wphan Oct 8, 2024
5d2b347
fix test equality
wphan Oct 8, 2024
dd0226f
test creating TokenizedDepositor for new shares base
wphan Oct 8, 2024
92b3cbe
add token_cpi.rs
wphan Oct 8, 2024
9786f2e
clean up msc msg
wphan Oct 8, 2024
5128299
linter
wphan Oct 8, 2024
84b7c9f
Merge remote-tracking branch 'origin/master' into wphan/wphan/tokeniz…
wphan Oct 8, 2024
9fcaf1d
Merge branch 'master' into wphan/wphan/tokenized_vault_depositors_2
wphan Oct 9, 2024
f808b12
Merge remote-tracking branch 'origin/master' into wphan/wphan/tokeniz…
wphan Oct 9, 2024
cc19632
update yarn.lock
wphan Oct 9, 2024
1d05896
Merge remote-tracking branch 'origin/master' into wphan/wphan/tokeniz…
wphan Oct 22, 2024
97f78a8
address some PR comments
wphan Oct 23, 2024
4173fa5
make sure vault_protocol everywhere, consolidate rebase logic, consol…
wphan Oct 23, 2024
928ab3c
use safemath
wphan Oct 23, 2024
6ed61bb
remove drift-competitions
wphan Oct 23, 2024
7608cbe
update main.yml
wphan Oct 23, 2024
cbfc6f0
fix linter
wphan Oct 23, 2024
81c7767
remove default-features=false
wphan Oct 23, 2024
7908097
add continue-on-error
wphan Oct 23, 2024
cb7b2fc
Merge remote-tracking branch 'origin/master' into wphan/remove_compet…
wphan Oct 23, 2024
75e6dfa
cargo fetch before solana-verify
wphan Oct 23, 2024
2cd1576
cargo vendor before solana-verify
wphan Oct 23, 2024
99ffa10
try to parse last line of build output
wphan Oct 23, 2024
ab68c3f
override shell command to keep errors
wphan Oct 23, 2024
7de9226
kcikoff build
wphan Oct 23, 2024
46b20e5
Merge remote-tracking branch 'origin/master' into wphan/remove_compet…
wphan Oct 23, 2024
5771e34
use raw bash
wphan Oct 23, 2024
42bdf6d
Merge remote-tracking branch 'origin/master' into wphan/remove_compet…
wphan Oct 23, 2024
67e1891
try another shell cmd
wphan Oct 23, 2024
a701f3e
update shell
wphan Oct 23, 2024
dbe232d
disable cargo frozen
wphan Oct 23, 2024
625afe0
add DOCKER_FLAGS to solana-verify build
wphan Oct 23, 2024
09ceb97
use cargo vendor
wphan Oct 23, 2024
bf68fda
add IF staking functions, allow IF accounts for markets other than va…
wphan Oct 24, 2024
437dd37
add basic test init different if accounts
wphan Oct 24, 2024
94048fc
add tests
wphan Oct 25, 2024
c343672
fix if tests, finish ixs
wphan Oct 26, 2024
d61a555
Merge remote-tracking branch 'origin/master' into wphan/wphan/tokeniz…
wphan Oct 26, 2024
c5a7ec0
Merge branch 'wphan/wphan/tokenized_vault_depositors_2' into wphan/re…
wphan Oct 26, 2024
6b6c16d
Merge branch 'wphan/remove_competition' into wphan/if_functions
wphan Oct 26, 2024
b88764c
chore: removes competition (#56)
wphan Oct 29, 2024
19a4742
PR comments, and clippy
wphan Oct 29, 2024
f91b998
fix test
wphan Oct 29, 2024
6d1f085
Merge branch 'wphan/wphan/tokenized_vault_depositors_2' into wphan/if…
wphan Oct 29, 2024
ad70954
Update CHANGELOG.md
wphan Oct 29, 2024
301c61b
Merge remote-tracking branch 'origin/wphan/wphan/tokenized_vault_depo…
wphan Oct 29, 2024
b6bbc7d
update CHANGELOG.md
wphan Oct 29, 2024
b0392ee
whitespace
wphan Oct 29, 2024
3084b25
Merge remote-tracking branch 'origin/master' into wphan/if_functions
wphan Oct 29, 2024
968a0d7
fix tests
wphan Oct 29, 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
14 changes: 10 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: main

on:
push:
branches: master
branches: [master]
pull_request:
branches: master
branches: [master]

defaults:
run:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Cargo fmt
run: cargo fmt -- --check
- name: Cargo clippy
run: cargo clippy -p drift
run: cargo clippy -p drift-vaults
unit:
name: Unit tests
runs-on: ubicloud
Expand Down Expand Up @@ -138,11 +138,17 @@ jobs:

- name: Install Solana Verify
run: |
cargo install solana-verify
cargo install --locked --version 0.2.11 solana-verify
solana-verify --version

- name: Verifiable Build
run: |
cargo vendor
mkdir -p .cargo
echo '[source.crates-io]' > .cargo/config.toml
echo 'replace-with = "vendored-sources"' >> .cargo/config.toml
echo '[source.vendored-sources]' >> .cargo/config.toml
echo 'directory = "vendor"' >> .cargo/config.toml
solana-verify build --library-name drift_vaults --base-image ellipsislabs/solana:1.16.6

- name: Upload Artifact
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/on-sdk-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- master
repository_dispatch:
types: [competitions-sdk-update]
types: [sdk-update]

env:
CARGO_TERM_COLOR: always
Expand All @@ -28,14 +28,11 @@ jobs:
id: determine-sdk-version
run: |
if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
echo "DRIFT_SDK_VERSION=${{ github.event.client_payload.sdk-version }}" >> $GITHUB_ENV
echo "COMPETITIONS_SDK_VERSION=${{ github.event.client_payload.competitions-version }}" >> $GITHUB_ENV
echo "DRIFT_SDK_VERSION=${{ github.event.client_payload.version }}" >> $GITHUB_ENV
else
# Get the current version of sdk used in package.json
CURRENT_DRIFT_SDK_VERSION=$(node -e "console.log(require('./ts/sdk/package.json').dependencies['@drift-labs/sdk'])")
CURRENT_COMPETITIONS_SDK_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@drift-labs/competitions-sdk'])")
echo "DRIFT_SDK_VERSION=$CURRENT_DRIFT_SDK_VERSION" >> $GITHUB_ENV
echo "COMPETITIONS_SDK_VERSION=$CURRENT_COMPETITIONS_SDK_VERSION" >> $GITHUB_ENV
fi

- name: Install dependencies
Expand All @@ -44,7 +41,6 @@ jobs:
- name: Add specific version of sdk
run: |
yarn add --dev @drift-labs/sdk@$DRIFT_SDK_VERSION
yarn add --dev @drift-labs/competitions-sdk@$COMPETITIONS_SDK_VERSION
cd ts/sdk
yarn add @drift-labs/sdk@$DRIFT_SDK_VERSION

Expand Down Expand Up @@ -75,7 +71,7 @@ jobs:
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
yarn run prettify:fix
git add -A
git commit --allow-empty -m "Bumping sdk and competitions-sdk dependencies to $DRIFT_SDK_VERSION and $COMPETITIONS_SDK_VERSION"
git commit --allow-empty -m "Bumping sdk to $DRIFT_SDK_VERSION"
git push
echo "VAULT_VERSION=$VERSION" >> $GITHUB_ENV

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ test-ledger
migrations
ts/sdk/lib/
ts/sdk/src/**/*.js
ts/sdk/src/**/*.js.map
ts/sdk/src/**/*.js.map
vendor
12 changes: 8 additions & 4 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ wallet = "~/.config/solana/id.json"
address = "dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH"
program = "./deps/drift.so"

[[test.genesis]]
address = "DraWMeQX9LfzQQSYoeBwHAgM5JcqFkgrX7GbTfjzVMVL"
program = "./deps/drift_competitions.so"

[[test.genesis]]
address = "FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH"
program = "./deps/pyth.so"

[[test.genesis]]
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
program = "./deps/metaplex/metaplex.so"

[[test.validator.account]]
address = "PwDiXFxQsGra4sFFTT8r1QWRMd4vfumiWC1jfWNfdYT"
filename = "./deps/metaplex/PwDiXFxQsGra4sFFTT8r1QWRMd4vfumiWC1jfWNfdYT.json"

[scripts]
test = "yarn anchor-tests"
Loading