Normalize line endings in workflows, tests, and scripts

Convert CRLF to LF line endings for consistent cross-platform
development. Affects:
- .github/workflows/*.yml
- cli/smartcontract/rpcbindings tests
- cli/smartcontract/testdata
- scripts/*.sh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Tutus Development 2025-12-21 04:35:42 -05:00
parent 32d12b5106
commit 4b740b45cf
13 changed files with 5720 additions and 5720 deletions

View File

@ -1,152 +1,152 @@
name: Build name: Build
on: on:
pull_request: pull_request:
branches: branches:
- master - master
types: [opened, synchronize] types: [opened, synchronize]
paths-ignore: paths-ignore:
- 'scripts/**' - 'scripts/**'
- '**/*.md' - '**/*.md'
push: push:
# Build for the master branch. # Build for the master branch.
branches: branches:
- master - master
release: release:
# Publish released commit as Docker `latest` and `git_revision` images. # Publish released commit as Docker `latest` and `git_revision` images.
types: types:
- published - published
workflow_dispatch: workflow_dispatch:
inputs: inputs:
ref: ref:
description: 'Ref to build CLI for Ubuntu and Windows Server Core [default: latest master; examples: v0.92.0, 0a4ff9d3e4a9ab432fd5812eb18c98e03b5a7432]' description: 'Ref to build CLI for Ubuntu and Windows Server Core [default: latest master; examples: v0.92.0, 0a4ff9d3e4a9ab432fd5812eb18c98e03b5a7432]'
required: false required: false
default: '' default: ''
push_image: push_image:
description: 'Push images to DockerHub [default: false; examples: true, false]' description: 'Push images to DockerHub [default: false; examples: true, false]'
required: false required: false
default: 'false' default: 'false'
use_latest_tag: use_latest_tag:
description: 'Use `latest` tag while pushing images to DockerHub (applied to Ubuntu image only) [default: false; examples: true, false]' description: 'Use `latest` tag while pushing images to DockerHub (applied to Ubuntu image only) [default: false; examples: true, false]'
required: false required: false
default: 'false' default: 'false'
jobs: jobs:
build_cli: build_cli:
name: Build CLI name: Build CLI
runs-on: ${{matrix.os.name}} runs-on: ${{matrix.os.name}}
strategy: strategy:
matrix: matrix:
os: [{ name: ubuntu-latest, bin-name: linux }, { name: windows-latest, bin-name: windows }, { name: macos-latest, bin-name: darwin }] os: [{ name: ubuntu-latest, bin-name: linux }, { name: windows-latest, bin-name: windows }, { name: macos-latest, bin-name: darwin }]
arch: [amd64, arm64] arch: [amd64, arm64]
exclude: exclude:
- os: { name: windows-latest, bin-name: windows } - os: { name: windows-latest, bin-name: windows }
arch: 'arm64' arch: 'arm64'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
ref: ${{ github.event.inputs.ref }} ref: ${{ github.event.inputs.ref }}
# Allows to fetch all history for all branches and tags. Need this for proper versioning. # Allows to fetch all history for all branches and tags. Need this for proper versioning.
fetch-depth: 0 fetch-depth: 0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.25' go-version: '1.25'
- name: Build CLI - name: Build CLI
run: make build run: make build
env: env:
GOARCH: ${{ matrix.arch }} GOARCH: ${{ matrix.arch }}
- name: Rename CLI binary - name: Rename CLI binary
run: mv ./bin/neo-go* ./bin/neo-go-${{ matrix.os.bin-name }}-${{ matrix.arch }}${{ (matrix.os.bin-name == 'windows' && '.exe') || '' }} run: mv ./bin/neo-go* ./bin/neo-go-${{ matrix.os.bin-name }}-${{ matrix.arch }}${{ (matrix.os.bin-name == 'windows' && '.exe') || '' }}
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: neo-go-${{ matrix.os.bin-name }}-${{ matrix.arch }} name: neo-go-${{ matrix.os.bin-name }}-${{ matrix.arch }}
path: ./bin/neo-go* path: ./bin/neo-go*
if-no-files-found: error if-no-files-found: error
- name: Attach binary to the release as an asset - name: Attach binary to the release as an asset
if: ${{ github.event_name == 'release' }} if: ${{ github.event_name == 'release' }}
run: gh release upload ${{ github.event.release.tag_name }} ./bin/neo-go-${{ matrix.os.bin-name }}-${{ matrix.arch }}${{ (matrix.os.bin-name == 'windows' && '.exe') || '' }} run: gh release upload ${{ github.event.release.tag_name }} ./bin/neo-go-${{ matrix.os.bin-name }}-${{ matrix.arch }}${{ (matrix.os.bin-name == 'windows' && '.exe') || '' }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_image: build_image:
needs: build_cli needs: build_cli
name: Build and push docker image name: Build and push docker image
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
ref: ${{ github.event.inputs.ref }} ref: ${{ github.event.inputs.ref }}
fetch-depth: 0 fetch-depth: 0
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Login to DockerHub - name: Login to DockerHub
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }} if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }}
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }} password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set vars - name: Set vars
id: setvars id: setvars
run: make gh-docker-vars >> $GITHUB_OUTPUT run: make gh-docker-vars >> $GITHUB_OUTPUT
- name: Set latest tag - name: Set latest tag
id: setlatest id: setlatest
if: ${{ (github.event_name == 'release' && github.event.release.target_commitish == 'master') || (github.event_name == 'workflow_dispatch' && github.event.inputs.use_latest_tag == 'true') }} if: ${{ (github.event_name == 'release' && github.event.release.target_commitish == 'master') || (github.event_name == 'workflow_dispatch' && github.event.inputs.use_latest_tag == 'true') }}
run: echo "latest=,${{ steps.setvars.outputs.repo }}:latest" >> $GITHUB_OUTPUT run: echo "latest=,${{ steps.setvars.outputs.repo }}:latest" >> $GITHUB_OUTPUT
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
push: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }} push: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }}
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
build-args: | build-args: |
REPO=github.com/${{ github.repository }} REPO=github.com/${{ github.repository }}
VERSION=${{ steps.setvars.outputs.version }} VERSION=${{ steps.setvars.outputs.version }}
tags: ${{ steps.setvars.outputs.repo }}:${{ steps.setvars.outputs.version }}${{ steps.setvars.outputs.suffix }}${{ steps.setlatest.outputs.latest }} tags: ${{ steps.setvars.outputs.repo }}:${{ steps.setvars.outputs.version }}${{ steps.setvars.outputs.suffix }}${{ steps.setlatest.outputs.latest }}
build_image_wsc: build_image_wsc:
needs: build_cli needs: build_cli
name: Build and push docker image (Windows Server Core) name: Build and push docker image (Windows Server Core)
runs-on: windows-latest runs-on: windows-latest
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
ref: ${{ github.event.inputs.ref }} ref: ${{ github.event.inputs.ref }}
fetch-depth: 0 fetch-depth: 0
# For proper `deps` make target execution. # For proper `deps` make target execution.
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.25' go-version: '1.25'
- name: Login to DockerHub - name: Login to DockerHub
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }} if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }}
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }} password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build Docker image - name: Build Docker image
run: make image run: make image
- name: Push image to registry - name: Push image to registry
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }} if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }}
run: make image-push run: make image-push

View File

@ -1,197 +1,197 @@
name: Tests name: Tests
on: on:
push: push:
branches: [ master ] branches: [ master ]
pull_request: pull_request:
branches: branches:
- master - master
types: [opened, synchronize] types: [opened, synchronize]
paths-ignore: paths-ignore:
- 'scripts/*.sh' - 'scripts/*.sh'
- '**/*.md' - '**/*.md'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
lint: lint:
name: 'Lint: NeoGo' name: 'Lint: NeoGo'
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master
lint_examples: lint_examples:
name: 'Lint: examples (${{ matrix.contract }})' name: 'Lint: examples (${{ matrix.contract }})'
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
contract: [ 'engine', 'events', 'iterator', 'nft-d', 'nft-nd', 'nft-nd-nns', 'oracle', contract: [ 'engine', 'events', 'iterator', 'nft-d', 'nft-nd', 'nft-nd-nns', 'oracle',
'runtime', 'storage', 'timer', 'token', 'zkp/cubic_circuit', 'zkp/xor_compat'] 'runtime', 'storage', 'timer', 'token', 'zkp/cubic_circuit', 'zkp/xor_compat']
with: with:
workdir: examples/${{ matrix.contract }} workdir: examples/${{ matrix.contract }}
lint_scripts: lint_scripts:
name: 'Lint: scripts' name: 'Lint: scripts'
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master
with: with:
workdir: scripts workdir: scripts
lint_interops: lint_interops:
name: 'Lint: interop' name: 'Lint: interop'
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master
with: with:
workdir: pkg/interop workdir: pkg/interop
gomodcheck: gomodcheck:
name: Check internal dependencies name: Check internal dependencies
runs-on: ubuntu-slim runs-on: ubuntu-slim
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Check dependencies - name: Check dependencies
run: | run: |
./scripts/check_deps.sh ./scripts/check_deps.sh
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version-file: 'go.mod' go-version-file: 'go.mod'
- name: Check go.mod is tidy - name: Check go.mod is tidy
run: | run: |
go mod tidy go mod tidy
if [[ $(git diff --name-only go.* | grep '' -c) != 0 ]]; then if [[ $(git diff --name-only go.* | grep '' -c) != 0 ]]; then
echo "go mod tidy should be executed before the merge, following packages are unused or out of date:"; echo "go mod tidy should be executed before the merge, following packages are unused or out of date:";
git diff go.*; git diff go.*;
exit 1; exit 1;
fi fi
codegencheck: codegencheck:
name: Check code generated with 'go generate' is up-to-date name: Check code generated with 'go generate' is up-to-date
runs-on: ubuntu-slim runs-on: ubuntu-slim
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version-file: 'go.mod' go-version-file: 'go.mod'
- name: Install stringer - name: Install stringer
run: go install golang.org/x/tools/cmd/stringer@latest run: go install golang.org/x/tools/cmd/stringer@latest
- name: Run go generate - name: Run go generate
run: go generate ./... run: go generate ./...
- name: Check that autogenerated code is up-to-date - name: Check that autogenerated code is up-to-date
run: | run: |
if [[ $(git diff --name-only | grep '' -c) != 0 ]]; then if [[ $(git diff --name-only | grep '' -c) != 0 ]]; then
echo "Fresh version of autogenerated code should be committed for the following files:"; echo "Fresh version of autogenerated code should be committed for the following files:";
git diff --name-only; git diff --name-only;
exit 1; exit 1;
fi fi
codeql: codeql:
name: CodeQL name: CodeQL
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
language: [ 'go' ] language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more: # Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v3 uses: github/codeql-action/init@v3
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file. # By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file. # Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main # queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v3 uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell. # Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl # 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project # and modify them (or add more) to build your code if your project
# uses a compiled language # uses a compiled language
#- run: | #- run: |
# make bootstrap # make bootstrap
# make release # make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3 uses: github/codeql-action/analyze@v3
test_cover: test_cover:
name: Coverage name: Coverage
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
CGO_ENABLED: 0 CGO_ENABLED: 0
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: 'true' submodules: 'true'
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.25' go-version: '1.25'
cache: true cache: true
- name: Write coverage profile - name: Write coverage profile
run: DISABLE_NEOTEST_COVER=1 go test -timeout 15m -v ./... -coverprofile=./coverage.txt -covermode=atomic -coverpkg=./pkg...,./cli/... run: DISABLE_NEOTEST_COVER=1 go test -timeout 15m -v ./... -coverprofile=./coverage.txt -covermode=atomic -coverpkg=./pkg...,./cli/...
- name: Upload coverage results to Codecov - name: Upload coverage results to Codecov
uses: codecov/codecov-action@v4 uses: codecov/codecov-action@v4
with: with:
fail_ci_if_error: true # if something is wrong on uploading codecov results, then this job will fail fail_ci_if_error: true # if something is wrong on uploading codecov results, then this job will fail
files: ./coverage.txt files: ./coverage.txt
slug: nspcc-dev/neo-go slug: nspcc-dev/neo-go
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
verbose: true verbose: true
tests: tests:
name: Run tests name: Run tests
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
go_versions: [ '1.24', '1.25' ] go_versions: [ '1.24', '1.25' ]
exclude: exclude:
# Only latest Go version for Windows and MacOS. # Only latest Go version for Windows and MacOS.
- os: windows-latest - os: windows-latest
go_versions: '1.24' go_versions: '1.24'
- os: macos-latest - os: macos-latest
go_versions: '1.24' go_versions: '1.24'
# Exclude latest Go version for Ubuntu as Coverage uses it. # Exclude latest Go version for Ubuntu as Coverage uses it.
- os: ubuntu-latest - os: ubuntu-latest
go_versions: '1.25' go_versions: '1.25'
fail-fast: false fail-fast: false
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: 'true' submodules: 'true'
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '${{ matrix.go_versions }}' go-version: '${{ matrix.go_versions }}'
- name: Run tests - name: Run tests
run: go test -timeout 15m -v -race ./... run: go test -timeout 15m -v -race ./...

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2
cli/smartcontract/testdata/deploy/update.manifest.json vendored Executable file → Normal file
View File

@ -1 +1 @@
{"name":"Test deploy","abi":{"methods":[{"name":"_initialize","offset":0,"parameters":[],"returntype":"Void","safe":false},{"name":"_deploy","offset":15,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"checkSenderWitness","offset":201,"parameters":[],"returntype":"Void","safe":false},{"name":"fail","offset":186,"parameters":[],"returntype":"Void","safe":false},{"name":"getValueUpdated","offset":294,"parameters":[],"returntype":"String","safe":false},{"name":"getValueWithKey","offset":343,"parameters":[{"name":"key","type":"String"}],"returntype":"String","safe":false},{"name":"testFind","offset":368,"parameters":[{"name":"f","type":"InteropInterface"}],"returntype":"Array","safe":false},{"name":"update","offset":238,"parameters":[{"name":"script","type":"ByteArray"},{"name":"manifest","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"0xfffdc93764dbaddd97c48f252a53ea4643faa3fd","methods":["update"]}],"supportedstandards":[],"trusts":[],"extra":null} {"name":"Test deploy","abi":{"methods":[{"name":"_initialize","offset":0,"parameters":[],"returntype":"Void","safe":false},{"name":"_deploy","offset":15,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"checkSenderWitness","offset":201,"parameters":[],"returntype":"Void","safe":false},{"name":"fail","offset":186,"parameters":[],"returntype":"Void","safe":false},{"name":"getValueUpdated","offset":294,"parameters":[],"returntype":"String","safe":false},{"name":"getValueWithKey","offset":343,"parameters":[{"name":"key","type":"String"}],"returntype":"String","safe":false},{"name":"testFind","offset":368,"parameters":[{"name":"f","type":"InteropInterface"}],"returntype":"Array","safe":false},{"name":"update","offset":238,"parameters":[{"name":"script","type":"ByteArray"},{"name":"manifest","type":"ByteArray"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"0xfffdc93764dbaddd97c48f252a53ea4643faa3fd","methods":["update"]}],"supportedstandards":[],"trusts":[],"extra":null}

594
cli/smartcontract/testdata/verify.bindings.yml vendored Executable file → Normal file
View File

@ -1,297 +1,297 @@
package: testdata package: testdata
hash: "0x0000000000000000000000000000000000000000" hash: "0x0000000000000000000000000000000000000000"
overrides: overrides:
burnGas.gas: int burnGas.gas: int
call: any call: any
call.args: '[]any' call.args: '[]any'
call.f: any call.f: any
call.method: string call.method: string
call.scriptHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash160 call.scriptHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash160
callWithToken: any callWithToken: any
callWithToken.args: '[]any' callWithToken.args: '[]any'
callWithToken.flags: int callWithToken.flags: int
callWithToken.method: string callWithToken.method: string
callWithToken.scriptHash: string callWithToken.scriptHash: string
callWithTokenNoRet.args: '[]any' callWithTokenNoRet.args: '[]any'
callWithTokenNoRet.flags: int callWithTokenNoRet.flags: int
callWithTokenNoRet.method: string callWithTokenNoRet.method: string
callWithTokenNoRet.scriptHash: string callWithTokenNoRet.scriptHash: string
checkWitness: bool checkWitness: bool
checkWitness.hashOrKey: '[]byte' checkWitness.hashOrKey: '[]byte'
createMultisigAccount: '[]byte' createMultisigAccount: '[]byte'
createMultisigAccount.m: int createMultisigAccount.m: int
createMultisigAccount.pubs: '[]github.com/tutus-one/tutus-chain/pkg/interop.PublicKey' createMultisigAccount.pubs: '[]github.com/tutus-one/tutus-chain/pkg/interop.PublicKey'
createStandardAccount: '[]byte' createStandardAccount: '[]byte'
createStandardAccount.pub: github.com/tutus-one/tutus-chain/pkg/interop.PublicKey createStandardAccount.pub: github.com/tutus-one/tutus-chain/pkg/interop.PublicKey
currentHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256 currentHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256
currentIndex: int currentIndex: int
currentSigners: '[]github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.TransactionSigner' currentSigners: '[]github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.TransactionSigner'
equals: bool equals: bool
equals.b: any equals.b: any
gasLeft: int gasLeft: int
getAddressVersion: int getAddressVersion: int
getBlock: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.Block' getBlock: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.Block'
getBlock.indexOrHash: any getBlock.indexOrHash: any
getCallFlags: any getCallFlags: any
getCallingScriptHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash160 getCallingScriptHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash160
getEntryScriptHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash160 getEntryScriptHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash160
getExecutingScriptHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash160 getExecutingScriptHash: github.com/tutus-one/tutus-chain/pkg/interop.Hash160
getInvocationCounter: int getInvocationCounter: int
getNetwork: int getNetwork: int
getNotifications: '[][]any' getNotifications: '[][]any'
getNotifications.h: github.com/tutus-one/tutus-chain/pkg/interop.Hash160 getNotifications.h: github.com/tutus-one/tutus-chain/pkg/interop.Hash160
getRandom: int getRandom: int
getScriptContainer: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.Transaction' getScriptContainer: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.Transaction'
getTime: int getTime: int
getTransaction: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.Transaction' getTransaction: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.Transaction'
getTransaction.hash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256 getTransaction.hash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256
getTransactionFromBlock: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.Transaction' getTransactionFromBlock: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.Transaction'
getTransactionFromBlock.indexOrHash: any getTransactionFromBlock.indexOrHash: any
getTransactionFromBlock.txIndex: int getTransactionFromBlock.txIndex: int
getTransactionHeight: int getTransactionHeight: int
getTransactionHeight.hash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256 getTransactionHeight.hash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256
getTransactionSigners: '[]github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.TransactionSigner' getTransactionSigners: '[]github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.TransactionSigner'
getTransactionSigners.hash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256 getTransactionSigners.hash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256
getTransactionVMState: int getTransactionVMState: int
getTransactionVMState.hash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256 getTransactionVMState.hash: github.com/tutus-one/tutus-chain/pkg/interop.Hash256
getTrigger: int getTrigger: int
loadScript: any loadScript: any
loadScript.args: '[]any' loadScript.args: '[]any'
loadScript.f: any loadScript.f: any
loadScript.script: '[]byte' loadScript.script: '[]byte'
log.message: string log.message: string
notify.args: '[]any' notify.args: '[]any'
notify.name: string notify.name: string
onNEP11Payment.amount: int onNEP11Payment.amount: int
onNEP11Payment.data: any onNEP11Payment.data: any
onNEP11Payment.from: github.com/tutus-one/tutus-chain/pkg/interop.Hash160 onNEP11Payment.from: github.com/tutus-one/tutus-chain/pkg/interop.Hash160
onNEP11Payment.token: '[]byte' onNEP11Payment.token: '[]byte'
onNEP17Payment.amount: int onNEP17Payment.amount: int
onNEP17Payment.data: any onNEP17Payment.data: any
onNEP17Payment.from: github.com/tutus-one/tutus-chain/pkg/interop.Hash160 onNEP17Payment.from: github.com/tutus-one/tutus-chain/pkg/interop.Hash160
opcode0NoReturn.op: string opcode0NoReturn.op: string
opcode1: any opcode1: any
opcode1NoReturn.arg: any opcode1NoReturn.arg: any
opcode1NoReturn.op: string opcode1NoReturn.op: string
opcode1.arg: any opcode1.arg: any
opcode1.op: string opcode1.op: string
opcode2: any opcode2: any
opcode2NoReturn.arg1: any opcode2NoReturn.arg1: any
opcode2NoReturn.arg2: any opcode2NoReturn.arg2: any
opcode2NoReturn.op: string opcode2NoReturn.op: string
opcode2.arg1: any opcode2.arg1: any
opcode2.arg2: any opcode2.arg2: any
opcode2.op: string opcode2.op: string
opcode3: any opcode3: any
opcode3.arg1: any opcode3.arg1: any
opcode3.arg2: any opcode3.arg2: any
opcode3.arg3: any opcode3.arg3: any
opcode3.op: string opcode3.op: string
platform: '[]byte' platform: '[]byte'
syscall0: any syscall0: any
syscall0NoReturn.name: string syscall0NoReturn.name: string
syscall0.name: string syscall0.name: string
syscall1: any syscall1: any
syscall1NoReturn.arg: any syscall1NoReturn.arg: any
syscall1NoReturn.name: string syscall1NoReturn.name: string
syscall1.arg: any syscall1.arg: any
syscall1.name: string syscall1.name: string
syscall2: any syscall2: any
syscall2NoReturn.arg1: any syscall2NoReturn.arg1: any
syscall2NoReturn.arg2: any syscall2NoReturn.arg2: any
syscall2NoReturn.name: string syscall2NoReturn.name: string
syscall2.arg1: any syscall2.arg1: any
syscall2.arg2: any syscall2.arg2: any
syscall2.name: string syscall2.name: string
syscall3: any syscall3: any
syscall3NoReturn.arg1: any syscall3NoReturn.arg1: any
syscall3NoReturn.arg2: any syscall3NoReturn.arg2: any
syscall3NoReturn.arg3: any syscall3NoReturn.arg3: any
syscall3NoReturn.name: string syscall3NoReturn.name: string
syscall3.arg1: any syscall3.arg1: any
syscall3.arg2: any syscall3.arg2: any
syscall3.arg3: any syscall3.arg3: any
syscall3.name: string syscall3.name: string
syscall4: any syscall4: any
syscall4NoReturn.arg1: any syscall4NoReturn.arg1: any
syscall4NoReturn.arg2: any syscall4NoReturn.arg2: any
syscall4NoReturn.arg3: any syscall4NoReturn.arg3: any
syscall4NoReturn.arg4: any syscall4NoReturn.arg4: any
syscall4NoReturn.name: string syscall4NoReturn.name: string
syscall4.arg1: any syscall4.arg1: any
syscall4.arg2: any syscall4.arg2: any
syscall4.arg3: any syscall4.arg3: any
syscall4.arg4: any syscall4.arg4: any
syscall4.name: string syscall4.name: string
toBlockSR: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.BlockSR' toBlockSR: '*github.com/tutus-one/tutus-chain/pkg/interop/native/ledger.BlockSR'
verify: bool verify: bool
namedtypes: namedtypes:
ledger.Block: ledger.Block:
base: Array base: Array
name: ledger.Block name: ledger.Block
fields: fields:
- field: Hash - field: Hash
base: Hash256 base: Hash256
- field: Version - field: Version
base: Integer base: Integer
- field: PrevHash - field: PrevHash
base: Hash256 base: Hash256
- field: MerkleRoot - field: MerkleRoot
base: Hash256 base: Hash256
- field: Timestamp - field: Timestamp
base: Integer base: Integer
- field: Nonce - field: Nonce
base: Integer base: Integer
- field: Index - field: Index
base: Integer base: Integer
- field: NextConsensus - field: NextConsensus
base: Hash160 base: Hash160
- field: TransactionsLength - field: TransactionsLength
base: Integer base: Integer
ledger.BlockSR: ledger.BlockSR:
base: Array base: Array
name: ledger.BlockSR name: ledger.BlockSR
fields: fields:
- field: Hash - field: Hash
base: Hash256 base: Hash256
- field: Version - field: Version
base: Integer base: Integer
- field: PrevHash - field: PrevHash
base: Hash256 base: Hash256
- field: MerkleRoot - field: MerkleRoot
base: Hash256 base: Hash256
- field: Timestamp - field: Timestamp
base: Integer base: Integer
- field: Nonce - field: Nonce
base: Integer base: Integer
- field: Index - field: Index
base: Integer base: Integer
- field: NextConsensus - field: NextConsensus
base: Hash160 base: Hash160
- field: TransactionsLength - field: TransactionsLength
base: Integer base: Integer
- field: PrevStateRoot - field: PrevStateRoot
base: Hash256 base: Hash256
ledger.Transaction: ledger.Transaction:
base: Array base: Array
name: ledger.Transaction name: ledger.Transaction
fields: fields:
- field: Hash - field: Hash
base: Hash256 base: Hash256
- field: Version - field: Version
base: Integer base: Integer
- field: Nonce - field: Nonce
base: Integer base: Integer
- field: Sender - field: Sender
base: Hash160 base: Hash160
- field: SysFee - field: SysFee
base: Integer base: Integer
- field: NetFee - field: NetFee
base: Integer base: Integer
- field: ValidUntilBlock - field: ValidUntilBlock
base: Integer base: Integer
- field: Script - field: Script
base: ByteArray base: ByteArray
ledger.TransactionSigner: ledger.TransactionSigner:
base: Array base: Array
name: ledger.TransactionSigner name: ledger.TransactionSigner
fields: fields:
- field: Account - field: Account
base: Hash160 base: Hash160
- field: Scopes - field: Scopes
base: Integer base: Integer
- field: AllowedContracts - field: AllowedContracts
base: Array base: Array
value: value:
base: Hash160 base: Hash160
- field: AllowedGroups - field: AllowedGroups
base: Array base: Array
value: value:
base: PublicKey base: PublicKey
- field: Rules - field: Rules
base: Array base: Array
value: value:
base: Array base: Array
name: ledger.WitnessRule name: ledger.WitnessRule
ledger.WitnessCondition: ledger.WitnessCondition:
base: Array base: Array
name: ledger.WitnessCondition name: ledger.WitnessCondition
fields: fields:
- field: Type - field: Type
base: Integer base: Integer
- field: Value - field: Value
base: Any base: Any
ledger.WitnessRule: ledger.WitnessRule:
base: Array base: Array
name: ledger.WitnessRule name: ledger.WitnessRule
fields: fields:
- field: Action - field: Action
base: Integer base: Integer
- field: Condition - field: Condition
base: Array base: Array
name: ledger.WitnessCondition name: ledger.WitnessCondition
types: types:
call.args: call.args:
base: Array base: Array
value: value:
base: Any base: Any
call.f: call.f:
base: InteropInterface base: InteropInterface
interface: iterator interface: iterator
callWithToken.args: callWithToken.args:
base: Array base: Array
value: value:
base: Any base: Any
callWithTokenNoRet.args: callWithTokenNoRet.args:
base: Array base: Array
value: value:
base: Any base: Any
createMultisigAccount.pubs: createMultisigAccount.pubs:
base: Array base: Array
value: value:
base: PublicKey base: PublicKey
currentSigners: currentSigners:
base: Array base: Array
value: value:
base: Array base: Array
name: ledger.TransactionSigner name: ledger.TransactionSigner
getBlock: getBlock:
base: Array base: Array
name: ledger.Block name: ledger.Block
getCallFlags: getCallFlags:
base: InteropInterface base: InteropInterface
interface: iterator interface: iterator
getNotifications: getNotifications:
base: Array base: Array
value: value:
base: Array base: Array
value: value:
base: Any base: Any
getScriptContainer: getScriptContainer:
base: Array base: Array
name: ledger.Transaction name: ledger.Transaction
getTransaction: getTransaction:
base: Array base: Array
name: ledger.Transaction name: ledger.Transaction
getTransactionFromBlock: getTransactionFromBlock:
base: Array base: Array
name: ledger.Transaction name: ledger.Transaction
getTransactionSigners: getTransactionSigners:
base: Array base: Array
value: value:
base: Array base: Array
name: ledger.TransactionSigner name: ledger.TransactionSigner
loadScript.args: loadScript.args:
base: Array base: Array
value: value:
base: Any base: Any
loadScript.f: loadScript.f:
base: InteropInterface base: InteropInterface
interface: iterator interface: iterator
notify.args: notify.args:
base: Array base: Array
value: value:
base: Any base: Any
toBlockSR: toBlockSR:
base: Array base: Array
name: ledger.BlockSR name: ledger.BlockSR

2
cli/smartcontract/testdata/verify.manifest.json vendored Executable file → Normal file
View File

@ -1 +1 @@
{"name":"verify","abi":{"methods":[{"name":"verify","offset":0,"parameters":[],"returntype":"Boolean","safe":false},{"name":"onNEP17Payment","offset":5,"parameters":[{"name":"from","type":"ByteArray"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false}],"events":[{"name":"Hello world!","parameters":[{"name":"args","type":"Array"}]}]},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null,"features":{}} {"name":"verify","abi":{"methods":[{"name":"verify","offset":0,"parameters":[],"returntype":"Boolean","safe":false},{"name":"onNEP17Payment","offset":5,"parameters":[{"name":"from","type":"ByteArray"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false}],"events":[{"name":"Hello world!","parameters":[{"name":"args","type":"Array"}]}]},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null,"features":{}}

0
cli/smartcontract/testdata/verify.nef vendored Executable file → Normal file
View File

160
cli/smartcontract/testdata/verifyrpc/verify.manifest.json vendored Executable file → Normal file
View File

@ -1,80 +1,80 @@
{ {
"groups" : [], "groups" : [],
"extra" : null, "extra" : null,
"supportedstandards" : [], "supportedstandards" : [],
"name" : "verify", "name" : "verify",
"trusts" : [], "trusts" : [],
"features": {}, "features": {},
"permissions" : [ "permissions" : [
{ {
"methods" : "*", "methods" : "*",
"contract" : "*" "contract" : "*"
} }
], ],
"abi" : { "abi" : {
"methods" : [ "methods" : [
{ {
"safe" : false, "safe" : false,
"offset" : 0, "offset" : 0,
"parameters" : [], "parameters" : [],
"name" : "verify", "name" : "verify",
"returntype" : "Boolean" "returntype" : "Boolean"
}, },
{ {
"returntype" : "Void", "returntype" : "Void",
"safe" : false, "safe" : false,
"offset" : 5, "offset" : 5,
"parameters" : [ "parameters" : [
{ {
"type" : "Hash160", "type" : "Hash160",
"name" : "from" "name" : "from"
}, },
{ {
"type" : "Integer", "type" : "Integer",
"name" : "amount" "name" : "amount"
}, },
{ {
"type" : "Any", "type" : "Any",
"name" : "data" "name" : "data"
} }
], ],
"name" : "onNEP17Payment" "name" : "onNEP17Payment"
}, },
{ {
"returntype" : "Void", "returntype" : "Void",
"safe" : false, "safe" : false,
"offset" : 5, "offset" : 5,
"parameters" : [ "parameters" : [
{ {
"type" : "Hash160", "type" : "Hash160",
"name" : "from" "name" : "from"
}, },
{ {
"type" : "Integer", "type" : "Integer",
"name" : "amount" "name" : "amount"
}, },
{ {
"type" : "ByteArray", "type" : "ByteArray",
"name" : "tokenId" "name" : "tokenId"
}, },
{ {
"type" : "Any", "type" : "Any",
"name" : "data" "name" : "data"
} }
], ],
"name" : "onNEP11Payment" "name" : "onNEP11Payment"
} }
], ],
"events" : [ "events" : [
{ {
"parameters" : [ "parameters" : [
{ {
"type" : "Array", "type" : "Array",
"name" : "args" "name" : "args"
} }
], ],
"name" : "Hello world!" "name" : "Hello world!"
} }
] ]
} }
} }

70
scripts/check_deps.sh Executable file → Normal file
View File

@ -1,35 +1,35 @@
#!/bin/sh #!/bin/sh
die() { die() {
echo "$*" echo "$*"
exit 1 exit 1
} }
find -name go.mod -print0 | find -name go.mod -print0 |
xargs -0 -n1 grep -o 'pkg/interop v\S*' | xargs -0 -n1 grep -o 'pkg/interop v\S*' |
uniq | wc -l | uniq | wc -l |
xargs -I{} -n1 [ 1 -eq {} ] || xargs -I{} -n1 [ 1 -eq {} ] ||
die "Different versions for dependencies in go.mod" die "Different versions for dependencies in go.mod"
INTEROP_COMMIT="$(sed -E -n -e 's/.*pkg\/interop.+-.+-(\w+)/\1/ p' go.mod)" INTEROP_COMMIT="$(sed -E -n -e 's/.*pkg\/interop.+-.+-(\w+)/\1/ p' go.mod)"
git merge-base --is-ancestor "$INTEROP_COMMIT" HEAD || git merge-base --is-ancestor "$INTEROP_COMMIT" HEAD ||
die "pkg/interop commit $INTEROP_COMMIT was not found in git" die "pkg/interop commit $INTEROP_COMMIT was not found in git"
for dir in examples/*/; do for dir in examples/*/; do
if [ -z "${dir#*zkp/}" ]; then if [ -z "${dir#*zkp/}" ]; then
continue continue
fi fi
INTEROP_COMMIT="$(sed -E -n -e 's/.*pkg\/interop.+-.+-(\w+)/\1/ p' "$dir/go.mod")" INTEROP_COMMIT="$(sed -E -n -e 's/.*pkg\/interop.+-.+-(\w+)/\1/ p' "$dir/go.mod")"
git merge-base --is-ancestor "$INTEROP_COMMIT" HEAD || git merge-base --is-ancestor "$INTEROP_COMMIT" HEAD ||
die "$dir: pkg/interop commit $INTEROP_COMMIT was not found in git" die "$dir: pkg/interop commit $INTEROP_COMMIT was not found in git"
if [ -z "${dir#*nft-nd-nns/}" ]; then if [ -z "${dir#*nft-nd-nns/}" ]; then
NEO_GO_COMMIT="$(sed -E -n -e 's/.*neo-go\s.+-.+-(\w+)/\1/ p' "$dir/go.mod")" NEO_GO_COMMIT="$(sed -E -n -e 's/.*neo-go\s.+-.+-(\w+)/\1/ p' "$dir/go.mod")"
if [ -z "$NEO_GO_COMMIT" ]; then if [ -z "$NEO_GO_COMMIT" ]; then
NEO_GO_COMMIT="$(sed -E -n -e 's/.*neo-go\s(\w+)/\1/ p' "$dir/go.mod")" NEO_GO_COMMIT="$(sed -E -n -e 's/.*neo-go\s(\w+)/\1/ p' "$dir/go.mod")"
fi fi
git merge-base --is-ancestor "$NEO_GO_COMMIT" HEAD || git merge-base --is-ancestor "$NEO_GO_COMMIT" HEAD ||
die "$dir: neo-go commit $NEO_GO_COMMIT was not found in git" die "$dir: neo-go commit $NEO_GO_COMMIT was not found in git"
fi fi
done done

58
scripts/update_deps.sh Executable file → Normal file
View File

@ -1,29 +1,29 @@
#!/bin/sh #!/bin/sh
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo "Usage: ./update_deps.sh <revision>" echo "Usage: ./update_deps.sh <revision>"
exit 1 exit 1
fi fi
REV="$1" REV="$1"
root="$(git rev-parse --show-toplevel)" root="$(git rev-parse --show-toplevel)"
cd "$root" || exit 1 cd "$root" || exit 1
go get github.com/nspcc-dev/neo-go/pkg/interop@"$REV" go get github.com/nspcc-dev/neo-go/pkg/interop@"$REV"
go mod tidy go mod tidy
for dir in "$root"/examples/*/; do for dir in "$root"/examples/*/; do
cd "$dir" || exit 1 cd "$dir" || exit 1
go get github.com/nspcc-dev/neo-go/pkg/interop@"$REV" go get github.com/nspcc-dev/neo-go/pkg/interop@"$REV"
go mod tidy go mod tidy
done done
for dir in "$root"/examples/zkp/*/; do for dir in "$root"/examples/zkp/*/; do
cd "$dir" || exit 1 cd "$dir" || exit 1
go get github.com/nspcc-dev/neo-go/pkg/interop@"$REV" go get github.com/nspcc-dev/neo-go/pkg/interop@"$REV"
go mod tidy go mod tidy
done done
cd "$root"/internal/contracts/oracle_contract || exit 1 cd "$root"/internal/contracts/oracle_contract || exit 1
go get github.com/nspcc-dev/neo-go/pkg/interop@"$REV" go get github.com/nspcc-dev/neo-go/pkg/interop@"$REV"
go mod tidy go mod tidy