Browse Source

fix: Skip ignoring spl2.0 dependency issue (#2) (#109)

Ayush 1 year ago
parent
commit
6d134a7a97
28 changed files with 624 additions and 963 deletions
  1. 8 12
      .github/.ghaignore
  2. 183 178
      .github/workflows/anchor.yml
  3. 1 1
      .github/workflows/solana-native.yml
  4. 4 0
      CONTRIBUTING.md
  5. 217 166
      Cargo.lock
  6. 1 2
      Cargo.toml
  7. 1 1
      basics/account-data/native/program/Cargo.toml
  8. 1 1
      basics/checking-accounts/native/program/Cargo.toml
  9. 1 1
      basics/close-account/native/program/Cargo.toml
  10. 1 1
      basics/counter/mpl-stack/Cargo.toml
  11. 189 583
      basics/counter/native/pnpm-lock.yaml
  12. 1 1
      basics/counter/native/program/Cargo.toml
  13. 1 1
      basics/create-account/native/program/Cargo.toml
  14. 1 1
      basics/cross-program-invocation/native/programs/hand/Cargo.toml
  15. 1 1
      basics/cross-program-invocation/native/programs/lever/Cargo.toml
  16. 1 1
      basics/hello-solana/native/program/Cargo.toml
  17. 1 1
      basics/pda-rent-payer/native/program/Cargo.toml
  18. 1 1
      basics/processing-instructions/native/program/Cargo.toml
  19. 1 1
      basics/program-derived-addresses/native/program/Cargo.toml
  20. 1 1
      basics/realloc/native/program/Cargo.toml
  21. 1 1
      basics/rent/native/program/Cargo.toml
  22. 1 1
      basics/repository-layout/native/program/Cargo.toml
  23. 1 1
      basics/transfer-sol/native/program/Cargo.toml
  24. 1 1
      tokens/token-2022/default-account-state/native/program/Cargo.toml
  25. 1 1
      tokens/token-2022/multiple-extensions/native/program/Cargo.toml
  26. 1 1
      tokens/token-2022/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/Cargo.toml
  27. 1 1
      tokens/token-2022/non-transferable/native/program/Cargo.toml
  28. 1 1
      tokens/token-2022/transfer-fee/native/program/Cargo.toml

+ 8 - 12
.github/.ghaignore

@@ -18,23 +18,19 @@ tokens/spl-token-minter/anchor
 tokens/token-swap/anchor
 tokens/token-swap/anchor
 tokens/transfer-tokens/anchor
 tokens/transfer-tokens/anchor
 
 
-# not building with stable solana
-tokens/token-2022/mint-close-authority/native
-tokens/token-2022/non-transferable/native
-tokens/token-2022/default-account-state/native
-tokens/token-2022/transfer-fee/native
-tokens/token-2022/multiple-extensions/native
-
 # not building
 # not building
 oracles/pyth/anchor
 oracles/pyth/anchor
 
 
+# avm broke hence can't build
+# can't use anchor.toml [toolchain] with stable rust
+# update these programs to use latest anchor version to fix
+tokens/token-2022/group/anchor
+tokens/token-2022/immutable-owner/anchor
+tokens/token-2022/interest-bearing/anchor
+tokens/token-2022/memo-transfer/anchor
+
 # not building
 # not building
 compression/cutils/anchor
 compression/cutils/anchor
 compression/cnft-vault/anchor
 compression/cnft-vault/anchor
 # builds but need to test on localhost
 # builds but need to test on localhost
 compression/cnft-burn/anchor
 compression/cnft-burn/anchor
-
-# not building due to > spl 2.0 dependency issue
-tokens/token-2022/group/anchor
-tokens/token-2022/nft-meta-data-pointer/anchor-example/anchor
-tokens/escrow/anchor

+ 183 - 178
.github/workflows/anchor.yml

@@ -11,224 +11,229 @@ on:
     branches:
     branches:
       - main
       - main
 
 
+env:
+  MAX_JOBS: 64
+  MIN_PROJECTS_PER_JOB: 4
+  MIN_PROJECTS_FOR_MATRIX: 4
+
 jobs:
 jobs:
-  build:
+  changes:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     permissions:
     permissions:
-        pull-requests: read
-    strategy:
-      matrix:
-        node-version: [20.x]
-        solana-version: [1.18.17, stable]
-        anchor-version: [0.30.1]
+      pull-requests: read
+    outputs:
+      changed_projects: ${{ steps.analyze.outputs.changed_projects }}
+      total_projects: ${{ steps.analyze.outputs.total_projects }}
+      matrix: ${{ steps.matrix.outputs.matrix }}
     steps:
     steps:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
       - uses: dorny/paths-filter@v3
       - uses: dorny/paths-filter@v3
-        if: github.event_name == 'pull_request'
         id: changes
         id: changes
+        if: github.event_name == 'pull_request'
         with:
         with:
           list-files: shell
           list-files: shell
           filters: |
           filters: |
             anchor:
             anchor:
               - added|modified: '**/anchor/**'
               - added|modified: '**/anchor/**'
-            anchor_action:
-              - added|modified: '**/workflows/anchor.yml'
-
-      - name: Setup Anchor
-        if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule' || github.event_name == 'push'
-        uses: heyAyushh/setup-anchor@v4.0
-        with:
-          anchor-version: ${{ matrix.anchor-version }}
-          solana-cli-version: ${{ matrix.solana-version }}
-          node-version: ${{ matrix.node-version }}
-      - name: Display versions and Install pnpm
-        if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule'
-        run: |
-          solana -V
-          solana-keygen new --no-bip39-passphrase
-          rustc -V
-          anchor -V
-          npm i -g pnpm
-      # Run only if it's triggered by PR to main,
-      # Build the changed programs
-      - name: Build Changed Anchor programs
-        if: steps.changes.outputs.anchor == 'true' && steps.changes.outputs.anchor_action != 'true'
+            workflow:
+              - added|modified: '.github/workflows/anchor.yml'
+      - name: Analyze Changes
+        id: analyze
         run: |
         run: |
+          # Generate ignore pattern, excluding comments
+          ignore_pattern=$(grep -v '^#' .github/.ghaignore | grep -v '^$' | tr '\n' '|' | sed 's/|$//')
+          echo "Ignore pattern: $ignore_pattern"
+
+          function get_projects() {
+            find . -type d -name "anchor" | grep -vE "$ignore_pattern" | sort
+          }
+
+          # Determine which projects to build and test
+          if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "schedule" || "${{ steps.changes.outputs.workflow }}" == "true" ]]; then
+            projects=$(get_projects)
+          elif [[ "${{ steps.changes.outputs.anchor }}" == "true" ]]; then
             changed_files=(${{ steps.changes.outputs.anchor_files }})
             changed_files=(${{ steps.changes.outputs.anchor_files }})
+            projects=$(for file in "${changed_files[@]}"; do dirname "${file}" | grep anchor | sed 's#/anchor/.*#/anchor#g'; done | grep -vE "$ignore_pattern" | sort -u)
+          else
+            projects=""
+          fi
 
 
-            # Read ignored projects from .github/.ghaignore, ignoring empty lines and comments
-            ignored_projects=($(grep . .github/.ghaignore | grep -v '^$'))
-
-            # Find anchor projects and remove ignored projects
-            ProjectDirs=($(for file in "${changed_files[@]}"; do
-              anchor_path=$(dirname "${file}" | grep anchor | sed 's#/anchor/.*#/anchor#g')
-              if [[ ! " ${ignored_projects[*]} " =~ " ${anchor_path} " ]]; then
-                echo "$anchor_path"
-              fi
-            done | sort -u))
-
-            # Build anchor projects
-            echo "Projects to Build:"
-            printf "%s\n" "${ProjectDirs[@]}"
-            for projectDir in "${ProjectDirs[@]}"; do
-              echo "
-              ********
-              Building $projectDir
-              ********"
-              cd $projectDir
-              if anchor build; then
-                echo "Build succeeded for $projectDir."
-                rm -rf target
-              else
-                failed=true
-                failed_builds+=($projectDir)
-                echo "Build failed for $projectDir. Continuing with the next program."
-              fi
-              cd - > /dev/null
-            done
-            if [ "$failed" = true ]; then
-              echo "Programs that failed building:"
-              printf "%s\n" "${failed_builds[@]}"
-              exit 1
-            else
-              echo "All programs built successfully."
-            fi
-        shell: bash
-      # Skip Building all Programs if it's a PR to main branch
-      - name: Build All Anchor programs
-        if: github.event_name == 'schedule' || github.event_name == 'push' || steps.changes.outputs.anchor_action == 'true'
+          # Output project information
+          if [[ -n "$projects" ]]; then
+            echo "Projects to build and test"
+            echo "$projects"
+            total_projects=$(echo "$projects" | wc -l)
+            echo "Total projects: $total_projects"
+            echo "total_projects=$total_projects" >> $GITHUB_OUTPUT
+            echo "changed_projects=$(echo "$projects" | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
+          else
+            echo "No projects to build and test."
+            echo "total_projects=0" >> $GITHUB_OUTPUT
+            echo "changed_projects=[]" >> $GITHUB_OUTPUT
+          fi
+      - name: Generate matrix
+        id: matrix
         run: |
         run: |
-          # Find all anchor projects and remove ignored projects
-          declare -a ProjectDirs=($(find . -type d -name 'anchor' | sed 's|^\./||'| grep -v -f <(grep . .github/.ghaignore | grep -v '^$')))
-
-          echo "Projects to Build:"
-          printf "%s\n" "${ProjectDirs[@]}"
-
-          # Build anchor projects
-          for projectDir in "${ProjectDirs[@]}"; do
-            echo "
-            ********
-            Building $projectDir
-            ********"
-            cd $projectDir
-            if anchor build; then
-              echo "Build succeeded for $projectDir."
-              rm -rf target
-            else
-              failed=true
-              failed_builds+=($projectDir)
-              echo "Build failed for $projectDir. Continuing with the next program."
-            fi
-          cd - > /dev/null
-          done
-          if [ "$failed" = true ]; then
-            echo "Programs that failed building:"
-            printf "%s\n" "${failed_builds[@]}"
-            exit 1
+          total_projects=${{ steps.analyze.outputs.total_projects }}
+          max_jobs=${{ env.MAX_JOBS }}
+          min_projects_per_job=${{ env.MIN_PROJECTS_PER_JOB }}
+          min_projects_for_matrix=${{ env.MIN_PROJECTS_FOR_MATRIX }}
+
+          # Generate matrix based on number of projects
+          if [ "$total_projects" -lt "$min_projects_for_matrix" ]; then
+            echo "matrix=[0]" >> $GITHUB_OUTPUT
           else
           else
-            echo "All programs built successfully."
+            projects_per_job=$(( (total_projects + max_jobs - 1) / max_jobs ))
+            projects_per_job=$(( projects_per_job > min_projects_per_job ? projects_per_job : min_projects_per_job ))
+            num_jobs=$(( (total_projects + projects_per_job - 1) / projects_per_job ))
+
+            indices=$(seq 0 $(( num_jobs - 1 )))
+            echo "matrix=[$(echo $indices | tr ' ' ',')]" >> $GITHUB_OUTPUT
           fi
           fi
-        shell: bash
 
 
-  test:
+  build-and-test:
+    needs: changes
+    if: needs.changes.outputs.total_projects != '0'
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
-    permissions:
-          pull-requests: read
     strategy:
     strategy:
+      fail-fast: false
       matrix:
       matrix:
-        node-version: [20.x]
-        solana-version: [1.18.17, stable]
-        anchor-version: [0.30.1]
+        index: ${{ fromJson(needs.changes.outputs.matrix) }}
+    name: build-and-test-group-${{ matrix.index }}
+    outputs:
+      failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
     steps:
     steps:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
-      - uses: dorny/paths-filter@v3
-        if: github.event_name == 'pull_request'
-        id: changes
-        with:
-          list-files: shell
-          filters: |
-            anchor:
-              - added|modified: '**/anchor/**'
-            anchor_action:
-              - added|modified: '**/workflows/anchor.yml'
-      # Skip Installing and Displaying versions if theres no change in anchor programs or anchor action workflow file or isn't a schedule event
-      - name: Setup Anchor
-        if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule' || github.event_name == 'push'
-        uses: heyAyushh/setup-anchor@v4.0
+      - uses: heyAyushh/setup-anchor@v4.2
         with:
         with:
-          anchor-version: ${{ matrix.anchor-version }}
-          solana-cli-version: ${{ matrix.solana-version }}
-          node-version: ${{ matrix.node-version }}
-      - name: Display versions and Install pnpm
-        if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule' || github.event_name == 'push'
+          anchor-version: 0.30.1
+          solana-cli-version: 1.18.17
+          node-version: 20.x
+          use-avm: false
+      - name: Display Versions and Install pnpm
         run: |
         run: |
           solana -V
           solana -V
           solana-keygen new --no-bip39-passphrase
           solana-keygen new --no-bip39-passphrase
           rustc -V
           rustc -V
           anchor -V
           anchor -V
           npm i -g pnpm
           npm i -g pnpm
-      - name: Test Changed Anchor Programs
-        if: steps.changes.outputs.anchor == 'true' && steps.changes.outputs.anchor_action != 'true'
+      - name: Build and Test
+        env:
+          TOTAL_PROJECTS: ${{ needs.changes.outputs.total_projects }}
+          PROJECTS_PER_JOB: ${{ env.MIN_PROJECTS_PER_JOB }}
         run: |
         run: |
-          changed_files=(${{ steps.changes.outputs.anchor_files }})
-          ProjectDirs=($(for file in "${changed_files[@]}"; do dirname "${file}" | grep anchor | sed 's#/anchor/.*#/anchor#g'; done | grep -v -f <(grep . .github/.ghaignore | grep -v '^$') | sort -u))
-          echo "Projects to Test:"
-          printf "%s\n" "${ProjectDirs[@]}"
-          for projectDir in "${ProjectDirs[@]}"; do
-            echo "
-            ********
-            Testing $projectDir
-            ********"
-            cd $projectDir
-            if pnpm install --frozen-lockfile && anchor test; then
-              echo "Tests succeeded for $projectDir."
-              rm -rf target node_modules
-            else
+          function build_and_test() {
+            local project=$1
+            echo "Building and Testing $project"
+            cd "$project"
+
+            # Run anchor build
+            if ! anchor build; then
+              echo "::error::anchor build failed for $project"
+              echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
+              return 1
+            fi
+
+            # Install dependencies
+            if ! pnpm install --frozen-lockfile; then
+              echo "::error::pnpm install failed for $project"
+              echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
+              return 1
+            fi
+
+            # Run anchor test
+            if ! anchor test; then
+              echo "::error::anchor test failed for $project"
+              echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt
+              return 1
+            fi
+
+            echo "Build and tests succeeded for $project."
+            rm -rf target node_modules
+            return 0
+          }
+
+          # Determine which projects to build in this job
+          readarray -t all_projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]?')
+          start_index=$(( ${{ matrix.index }} * PROJECTS_PER_JOB ))
+          end_index=$(( start_index + PROJECTS_PER_JOB ))
+          end_index=$(( end_index > TOTAL_PROJECTS ? TOTAL_PROJECTS : end_index ))
+
+          echo "Projects to build and test in this job"
+          for i in $(seq $start_index $(( end_index - 1 ))); do
+            echo "${all_projects[$i]}"
+          done
+
+          # Build and test projects
+          failed=false
+          failed_projects=()
+          for i in $(seq $start_index $(( end_index - 1 ))); do
+            echo "::group::Building and testing ${all_projects[$i]}"
+            if ! build_and_test "${all_projects[$i]}"; then
               failed=true
               failed=true
-              failed_tests+=($projectDir)
-              echo "Tests failed for $val. Continuing with the next program."
+              failed_projects+=("${all_projects[$i]}")
             fi
             fi
-          cd - > /dev/null
+            echo "::endgroup::"
           done
           done
-          if [ "$failed" = true ]; then
-            echo "*****************************"
-            echo "Programs that failed testing:"
-            printf "%s\n" "${failed_tests[@]}"
+
+          if [[ "$failed" == "true" ]]; then
+            echo "::group::Failed projects"
+            cat $GITHUB_WORKSPACE/failed_projects.txt
+            echo "::endgroup::"
+            echo "failed_projects=${failed_projects[@]}" >> $GITHUB_OUTPUT
             exit 1
             exit 1
           else
           else
-            echo "All tests passed."
+            echo "failed_projects=" >> $GITHUB_OUTPUT
           fi
           fi
-        shell: bash
-      # Skip Testing all Programs if it's a CRON job or a change in the workflow file
-      - name: Test All Anchor Programs
-        if: github.event_name == 'schedule' || github.event_name == 'push' || steps.changes.outputs.anchor_action == 'true'
+
+      - name: Set failed projects output
+        id: set-failed
+        if: failure()
         run: |
         run: |
-          declare -a ProjectDirs=($(find . -type d -name "anchor"| grep -v -f <(grep . .github/.ghaignore | grep -v '^$')))
-          echo "Projects to Test:"
-          printf "%s\n" "${ProjectDirs[@]}"
-          for projectDir in "${ProjectDirs[@]}"; do
-            echo "
-            ********
-            Testing $projectDir
-            ********"
-            cd $projectDir
-            pnpm install --frozen-lockfile
-            if anchor test; then
-              echo "Tests succeeded for $projectDir."
-              rm -rf target node_modules
+          # Prepare failed projects list for output
+          failed_projects=$(cat $GITHUB_WORKSPACE/failed_projects.txt | jq -R -s -c 'split("\n")[:-1]')
+          echo "failed_projects=$failed_projects" >> $GITHUB_OUTPUT
+
+  summary:
+    needs: [changes, build-and-test]
+    if: always()
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Create job summary
+        run: |
+          echo "## Anchor Workflow Summary" >> $GITHUB_STEP_SUMMARY
+          echo "- Total projects: ${{ needs.changes.outputs.total_projects }}" >> $GITHUB_STEP_SUMMARY
+
+          # List all processed projects
+          echo "<details>" >> $GITHUB_STEP_SUMMARY
+          echo "<summary>Projects processed (click to expand)</summary>" >> $GITHUB_STEP_SUMMARY
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]' | while read project; do
+            echo "- $project" >> $GITHUB_STEP_SUMMARY
+          done
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo "</details>" >> $GITHUB_STEP_SUMMARY
+
+          # Report build and test results
+          if [[ "${{ needs.build-and-test.result }}" == "failure" ]]; then
+            echo "## :x: Build or tests failed" >> $GITHUB_STEP_SUMMARY
+            echo "<details>" >> $GITHUB_STEP_SUMMARY
+            echo "<summary>Failed projects (click to expand)</summary>" >> $GITHUB_STEP_SUMMARY
+            echo "" >> $GITHUB_STEP_SUMMARY
+            failed_projects='${{ needs.build-and-test.outputs.failed_projects }}'
+            if [[ -n "$failed_projects" ]]; then
+              echo "$failed_projects" | jq -r '.[]' | while IFS=: read -r project failure_reason; do
+                echo "- **$project**" >> $GITHUB_STEP_SUMMARY
+                echo "  - Failure reason: $failure_reason" >> $GITHUB_STEP_SUMMARY
+              done
             else
             else
-              failed=true
-              failed_tests+=($projectDir)
-              echo "Tests failed for $val. Continuing with the next program."
+              echo "No failed projects reported. This might indicate an unexpected error in the workflow." >> $GITHUB_STEP_SUMMARY
             fi
             fi
-          cd - > /dev/null
-          done
-          if [ "$failed" = true ]; then
-            echo "*****************************"
-            echo "Programs that failed testing:"
-            printf "%s\n" "${failed_tests[@]}"
-            exit 1
+            echo "" >> $GITHUB_STEP_SUMMARY
+            echo "</details>" >> $GITHUB_STEP_SUMMARY
+          elif [[ "${{ needs.build-and-test.result }}" == "success" ]]; then
+            echo "## :white_check_mark: All builds and tests passed" >> $GITHUB_STEP_SUMMARY
           else
           else
-            echo "All tests passed."
+            echo "## :warning: Build and test job was skipped or canceled" >> $GITHUB_STEP_SUMMARY
           fi
           fi
-        shell: bash

+ 1 - 1
.github/workflows/solana-native.yml

@@ -67,7 +67,7 @@ jobs:
     strategy:
     strategy:
       matrix:
       matrix:
         node-version: [20.x]
         node-version: [20.x]
-        solana-version: [1.17.25, stable]
+        solana-version: [1.18.17, stable]
     steps:
     steps:
       - uses: actions/checkout@v4
       - uses: actions/checkout@v4
       - name: Use Node.js ${{ matrix.node-version }}
       - name: Use Node.js ${{ matrix.node-version }}

+ 4 - 0
CONTRIBUTING.md

@@ -42,6 +42,10 @@ When contributing code examples, please follow these guidelines to ensure progra
 7. TypeScript, JavaScript and JSON files are formatted and linted using
 7. TypeScript, JavaScript and JSON files are formatted and linted using
    [Biome](https://biomejs.dev/). Execute the following command to format and lint your code at the root of this project before submitting a pull request:
    [Biome](https://biomejs.dev/). Execute the following command to format and lint your code at the root of this project before submitting a pull request:
 
 
+8. Some projects can be ignored from the building and testing process by adding the project name to the `.ghaignore` file.
+When removing or updating an example, please ensure that the example is removed from the `.ghaignore` file
+and there's a change in that example's directory.
+
 ```bash
 ```bash
 pnpm check:fix
 pnpm check:fix
 ```
 ```

File diff suppressed because it is too large
+ 217 - 166
Cargo.lock


+ 1 - 2
Cargo.toml

@@ -12,7 +12,6 @@ members = [
     "basics/counter/mpl-stack",
     "basics/counter/mpl-stack",
     "basics/create-account/native/program",
     "basics/create-account/native/program",
     "basics/create-account/anchor/programs/create-system-account",
     "basics/create-account/anchor/programs/create-system-account",
-    "basics/cross-program-invocation/native/programs/*",
     "basics/cross-program-invocation/anchor/programs/*",
     "basics/cross-program-invocation/anchor/programs/*",
     "basics/hello-solana/native/program",
     "basics/hello-solana/native/program",
     "basics/hello-solana/anchor/programs/*",
     "basics/hello-solana/anchor/programs/*",
@@ -34,7 +33,7 @@ members = [
     "tokens/token-2022/non-transferable/native/program",
     "tokens/token-2022/non-transferable/native/program",
     "tokens/token-2022/default-account-state/native/program",
     "tokens/token-2022/default-account-state/native/program",
     "tokens/token-2022/transfer-fee/native/program",
     "tokens/token-2022/transfer-fee/native/program",
-    "tokens/token-2022/multiple-extensions/native/program"
+    "tokens/token-2022/multiple-extensions/native/program",
 ]
 ]
 resolver = "2"
 resolver = "2"
 
 

+ 1 - 1
basics/account-data/native/program/Cargo.toml

@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2021"
 edition = "2021"
 
 
 [dependencies]
 [dependencies]
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
 
 

+ 1 - 1
basics/checking-accounts/native/program/Cargo.toml

@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2021"
 edition = "2021"
 
 
 [dependencies]
 [dependencies]
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/close-account/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/counter/mpl-stack/Cargo.toml

@@ -14,4 +14,4 @@ default = []
 [dependencies]
 [dependencies]
 borsh = "0.9"
 borsh = "0.9"
 shank = "0.0.8"
 shank = "0.0.8"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"

File diff suppressed because it is too large
+ 189 - 583
basics/counter/native/pnpm-lock.yaml


+ 1 - 1
basics/counter/native/program/Cargo.toml

@@ -13,4 +13,4 @@ default = []
 
 
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"

+ 1 - 1
basics/create-account/native/program/Cargo.toml

@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2021"
 edition = "2021"
 
 
 [dependencies]
 [dependencies]
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/cross-program-invocation/native/programs/hand/Cargo.toml

@@ -10,7 +10,7 @@ cpi = ["no-entrypoint"]
 [dependencies]
 [dependencies]
 borsh = "0.10"
 borsh = "0.10"
 borsh-derive = "0.10"
 borsh-derive = "0.10"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 cross-program-invocatio-native-lever = { path = "../lever", features = ["cpi"] }
 cross-program-invocatio-native-lever = { path = "../lever", features = ["cpi"] }
 
 
 [lib]
 [lib]

+ 1 - 1
basics/cross-program-invocation/native/programs/lever/Cargo.toml

@@ -10,7 +10,7 @@ cpi = ["no-entrypoint"]
 [dependencies]
 [dependencies]
 borsh = "0.10"
 borsh = "0.10"
 borsh-derive = "0.10"
 borsh-derive = "0.10"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/hello-solana/native/program/Cargo.toml

@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2021"
 edition = "2021"
 
 
 [dependencies]
 [dependencies]
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/pda-rent-payer/native/program/Cargo.toml

@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2021"
 edition = "2021"
 
 
 [dependencies]
 [dependencies]
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
 
 

+ 1 - 1
basics/processing-instructions/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/program-derived-addresses/native/program/Cargo.toml

@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2021"
 edition = "2021"
 
 
 [dependencies]
 [dependencies]
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
 
 

+ 1 - 1
basics/realloc/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/rent/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/repository-layout/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
basics/transfer-sol/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 
 
 [lib]
 [lib]
 crate-type = ["cdylib", "lib"]
 crate-type = ["cdylib", "lib"]

+ 1 - 1
tokens/token-2022/default-account-state/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "1.17.25"
+solana-program = "1.18.17"
 spl-associated-token-account = { version="2.0.0", features = [ "no-entrypoint" ] }
 spl-associated-token-account = { version="2.0.0", features = [ "no-entrypoint" ] }
 spl-token-2022 = {version = "0.7.0", features = [ "no-entrypoint" ] }
 spl-token-2022 = {version = "0.7.0", features = [ "no-entrypoint" ] }
 
 

+ 1 - 1
tokens/token-2022/multiple-extensions/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "1.17.25"
+solana-program = "1.18.17"
 spl-associated-token-account = { version="2.0.0", features = [ "no-entrypoint" ] }
 spl-associated-token-account = { version="2.0.0", features = [ "no-entrypoint" ] }
 spl-token-2022 = {version = "0.7.0", features = [ "no-entrypoint" ] }
 spl-token-2022 = {version = "0.7.0", features = [ "no-entrypoint" ] }
 
 

+ 1 - 1
tokens/token-2022/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/Cargo.toml

@@ -20,7 +20,7 @@ idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"]
 anchor-lang = { version = "0.30.0", features = ["init-if-needed"] }
 anchor-lang = { version = "0.30.0", features = ["init-if-needed"] }
 anchor-spl = { version = "0.30.0" }
 anchor-spl = { version = "0.30.0" }
 session-keys = { version = "2.0.3", features = ["no-entrypoint"] }
 session-keys = { version = "2.0.3", features = ["no-entrypoint"] }
-solana-program = "1.17.25"
+solana-program = "1.18.17"
 spl-token-2022 = { version="2.0.1", features = [ "no-entrypoint" ] }
 spl-token-2022 = { version="2.0.1", features = [ "no-entrypoint" ] }
 spl-token = { version = "4.0.1", features = [ "no-entrypoint" ] }
 spl-token = { version = "4.0.1", features = [ "no-entrypoint" ] }
 spl-token-metadata-interface = { version = "0.2.1"}
 spl-token-metadata-interface = { version = "0.2.1"}

+ 1 - 1
tokens/token-2022/non-transferable/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.9.3"
 borsh = "0.9.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 spl-associated-token-account = { version="2.0.0", features = [ "no-entrypoint" ] }
 spl-associated-token-account = { version="2.0.0", features = [ "no-entrypoint" ] }
 spl-token-2022 = {version = "0.7.0", features = [ "no-entrypoint" ] }
 spl-token-2022 = {version = "0.7.0", features = [ "no-entrypoint" ] }
 
 

+ 1 - 1
tokens/token-2022/transfer-fee/native/program/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2021"
 [dependencies]
 [dependencies]
 borsh = "0.10.3"
 borsh = "0.10.3"
 borsh-derive = "0.9.1"
 borsh-derive = "0.9.1"
-solana-program = "=1.17.25"
+solana-program = "=1.18.17"
 spl-associated-token-account = { version="2.0.0", features = [ "no-entrypoint" ] }
 spl-associated-token-account = { version="2.0.0", features = [ "no-entrypoint" ] }
 spl-token-2022 = {version = "0.7.0", features = [ "no-entrypoint" ] }
 spl-token-2022 = {version = "0.7.0", features = [ "no-entrypoint" ] }
 
 

Some files were not shown because too many files changed in this diff