From ca301a66859725ca4420812c95bfca7a2e2c9aba Mon Sep 17 00:00:00 2001 From: kyonRay Date: Wed, 28 May 2025 14:11:39 +0800 Subject: [PATCH] (codec): fix abi codec decode issue when static struct in dynamic struct scenario. --- .github/workflows/workflow.yml | 66 +------------------ .../bcos/sdk/v3/codec/abi/TypeDecoder.java | 2 +- 2 files changed, 4 insertions(+), 64 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index cece5dc3c..5990def98 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -15,12 +15,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, windows-2019, macos-12 ] + os: [ ubuntu-22.04, windows-2019, macos-latest ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 5 - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: deps_cache with: path: | @@ -53,63 +53,3 @@ jobs: - name: run integration testing if: runner.os != 'Windows' run: /bin/bash .ci/ci_check.sh - - build-centos: - name: build-centos - runs-on: ${{ matrix.os }} - continue-on-error: true - strategy: - fail-fast: false - matrix: - os: [ ubuntu-20.04 ] - container: docker.io/centos:7 - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 5 - - uses: actions/cache@v2 - id: deps_cache - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - ~/.m2/repository - ~/.ccache - ~/.fisco - key: build-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} - restore-keys: | - build-${{ matrix.os }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} - build-${{ matrix.os }}-${{ github.base_ref }}- - build-${{ matrix.os }}- - - name: Set up JDK 1.8.0.345 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '8.0.345' - - name: install CentOS dependencies - run: | - sed -i s/mirror.centos.org/mirrors.aliyun.com/g /etc/yum.repos.d/*.repo - sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo - sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo - yum clean all - yum makecache - yum update -y - yum install -y epel-release centos-release-scl wget which git openssl-devel openssl tree - - name: Set up JDK 1.8.0.345 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '8.0.345' - - name: run build test - run: /bin/bash gradlew build --info - - name: run integration testing - run: /bin/bash .ci/ci_check.sh && tree ./build/reports - - name: upload unittest coverage - run: curl -LO https://codecov.io/bash && /bin/bash ./bash - # uses: codecov/codecov-action@v3 - # with: - # token: ${{ secrets.CODECOV_TOKEN }} - # files: ./build/reports/jacoco/test/jacocoTestReport.xml - # flags: unittest - # fail_ci_if_error: true - # verbose: true \ No newline at end of file diff --git a/src/main/java/org/fisco/bcos/sdk/v3/codec/abi/TypeDecoder.java b/src/main/java/org/fisco/bcos/sdk/v3/codec/abi/TypeDecoder.java index 8f731b19d..26bef639b 100644 --- a/src/main/java/org/fisco/bcos/sdk/v3/codec/abi/TypeDecoder.java +++ b/src/main/java/org/fisco/bcos/sdk/v3/codec/abi/TypeDecoder.java @@ -441,7 +441,7 @@ private static T decodeDynamicStructElements( TypeReference.create(declaredField)); staticOffset += Utils.staticStructNestedPublicFieldsFlatList( - (Class) classType) + (Class) declaredField) .size() * Type.MAX_BYTE_LENGTH; } else {