From b188e38cf52dc9a0ffbd4e98117089475ddb2c6a Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 10 Nov 2023 11:35:43 +0300 Subject: [PATCH 1/3] go.mod: upgrade to Go 1.19+ Closes #352. Signed-off-by: Roman Khimov --- .github/workflows/go.yml | 8 ++++---- go.mod | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1eccd1b3..08ebd9e0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_versions: [ '1.18', '1.19', '1.20' ] + go_versions: [ '1.19', '1.20', '1.21' ] fail-fast: false steps: - uses: actions/checkout@v3 @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_versions: [ '1.18', '1.19', '1.20' ] + go_versions: [ '1.19', '1.20', '1.21' ] fail-fast: false steps: - uses: actions/checkout@v3 @@ -60,7 +60,7 @@ jobs: run: make build - name: Check that fresh version of RPC bindings is committed (for minimum supported Go version only) - if: ${{ matrix.go_versions == '1.18' }} + if: ${{ matrix.go_versions == '1.19' }} run: | if [[ $(git diff --name-only | grep '^rpc/*' -c) != 0 ]]; then echo "Fresh version of RPC bindings should be committed for the following contracts:"; diff --git a/go.mod b/go.mod index a44e8af0..41124019 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nspcc-dev/neofs-contract -go 1.18 +go 1.19 require ( github.com/google/uuid v1.3.0 From 986c89c786fe2adc9162b319ca1e564308f4148a Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 9 Nov 2023 23:30:23 +0300 Subject: [PATCH 2/3] *: upgrade to NeoGo 0.103.1 Update dependencies and regenerate bindings to have better syntax as well. Signed-off-by: Roman Khimov --- Makefile | 2 +- go.mod | 33 +-- go.sum | 87 ++++---- rpc/alphabet/rpcbinding.go | 298 ++++++++++++------------- rpc/audit/rpcbinding.go | 308 +++++++++++++------------- rpc/balance/rpcbinding.go | 352 ++++++++++++++--------------- rpc/container/rpcbinding.go | 358 +++++++++++++++--------------- rpc/neofs/rpcbinding.go | 416 ++++++++++++++++++----------------- rpc/neofsid/rpcbinding.go | 304 ++++++++++++------------- rpc/netmap/rpcbinding.go | 378 +++++++++++++++---------------- rpc/nns/rpcbinding.go | 318 +++++++++++++------------- rpc/processing/rpcbinding.go | 298 ++++++++++++------------- rpc/proxy/rpcbinding.go | 298 ++++++++++++------------- rpc/reputation/rpcbinding.go | 298 ++++++++++++------------- 14 files changed, 1888 insertions(+), 1860 deletions(-) diff --git a/Makefile b/Makefile index d332efda..b657303e 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ export GOBIN ?= $(shell pwd)/bin export CGO_ENABLED=0 NEOGO ?= $(GOBIN)/cli VERSION ?= $(shell git describe --tags --dirty --match "v*" --always --abbrev=8 2>/dev/null || cat VERSION 2>/dev/null || echo "develop") -NEOGOORIGMOD = github.com/nspcc-dev/neo-go@v0.102.0 +NEOGOORIGMOD = github.com/nspcc-dev/neo-go@v0.103.1 NEOGOMOD = $(shell go list -f '{{.Path}}' -m $(NEOGOORIGMOD)) NEOGOVER = $(shell go list -f '{{.Version}}' -m $(NEOGOORIGMOD) | tr -d v) diff --git a/go.mod b/go.mod index 41124019..451f5119 100644 --- a/go.mod +++ b/go.mod @@ -3,24 +3,26 @@ module github.com/nspcc-dev/neofs-contract go 1.19 require ( - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.3.1 github.com/mr-tron/base58 v1.2.0 - github.com/nspcc-dev/neo-go v0.102.0 - github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230919154019-f66abd020d6a - github.com/stretchr/testify v1.8.2 + github.com/nspcc-dev/neo-go v0.103.1 + github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5 + github.com/stretchr/testify v1.8.4 ) require ( github.com/benbjohnson/clock v1.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.9.1 // indirect + github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.1 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/hashicorp/golang-lru v0.6.0 // indirect github.com/holiman/uint256 v1.2.0 // indirect @@ -33,6 +35,7 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect @@ -42,14 +45,16 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.9.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.4.0 // indirect - golang.org/x/mod v0.6.0 // indirect - golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect - golang.org/x/tools v0.2.0 // indirect - google.golang.org/protobuf v1.28.1 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 372a0a44..d7b39195 100644 --- a/go.sum +++ b/go.sum @@ -45,21 +45,23 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.9.1 h1:mru55qKdWl3E035hAoh1jj9d7hVnYY5pfb6tmovSmII= -github.com/consensys/gnark-crypto v0.9.1/go.mod h1:a2DQL4+5ywF6safEeZFEPGRiiGbjzGFRUN2sg06VuU4= +github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb h1:f0BMgIjhZy4lSRHCXFbQst85f5agZAjtDMixQqBWNpc= +github.com/consensys/gnark-crypto v0.12.2-0.20231013160410-1f65e75b6dfb/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -114,8 +116,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -129,7 +132,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -142,8 +146,8 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= @@ -170,8 +174,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -194,15 +198,13 @@ github.com/nspcc-dev/dbft v0.0.0-20230515113611-25db6ba61d5c h1:uyK5aLbAhrnZtnvo github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22 h1:n4ZaFCKt1pQJd7PXoMJabZWK9ejjbLOVrkl/lOUmshg= github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U= github.com/nspcc-dev/hrw v1.0.9 h1:17VcAuTtrstmFppBjfRiia4K2wA/ukXZhLFS8Y8rz5Y= -github.com/nspcc-dev/neo-go v0.102.0 h1:O2Gt4JPOWmp0c+PnPWwd2wPI74BKSwkaNCEyvyQTWJw= -github.com/nspcc-dev/neo-go v0.102.0/go.mod h1:QXxpZxJT2KedwM0Nlj8UO0/fZN2WIe4h/i03uBHKbnc= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230810094130-11bb733f1a2c h1:upj+XyoI0dS7CYnZOTAeyuznhvDIJurQXL4FvHNKyl4= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230810094130-11bb733f1a2c/go.mod h1:ZUuXOkdtHZgaC13za/zMgXfQFncZ0jLzfQTe+OsDOtg= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230919154019-f66abd020d6a h1:ZF1T2PfRJh0LbQcMQAPMmp94B27o/6DKZV+zcMIUNHM= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230919154019-f66abd020d6a/go.mod h1:ZUuXOkdtHZgaC13za/zMgXfQFncZ0jLzfQTe+OsDOtg= +github.com/nspcc-dev/neo-go v0.103.1 h1:BfRBceHUu8jSc1KQy7CzmQ/pa+xzAmgcyteGf0/IGgM= +github.com/nspcc-dev/neo-go v0.103.1/go.mod h1:MD7MPiyshUwrE5n1/LzxeandbItaa/iLW/bJb6gNs/U= +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5 h1:09CpI5uwsxb1EeFPIKQRwwWlfCmDD/Dwwh01lPiQScM= +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag= github.com/nspcc-dev/neofs-api-go/v2 v2.14.0 h1:jhuN8Ldqz7WApvUJRFY0bjRXE1R3iCkboMX5QVZhHVk= github.com/nspcc-dev/neofs-crypto v0.4.0 h1:5LlrUAM5O0k1+sH/sktBtrgfWtq1pgpDs09fZo+KYi4= -github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.9 h1:uIQlWUUo5n/e8rLFGm14zIValcpXU1HWuwaoXUAHt5Q= +github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.11 h1:QOc8ZRN5DXlAeRPh5QG9u8rMLgoeRNiZF5/vL7QupWg= github.com/nspcc-dev/rfc6979 v0.2.0 h1:3e1WNxrN60/6N0DW7+UYisLeZJyfqZTNOjeV/toYvOE= github.com/nspcc-dev/rfc6979 v0.2.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= github.com/nspcc-dev/tzhash v1.7.0 h1:/+aL33NC7y5OIGnY2kYgjZt8mg7LVGFMdj/KAJLndnk= @@ -248,6 +250,8 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -258,15 +262,11 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 h1:xQdMZ1WLrgkkvOZ/LDQxjVxMLdby7osSh4ZEVa5sIjs= github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/twmb/murmur3 v1.1.5 h1:i9OLS9fkuLzBXjt6dptlAEyk58fJsSTXbRg3SgVyqgk= @@ -298,8 +298,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= -golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -310,7 +310,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20221227203929-1b447090c38c h1:Govq2W3bnHJimHT2ium65kXcI7ZzTniZHcFATnLJM0Q= +golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -331,8 +331,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -367,7 +367,7 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -385,8 +385,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -431,12 +431,12 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -444,8 +444,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -489,8 +489,8 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E= +golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -547,7 +547,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -560,7 +561,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -573,13 +575,13 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -591,7 +593,6 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/rpc/alphabet/rpcbinding.go b/rpc/alphabet/rpcbinding.go index 8768701e..a110a889 100644 --- a/rpc/alphabet/rpcbinding.go +++ b/rpc/alphabet/rpcbinding.go @@ -1,4 +1,6 @@ // Package alphabet contains RPC wrappers for NeoFS Alphabet contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package alphabet import ( @@ -17,89 +19,89 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -111,23 +113,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -139,7 +141,7 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // Invoker is used by ContractReader to call various safe methods. @@ -162,14 +164,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -291,7 +293,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -300,14 +302,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -317,13 +319,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -360,10 +362,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -373,7 +375,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -385,7 +387,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -395,13 +397,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -411,7 +413,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -435,7 +437,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -445,7 +447,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -482,10 +484,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -495,7 +497,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -507,7 +509,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -517,13 +519,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -533,7 +535,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -557,7 +559,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -567,7 +569,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -579,7 +581,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -589,7 +591,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -620,10 +622,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -633,7 +635,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -651,7 +653,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -661,7 +663,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -716,10 +718,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -729,7 +731,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -741,14 +743,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -758,26 +760,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -787,19 +789,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -812,7 +814,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -843,7 +845,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -883,7 +885,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -923,10 +925,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -939,13 +941,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -958,7 +960,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -989,7 +991,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -1004,7 +1006,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1014,7 +1016,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1057,10 +1059,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1069,13 +1071,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1088,7 +1090,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1119,10 +1121,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1132,7 +1134,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1169,10 +1171,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1181,13 +1183,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1200,20 +1202,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1222,11 +1224,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1235,27 +1237,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1264,13 +1266,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1282,7 +1284,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1295,20 +1297,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1318,13 +1320,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1361,10 +1363,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1373,13 +1375,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1392,7 +1394,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1441,10 +1443,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1453,7 +1455,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1490,10 +1492,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1503,20 +1505,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1525,13 +1527,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } diff --git a/rpc/audit/rpcbinding.go b/rpc/audit/rpcbinding.go index 7748c1df..d313338e 100644 --- a/rpc/audit/rpcbinding.go +++ b/rpc/audit/rpcbinding.go @@ -1,4 +1,6 @@ // Package audit contains RPC wrappers for NeoFS Audit contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package audit import ( @@ -18,95 +20,95 @@ import ( // AuditAuditHeader is a contract-specific audit.AuditHeader type used by its methods. type AuditAuditHeader struct { Epoch *big.Int - CID []byte - From *keys.PublicKey + CID []byte + From *keys.PublicKey } // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -118,23 +120,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -146,7 +148,7 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // Invoker is used by ContractReader to call various safe methods. @@ -169,14 +171,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -286,7 +288,7 @@ func (res *AuditAuditHeader) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Epoch, err = arr[index].TryInteger() @@ -301,7 +303,7 @@ func (res *AuditAuditHeader) FromStackItem(item stackitem.Item) error { } index++ - res.From, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.From, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -311,7 +313,7 @@ func (res *AuditAuditHeader) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field From: %w", err) } @@ -342,7 +344,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -351,14 +353,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -368,13 +370,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -411,10 +413,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -424,7 +426,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -436,7 +438,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -446,13 +448,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -462,7 +464,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -486,7 +488,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -496,7 +498,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -533,10 +535,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -546,7 +548,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -558,7 +560,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -568,13 +570,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -584,7 +586,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -608,7 +610,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -618,7 +620,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -630,7 +632,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -640,7 +642,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -671,10 +673,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -684,7 +686,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -702,7 +704,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -712,7 +714,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -767,10 +769,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -780,7 +782,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -792,14 +794,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -809,26 +811,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -838,19 +840,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -863,7 +865,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -894,7 +896,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -934,7 +936,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -974,10 +976,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -990,13 +992,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1009,7 +1011,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -1040,7 +1042,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -1055,7 +1057,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1065,7 +1067,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1108,10 +1110,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1120,13 +1122,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1139,7 +1141,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1170,10 +1172,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1183,7 +1185,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1220,10 +1222,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1232,13 +1234,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1251,20 +1253,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1273,11 +1275,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1286,27 +1288,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1315,13 +1317,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1333,7 +1335,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1346,20 +1348,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1369,13 +1371,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1412,10 +1414,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1424,13 +1426,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1443,7 +1445,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1492,10 +1494,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1504,7 +1506,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1541,10 +1543,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1554,20 +1556,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1576,13 +1578,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } diff --git a/rpc/balance/rpcbinding.go b/rpc/balance/rpcbinding.go index 25a0836f..9f17716f 100644 --- a/rpc/balance/rpcbinding.go +++ b/rpc/balance/rpcbinding.go @@ -1,4 +1,6 @@ // Package balance contains RPC wrappers for NeoFS Balance contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package balance import ( @@ -19,102 +21,102 @@ import ( // BalanceAccount is a contract-specific balance.Account type used by its methods. type BalanceAccount struct { Balance *big.Int - Until *big.Int - Parent []byte + Until *big.Int + Parent []byte } // BalanceToken is a contract-specific balance.Token type used by its methods. type BalanceToken struct { - Symbol string - Decimals *big.Int + Symbol string + Decimals *big.Int CirculationKey string } // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -126,23 +128,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -154,23 +156,23 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // LockEvent represents "Lock" event emitted by the contract. type LockEvent struct { - TxID []byte - From util.Uint160 - To util.Uint160 + TxID []byte + From util.Uint160 + To util.Uint160 Amount *big.Int - Until *big.Int + Until *big.Int } // TransferXEvent represents "TransferX" event emitted by the contract. type TransferXEvent struct { - From util.Uint160 - To util.Uint160 - Amount *big.Int + From util.Uint160 + To util.Uint160 + Amount *big.Int Details []byte } @@ -197,7 +199,7 @@ type Actor interface { type ContractReader struct { nep17.TokenReader invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. @@ -205,7 +207,7 @@ type Contract struct { ContractReader nep17.TokenWriter actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -379,7 +381,7 @@ func (res *BalanceAccount) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Balance, err = arr[index].TryInteger() @@ -425,10 +427,10 @@ func (res *BalanceToken) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Symbol, err = func (item stackitem.Item) (string, error) { + res.Symbol, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -437,7 +439,7 @@ func (res *BalanceToken) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Symbol: %w", err) } @@ -449,7 +451,7 @@ func (res *BalanceToken) FromStackItem(item stackitem.Item) error { } index++ - res.CirculationKey, err = func (item stackitem.Item) (string, error) { + res.CirculationKey, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -458,7 +460,7 @@ func (res *BalanceToken) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field CirculationKey: %w", err) } @@ -489,7 +491,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -498,14 +500,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -515,13 +517,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -558,10 +560,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -571,7 +573,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -583,7 +585,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -593,13 +595,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -609,7 +611,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -633,7 +635,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -643,7 +645,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -680,10 +682,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -693,7 +695,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -705,7 +707,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -715,13 +717,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -731,7 +733,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -755,7 +757,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -765,7 +767,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -777,7 +779,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -787,7 +789,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -818,10 +820,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -831,7 +833,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -849,7 +851,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -859,7 +861,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -914,10 +916,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -927,7 +929,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -939,14 +941,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -956,26 +958,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -985,19 +987,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1010,7 +1012,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -1041,7 +1043,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -1081,7 +1083,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -1121,10 +1123,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1137,13 +1139,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1156,7 +1158,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -1187,7 +1189,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -1202,7 +1204,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1212,7 +1214,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1255,10 +1257,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1267,13 +1269,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1286,7 +1288,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1317,10 +1319,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1330,7 +1332,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1367,10 +1369,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1379,13 +1381,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1398,20 +1400,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1420,11 +1422,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1433,27 +1435,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1462,13 +1464,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1480,7 +1482,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1493,20 +1495,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1516,13 +1518,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1559,10 +1561,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1571,13 +1573,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1590,7 +1592,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1639,10 +1641,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1651,7 +1653,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1688,10 +1690,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1701,20 +1703,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1723,13 +1725,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } @@ -1778,7 +1780,7 @@ func (e *LockEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.TxID, err = arr[index].TryBytes() @@ -1787,7 +1789,7 @@ func (e *LockEvent) FromStackItem(item *stackitem.Array) error { } index++ - e.From, err = func (item stackitem.Item) (util.Uint160, error) { + e.From, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1797,13 +1799,13 @@ func (e *LockEvent) FromStackItem(item *stackitem.Array) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field From: %w", err) } index++ - e.To, err = func (item stackitem.Item) (util.Uint160, error) { + e.To, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1813,7 +1815,7 @@ func (e *LockEvent) FromStackItem(item *stackitem.Array) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field To: %w", err) } @@ -1874,10 +1876,10 @@ func (e *TransferXEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ - e.From, err = func (item stackitem.Item) (util.Uint160, error) { + e.From, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1887,13 +1889,13 @@ func (e *TransferXEvent) FromStackItem(item *stackitem.Array) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field From: %w", err) } index++ - e.To, err = func (item stackitem.Item) (util.Uint160, error) { + e.To, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1903,7 +1905,7 @@ func (e *TransferXEvent) FromStackItem(item *stackitem.Array) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field To: %w", err) } diff --git a/rpc/container/rpcbinding.go b/rpc/container/rpcbinding.go index b466ffef..6287d7fa 100644 --- a/rpc/container/rpcbinding.go +++ b/rpc/container/rpcbinding.go @@ -1,4 +1,6 @@ // Package container contains RPC wrappers for NeoFS Container contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package container import ( @@ -18,7 +20,7 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } @@ -26,14 +28,14 @@ type CommonBallot struct { // ContainerContainer is a contract-specific container.Container type used by its methods. type ContainerContainer struct { Value []byte - Sig []byte - Pub *keys.PublicKey + Sig []byte + Pub *keys.PublicKey Token []byte } // ContainerContainerSizes is a contract-specific container.ContainerSizes type used by its methods. type ContainerContainerSizes struct { - CID []byte + CID []byte Estimations []*ContainerEstimation } @@ -46,89 +48,89 @@ type ContainerEstimation struct { // ContainerExtendedACL is a contract-specific container.ExtendedACL type used by its methods. type ContainerExtendedACL struct { Value []byte - Sig []byte - Pub *keys.PublicKey + Sig []byte + Pub *keys.PublicKey Token []byte } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -140,23 +142,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -168,13 +170,13 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // PutSuccessEvent represents "PutSuccess" event emitted by the contract. type PutSuccessEvent struct { ContainerID util.Uint256 - PublicKey *keys.PublicKey + PublicKey *keys.PublicKey } // DeleteSuccessEvent represents "DeleteSuccess" event emitted by the contract. @@ -185,7 +187,7 @@ type DeleteSuccessEvent struct { // SetEACLSuccessEvent represents "SetEACLSuccess" event emitted by the contract. type SetEACLSuccessEvent struct { ContainerID []byte - PublicKey *keys.PublicKey + PublicKey *keys.PublicKey } // StartEstimationEvent represents "StartEstimation" event emitted by the contract. @@ -221,14 +223,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -549,7 +551,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -558,14 +560,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -575,13 +577,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -618,7 +620,7 @@ func (res *ContainerContainer) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Value, err = arr[index].TryBytes() @@ -633,7 +635,7 @@ func (res *ContainerContainer) FromStackItem(item stackitem.Item) error { } index++ - res.Pub, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.Pub, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -643,7 +645,7 @@ func (res *ContainerContainer) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Pub: %w", err) } @@ -680,7 +682,7 @@ func (res *ContainerContainerSizes) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.CID, err = arr[index].TryBytes() @@ -689,7 +691,7 @@ func (res *ContainerContainerSizes) FromStackItem(item stackitem.Item) error { } index++ - res.Estimations, err = func (item stackitem.Item) ([]*ContainerEstimation, error) { + res.Estimations, err = func(item stackitem.Item) ([]*ContainerEstimation, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -702,7 +704,7 @@ func (res *ContainerContainerSizes) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Estimations: %w", err) } @@ -733,10 +735,10 @@ func (res *ContainerEstimation) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.From, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.From, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -746,7 +748,7 @@ func (res *ContainerEstimation) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field From: %w", err) } @@ -783,7 +785,7 @@ func (res *ContainerExtendedACL) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Value, err = arr[index].TryBytes() @@ -798,7 +800,7 @@ func (res *ContainerExtendedACL) FromStackItem(item stackitem.Item) error { } index++ - res.Pub, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.Pub, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -808,7 +810,7 @@ func (res *ContainerExtendedACL) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Pub: %w", err) } @@ -845,10 +847,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -858,7 +860,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -870,7 +872,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -880,13 +882,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -896,7 +898,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -920,7 +922,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -930,7 +932,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -967,10 +969,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -980,7 +982,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -992,7 +994,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -1002,13 +1004,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -1018,7 +1020,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -1042,7 +1044,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1052,7 +1054,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -1064,7 +1066,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -1074,7 +1076,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -1105,10 +1107,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -1118,7 +1120,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1136,7 +1138,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1146,7 +1148,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -1201,10 +1203,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1214,7 +1216,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -1226,14 +1228,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1243,26 +1245,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1272,19 +1274,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1297,7 +1299,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -1328,7 +1330,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -1368,7 +1370,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -1408,10 +1410,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1424,13 +1426,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1443,7 +1445,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -1474,7 +1476,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -1489,7 +1491,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1499,7 +1501,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1542,10 +1544,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1554,13 +1556,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1573,7 +1575,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1604,10 +1606,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1617,7 +1619,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1654,10 +1656,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1666,13 +1668,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1685,20 +1687,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1707,11 +1709,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1720,27 +1722,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1749,13 +1751,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1767,7 +1769,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1780,20 +1782,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1803,13 +1805,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1846,10 +1848,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1858,13 +1860,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1877,7 +1879,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1926,10 +1928,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1938,7 +1940,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1975,10 +1977,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1988,20 +1990,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -2010,13 +2012,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } @@ -2065,10 +2067,10 @@ func (e *PutSuccessEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ - e.ContainerID, err = func (item stackitem.Item) (util.Uint256, error) { + e.ContainerID, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -2078,13 +2080,13 @@ func (e *PutSuccessEvent) FromStackItem(item *stackitem.Array) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field ContainerID: %w", err) } index++ - e.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + e.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -2094,7 +2096,7 @@ func (e *PutSuccessEvent) FromStackItem(item *stackitem.Array) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -2143,7 +2145,7 @@ func (e *DeleteSuccessEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.ContainerID, err = arr[index].TryBytes() @@ -2195,7 +2197,7 @@ func (e *SetEACLSuccessEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.ContainerID, err = arr[index].TryBytes() @@ -2204,7 +2206,7 @@ func (e *SetEACLSuccessEvent) FromStackItem(item *stackitem.Array) error { } index++ - e.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + e.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -2214,7 +2216,7 @@ func (e *SetEACLSuccessEvent) FromStackItem(item *stackitem.Array) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -2263,7 +2265,7 @@ func (e *StartEstimationEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.Epoch, err = arr[index].TryInteger() @@ -2315,7 +2317,7 @@ func (e *StopEstimationEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.Epoch, err = arr[index].TryInteger() diff --git a/rpc/neofs/rpcbinding.go b/rpc/neofs/rpcbinding.go index 1389fdfe..8bff2e09 100644 --- a/rpc/neofs/rpcbinding.go +++ b/rpc/neofs/rpcbinding.go @@ -1,4 +1,6 @@ // Package neofs contains RPC wrappers for NeoFS contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package neofs import ( @@ -17,7 +19,7 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } @@ -29,82 +31,82 @@ type CommonIRNode struct { // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -116,23 +118,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -144,7 +146,7 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // NeofsRecord is a contract-specific neofs.Record type used by its methods. @@ -155,24 +157,24 @@ type NeofsRecord struct { // DepositEvent represents "Deposit" event emitted by the contract. type DepositEvent struct { - From util.Uint160 - Amount *big.Int + From util.Uint160 + Amount *big.Int Receiver util.Uint160 - TxHash util.Uint256 + TxHash util.Uint256 } // WithdrawEvent represents "Withdraw" event emitted by the contract. type WithdrawEvent struct { - User util.Uint160 + User util.Uint160 Amount *big.Int TxHash util.Uint256 } // ChequeEvent represents "Cheque" event emitted by the contract. type ChequeEvent struct { - Id []byte - User util.Uint160 - Amount *big.Int + Id []byte + User util.Uint160 + Amount *big.Int LockAccount []byte } @@ -190,14 +192,14 @@ type UnbindEvent struct { // AlphabetUpdateEvent represents "AlphabetUpdate" event emitted by the contract. type AlphabetUpdateEvent struct { - Id []byte + Id []byte Alphabet keys.PublicKeys } // SetConfigEvent represents "SetConfig" event emitted by the contract. type SetConfigEvent struct { - Id []byte - Key []byte + Id []byte + Key []byte Value []byte } @@ -221,14 +223,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -248,11 +250,11 @@ func (c *ContractReader) AlphabetAddress() (util.Uint160, error) { // AlphabetList invokes `alphabetList` method of contract. func (c *ContractReader) AlphabetList() ([]*CommonIRNode, error) { - return func (item stackitem.Item, err error) ([]*CommonIRNode, error) { + return func(item stackitem.Item, err error) ([]*CommonIRNode, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*CommonIRNode, error) { + return func(item stackitem.Item) ([]*CommonIRNode, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -265,27 +267,27 @@ func (c *ContractReader) AlphabetList() ([]*CommonIRNode, error) { } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "alphabetList"))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "alphabetList"))) } // Config invokes `config` method of contract. func (c *ContractReader) Config(key []byte) (any, error) { - return func (item stackitem.Item, err error) (any, error) { + return func(item stackitem.Item, err error) (any, error) { if err != nil { return nil, err } return item.Value(), error(nil) - } (unwrap.Item(c.invoker.Call(c.hash, "config", key))) + }(unwrap.Item(c.invoker.Call(c.hash, "config", key))) } // InnerRingCandidates invokes `innerRingCandidates` method of contract. func (c *ContractReader) InnerRingCandidates() ([]*CommonIRNode, error) { - return func (item stackitem.Item, err error) ([]*CommonIRNode, error) { + return func(item stackitem.Item, err error) ([]*CommonIRNode, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*CommonIRNode, error) { + return func(item stackitem.Item) ([]*CommonIRNode, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -298,17 +300,17 @@ func (c *ContractReader) InnerRingCandidates() ([]*CommonIRNode, error) { } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "innerRingCandidates"))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "innerRingCandidates"))) } // ListConfig invokes `listConfig` method of contract. func (c *ContractReader) ListConfig() ([]*NeofsRecord, error) { - return func (item stackitem.Item, err error) ([]*NeofsRecord, error) { + return func(item stackitem.Item, err error) ([]*NeofsRecord, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*NeofsRecord, error) { + return func(item stackitem.Item) ([]*NeofsRecord, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -321,8 +323,8 @@ func (c *ContractReader) ListConfig() ([]*NeofsRecord, error) { } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "listConfig"))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "listConfig"))) } // Version invokes `version` method of contract. @@ -551,7 +553,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -560,14 +562,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -577,13 +579,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -620,10 +622,10 @@ func (res *CommonIRNode) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -633,7 +635,7 @@ func (res *CommonIRNode) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -664,10 +666,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -677,7 +679,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -689,7 +691,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -699,13 +701,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -715,7 +717,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -739,7 +741,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -749,7 +751,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -786,10 +788,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -799,7 +801,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -811,7 +813,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -821,13 +823,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -837,7 +839,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -861,7 +863,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -871,7 +873,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -883,7 +885,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -893,7 +895,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -924,10 +926,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -937,7 +939,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -955,7 +957,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -965,7 +967,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -1020,10 +1022,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1033,7 +1035,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -1045,14 +1047,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1062,26 +1064,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1091,19 +1093,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1116,7 +1118,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -1147,7 +1149,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -1187,7 +1189,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -1227,10 +1229,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1243,13 +1245,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1262,7 +1264,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -1293,7 +1295,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -1308,7 +1310,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1318,7 +1320,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1361,10 +1363,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1373,13 +1375,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1392,7 +1394,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1423,10 +1425,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1436,7 +1438,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1473,10 +1475,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1485,13 +1487,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1504,20 +1506,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1526,11 +1528,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1539,27 +1541,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1568,13 +1570,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1586,7 +1588,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1599,20 +1601,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1622,13 +1624,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1665,10 +1667,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1677,13 +1679,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1696,7 +1698,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1745,10 +1747,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1757,7 +1759,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1794,10 +1796,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1807,20 +1809,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1829,13 +1831,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } @@ -1866,7 +1868,7 @@ func (res *NeofsRecord) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Key, err = arr[index].TryBytes() @@ -1924,10 +1926,10 @@ func (e *DepositEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ - e.From, err = func (item stackitem.Item) (util.Uint160, error) { + e.From, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1937,7 +1939,7 @@ func (e *DepositEvent) FromStackItem(item *stackitem.Array) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field From: %w", err) } @@ -1949,7 +1951,7 @@ func (e *DepositEvent) FromStackItem(item *stackitem.Array) error { } index++ - e.Receiver, err = func (item stackitem.Item) (util.Uint160, error) { + e.Receiver, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1959,13 +1961,13 @@ func (e *DepositEvent) FromStackItem(item *stackitem.Array) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Receiver: %w", err) } index++ - e.TxHash, err = func (item stackitem.Item) (util.Uint256, error) { + e.TxHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -1975,7 +1977,7 @@ func (e *DepositEvent) FromStackItem(item *stackitem.Array) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field TxHash: %w", err) } @@ -2024,10 +2026,10 @@ func (e *WithdrawEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ - e.User, err = func (item stackitem.Item) (util.Uint160, error) { + e.User, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -2037,7 +2039,7 @@ func (e *WithdrawEvent) FromStackItem(item *stackitem.Array) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field User: %w", err) } @@ -2049,7 +2051,7 @@ func (e *WithdrawEvent) FromStackItem(item *stackitem.Array) error { } index++ - e.TxHash, err = func (item stackitem.Item) (util.Uint256, error) { + e.TxHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -2059,7 +2061,7 @@ func (e *WithdrawEvent) FromStackItem(item *stackitem.Array) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field TxHash: %w", err) } @@ -2108,7 +2110,7 @@ func (e *ChequeEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.Id, err = arr[index].TryBytes() @@ -2117,7 +2119,7 @@ func (e *ChequeEvent) FromStackItem(item *stackitem.Array) error { } index++ - e.User, err = func (item stackitem.Item) (util.Uint160, error) { + e.User, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -2127,7 +2129,7 @@ func (e *ChequeEvent) FromStackItem(item *stackitem.Array) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field User: %w", err) } @@ -2188,7 +2190,7 @@ func (e *BindEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.User, err = arr[index].TryBytes() @@ -2197,14 +2199,14 @@ func (e *BindEvent) FromStackItem(item *stackitem.Array) error { } index++ - e.Keys, err = func (item stackitem.Item) (keys.PublicKeys, error) { + e.Keys, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -2214,13 +2216,13 @@ func (e *BindEvent) FromStackItem(item *stackitem.Array) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Keys: %w", err) } @@ -2269,7 +2271,7 @@ func (e *UnbindEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.User, err = arr[index].TryBytes() @@ -2278,14 +2280,14 @@ func (e *UnbindEvent) FromStackItem(item *stackitem.Array) error { } index++ - e.Keys, err = func (item stackitem.Item) (keys.PublicKeys, error) { + e.Keys, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -2295,13 +2297,13 @@ func (e *UnbindEvent) FromStackItem(item *stackitem.Array) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Keys: %w", err) } @@ -2350,7 +2352,7 @@ func (e *AlphabetUpdateEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.Id, err = arr[index].TryBytes() @@ -2359,14 +2361,14 @@ func (e *AlphabetUpdateEvent) FromStackItem(item *stackitem.Array) error { } index++ - e.Alphabet, err = func (item stackitem.Item) (keys.PublicKeys, error) { + e.Alphabet, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -2376,13 +2378,13 @@ func (e *AlphabetUpdateEvent) FromStackItem(item *stackitem.Array) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Alphabet: %w", err) } @@ -2431,7 +2433,7 @@ func (e *SetConfigEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.Id, err = arr[index].TryBytes() diff --git a/rpc/neofsid/rpcbinding.go b/rpc/neofsid/rpcbinding.go index edd846d9..b9f8a5ae 100644 --- a/rpc/neofsid/rpcbinding.go +++ b/rpc/neofsid/rpcbinding.go @@ -1,4 +1,6 @@ // Package neofsid contains RPC wrappers for NeoFS ID contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package neofsid import ( @@ -17,89 +19,89 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -111,23 +113,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -139,7 +141,7 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // NeofsidUserInfo is a contract-specific neofsid.UserInfo type used by its methods. @@ -167,14 +169,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -286,7 +288,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -295,14 +297,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -312,13 +314,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -355,10 +357,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -368,7 +370,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -380,7 +382,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -390,13 +392,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -406,7 +408,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -430,7 +432,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -440,7 +442,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -477,10 +479,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -490,7 +492,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -502,7 +504,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -512,13 +514,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -528,7 +530,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -552,7 +554,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -562,7 +564,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -574,7 +576,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -584,7 +586,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -615,10 +617,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -628,7 +630,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -646,7 +648,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -656,7 +658,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -711,10 +713,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -724,7 +726,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -736,14 +738,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -753,26 +755,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -782,19 +784,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -807,7 +809,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -838,7 +840,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -878,7 +880,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -918,10 +920,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -934,13 +936,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -953,7 +955,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -984,7 +986,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -999,7 +1001,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1009,7 +1011,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1052,10 +1054,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1064,13 +1066,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1083,7 +1085,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1114,10 +1116,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1127,7 +1129,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1164,10 +1166,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1176,13 +1178,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1195,20 +1197,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1217,11 +1219,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1230,27 +1232,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1259,13 +1261,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1277,7 +1279,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1290,20 +1292,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1313,13 +1315,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1356,10 +1358,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1368,13 +1370,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1387,7 +1389,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1436,10 +1438,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1448,7 +1450,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1485,10 +1487,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1498,20 +1500,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1520,13 +1522,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } @@ -1557,10 +1559,10 @@ func (res *NeofsidUserInfo) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Keys, err = func (item stackitem.Item) ([][]byte, error) { + res.Keys, err = func(item stackitem.Item) ([][]byte, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1573,7 +1575,7 @@ func (res *NeofsidUserInfo) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Keys: %w", err) } diff --git a/rpc/netmap/rpcbinding.go b/rpc/netmap/rpcbinding.go index 58e059fa..e144da14 100644 --- a/rpc/netmap/rpcbinding.go +++ b/rpc/netmap/rpcbinding.go @@ -1,4 +1,6 @@ // Package netmap contains RPC wrappers for NeoFS Netmap contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package netmap import ( @@ -17,7 +19,7 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } @@ -29,82 +31,82 @@ type CommonIRNode struct { // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -116,23 +118,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -144,12 +146,12 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // NetmapNode is a contract-specific netmap.Node type used by its methods. type NetmapNode struct { - BLOB []byte + BLOB []byte State *big.Int } @@ -167,7 +169,7 @@ type AddPeerSuccessEvent struct { // UpdateStateSuccessEvent represents "UpdateStateSuccess" event emitted by the contract. type UpdateStateSuccessEvent struct { PublicKey *keys.PublicKey - State *big.Int + State *big.Int } // NewEpochEvent represents "NewEpoch" event emitted by the contract. @@ -195,14 +197,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -217,12 +219,12 @@ func New(actor Actor, hash util.Uint160) *Contract { // Config invokes `config` method of contract. func (c *ContractReader) Config(key []byte) (any, error) { - return func (item stackitem.Item, err error) (any, error) { + return func(item stackitem.Item, err error) (any, error) { if err != nil { return nil, err } return item.Value(), error(nil) - } (unwrap.Item(c.invoker.Call(c.hash, "config", key))) + }(unwrap.Item(c.invoker.Call(c.hash, "config", key))) } // Epoch invokes `epoch` method of contract. @@ -232,11 +234,11 @@ func (c *ContractReader) Epoch() (*big.Int, error) { // InnerRingList invokes `innerRingList` method of contract. func (c *ContractReader) InnerRingList() ([]*CommonIRNode, error) { - return func (item stackitem.Item, err error) ([]*CommonIRNode, error) { + return func(item stackitem.Item, err error) ([]*CommonIRNode, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*CommonIRNode, error) { + return func(item stackitem.Item) ([]*CommonIRNode, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -249,17 +251,17 @@ func (c *ContractReader) InnerRingList() ([]*CommonIRNode, error) { } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "innerRingList"))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "innerRingList"))) } // ListConfig invokes `listConfig` method of contract. func (c *ContractReader) ListConfig() ([]*Netmaprecord, error) { - return func (item stackitem.Item, err error) ([]*Netmaprecord, error) { + return func(item stackitem.Item, err error) ([]*Netmaprecord, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*Netmaprecord, error) { + return func(item stackitem.Item) ([]*Netmaprecord, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -272,17 +274,17 @@ func (c *ContractReader) ListConfig() ([]*Netmaprecord, error) { } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "listConfig"))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "listConfig"))) } // Netmap invokes `netmap` method of contract. func (c *ContractReader) Netmap() ([]*NetmapNode, error) { - return func (item stackitem.Item, err error) ([]*NetmapNode, error) { + return func(item stackitem.Item, err error) ([]*NetmapNode, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*NetmapNode, error) { + return func(item stackitem.Item) ([]*NetmapNode, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -295,17 +297,17 @@ func (c *ContractReader) Netmap() ([]*NetmapNode, error) { } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "netmap"))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "netmap"))) } // NetmapCandidates invokes `netmapCandidates` method of contract. func (c *ContractReader) NetmapCandidates() ([]*NetmapNode, error) { - return func (item stackitem.Item, err error) ([]*NetmapNode, error) { + return func(item stackitem.Item, err error) ([]*NetmapNode, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*NetmapNode, error) { + return func(item stackitem.Item) ([]*NetmapNode, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -318,17 +320,17 @@ func (c *ContractReader) NetmapCandidates() ([]*NetmapNode, error) { } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "netmapCandidates"))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "netmapCandidates"))) } // Snapshot invokes `snapshot` method of contract. func (c *ContractReader) Snapshot(diff *big.Int) ([]*NetmapNode, error) { - return func (item stackitem.Item, err error) ([]*NetmapNode, error) { + return func(item stackitem.Item, err error) ([]*NetmapNode, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*NetmapNode, error) { + return func(item stackitem.Item) ([]*NetmapNode, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -341,17 +343,17 @@ func (c *ContractReader) Snapshot(diff *big.Int) ([]*NetmapNode, error) { } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "snapshot", diff))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "snapshot", diff))) } // SnapshotByEpoch invokes `snapshotByEpoch` method of contract. func (c *ContractReader) SnapshotByEpoch(epoch *big.Int) ([]*NetmapNode, error) { - return func (item stackitem.Item, err error) ([]*NetmapNode, error) { + return func(item stackitem.Item, err error) ([]*NetmapNode, error) { if err != nil { return nil, err } - return func (item stackitem.Item) ([]*NetmapNode, error) { + return func(item stackitem.Item) ([]*NetmapNode, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -364,8 +366,8 @@ func (c *ContractReader) SnapshotByEpoch(epoch *big.Int) ([]*NetmapNode, error) } } return res, nil - } (item) - } (unwrap.Item(c.invoker.Call(c.hash, "snapshotByEpoch", epoch))) + }(item) + }(unwrap.Item(c.invoker.Call(c.hash, "snapshotByEpoch", epoch))) } // Version invokes `version` method of contract. @@ -594,7 +596,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -603,14 +605,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -620,13 +622,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -663,10 +665,10 @@ func (res *CommonIRNode) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -676,7 +678,7 @@ func (res *CommonIRNode) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -707,10 +709,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -720,7 +722,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -732,7 +734,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -742,13 +744,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -758,7 +760,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -782,7 +784,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -792,7 +794,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -829,10 +831,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -842,7 +844,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -854,7 +856,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -864,13 +866,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -880,7 +882,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -904,7 +906,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -914,7 +916,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -926,7 +928,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -936,7 +938,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -967,10 +969,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -980,7 +982,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -998,7 +1000,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1008,7 +1010,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -1063,10 +1065,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1076,7 +1078,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -1088,14 +1090,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1105,26 +1107,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1134,19 +1136,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1159,7 +1161,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -1190,7 +1192,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -1230,7 +1232,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -1270,10 +1272,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1286,13 +1288,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1305,7 +1307,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -1336,7 +1338,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -1351,7 +1353,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1361,7 +1363,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1404,10 +1406,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1416,13 +1418,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1435,7 +1437,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1466,10 +1468,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1479,7 +1481,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1516,10 +1518,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1528,13 +1530,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1547,20 +1549,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1569,11 +1571,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1582,27 +1584,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1611,13 +1613,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1629,7 +1631,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1642,20 +1644,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1665,13 +1667,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1708,10 +1710,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1720,13 +1722,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1739,7 +1741,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1788,10 +1790,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1800,7 +1802,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1837,10 +1839,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1850,20 +1852,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1872,13 +1874,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } @@ -1909,7 +1911,7 @@ func (res *NetmapNode) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.BLOB, err = arr[index].TryBytes() @@ -1949,7 +1951,7 @@ func (res *Netmaprecord) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Key, err = arr[index].TryBytes() @@ -2007,10 +2009,10 @@ func (e *AddPeerSuccessEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ - e.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + e.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -2020,7 +2022,7 @@ func (e *AddPeerSuccessEvent) FromStackItem(item *stackitem.Array) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -2069,10 +2071,10 @@ func (e *UpdateStateSuccessEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ - e.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + e.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -2082,7 +2084,7 @@ func (e *UpdateStateSuccessEvent) FromStackItem(item *stackitem.Array) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -2137,7 +2139,7 @@ func (e *NewEpochEvent) FromStackItem(item *stackitem.Array) error { var ( index = -1 - err error + err error ) index++ e.Epoch, err = arr[index].TryInteger() diff --git a/rpc/nns/rpcbinding.go b/rpc/nns/rpcbinding.go index 850fa0c2..09eaef40 100644 --- a/rpc/nns/rpcbinding.go +++ b/rpc/nns/rpcbinding.go @@ -1,4 +1,6 @@ // Package nns contains RPC wrappers for NameService contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package nns import ( @@ -20,89 +22,89 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -114,23 +116,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -142,15 +144,15 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // NnsNameState is a contract-specific nns.NameState type used by its methods. type NnsNameState struct { - Owner util.Uint160 - Name string + Owner util.Uint160 + Name string Expiration *big.Int - Admin util.Uint160 + Admin util.Uint160 } // Invoker is used by ContractReader to call various safe methods. @@ -176,7 +178,7 @@ type Actor interface { type ContractReader struct { nep11.NonDivisibleReader invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. @@ -184,7 +186,7 @@ type Contract struct { ContractReader nep11.BaseWriter actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -510,7 +512,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -519,14 +521,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -536,13 +538,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -579,10 +581,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -592,7 +594,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -604,7 +606,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -614,13 +616,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -630,7 +632,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -654,7 +656,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -664,7 +666,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -701,10 +703,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -714,7 +716,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -726,7 +728,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -736,13 +738,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -752,7 +754,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -776,7 +778,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -786,7 +788,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -798,7 +800,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -808,7 +810,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -839,10 +841,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -852,7 +854,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -870,7 +872,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -880,7 +882,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -935,10 +937,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -948,7 +950,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -960,14 +962,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -977,26 +979,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1006,19 +1008,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1031,7 +1033,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -1062,7 +1064,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -1102,7 +1104,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -1142,10 +1144,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1158,13 +1160,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1177,7 +1179,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -1208,7 +1210,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -1223,7 +1225,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1233,7 +1235,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1276,10 +1278,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1288,13 +1290,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1307,7 +1309,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1338,10 +1340,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1351,7 +1353,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1388,10 +1390,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1400,13 +1402,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1419,20 +1421,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1441,11 +1443,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1454,27 +1456,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1483,13 +1485,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1501,7 +1503,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1514,20 +1516,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1537,13 +1539,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1580,10 +1582,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1592,13 +1594,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1611,7 +1613,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1660,10 +1662,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1672,7 +1674,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1709,10 +1711,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1722,20 +1724,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1744,13 +1746,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } @@ -1781,10 +1783,10 @@ func (res *NnsNameState) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Owner, err = func (item stackitem.Item) (util.Uint160, error) { + res.Owner, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1794,13 +1796,13 @@ func (res *NnsNameState) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Owner: %w", err) } index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1809,7 +1811,7 @@ func (res *NnsNameState) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1821,7 +1823,7 @@ func (res *NnsNameState) FromStackItem(item stackitem.Item) error { } index++ - res.Admin, err = func (item stackitem.Item) (util.Uint160, error) { + res.Admin, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1831,7 +1833,7 @@ func (res *NnsNameState) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Admin: %w", err) } diff --git a/rpc/processing/rpcbinding.go b/rpc/processing/rpcbinding.go index b8b06b91..25b79536 100644 --- a/rpc/processing/rpcbinding.go +++ b/rpc/processing/rpcbinding.go @@ -1,4 +1,6 @@ // Package processing contains RPC wrappers for NeoFS Multi Signature Processing contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package processing import ( @@ -17,89 +19,89 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -111,23 +113,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -139,7 +141,7 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // Invoker is used by ContractReader to call various safe methods. @@ -162,14 +164,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -237,7 +239,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -246,14 +248,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -263,13 +265,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -306,10 +308,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -319,7 +321,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -331,7 +333,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -341,13 +343,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -357,7 +359,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -381,7 +383,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -391,7 +393,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -428,10 +430,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -441,7 +443,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -453,7 +455,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -463,13 +465,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -479,7 +481,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -503,7 +505,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -513,7 +515,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -525,7 +527,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -535,7 +537,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -566,10 +568,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -579,7 +581,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -597,7 +599,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -607,7 +609,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -662,10 +664,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -675,7 +677,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -687,14 +689,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -704,26 +706,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -733,19 +735,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -758,7 +760,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -789,7 +791,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -829,7 +831,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -869,10 +871,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -885,13 +887,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -904,7 +906,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -935,7 +937,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -950,7 +952,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -960,7 +962,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1003,10 +1005,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1015,13 +1017,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1034,7 +1036,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1065,10 +1067,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1078,7 +1080,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1115,10 +1117,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1127,13 +1129,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1146,20 +1148,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1168,11 +1170,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1181,27 +1183,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1210,13 +1212,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1228,7 +1230,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1241,20 +1243,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1264,13 +1266,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1307,10 +1309,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1319,13 +1321,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1338,7 +1340,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1387,10 +1389,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1399,7 +1401,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1436,10 +1438,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1449,20 +1451,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1471,13 +1473,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } diff --git a/rpc/proxy/rpcbinding.go b/rpc/proxy/rpcbinding.go index 0d5c6e3b..49859235 100644 --- a/rpc/proxy/rpcbinding.go +++ b/rpc/proxy/rpcbinding.go @@ -1,4 +1,6 @@ // Package proxy contains RPC wrappers for NeoFS Notary Proxy contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package proxy import ( @@ -17,89 +19,89 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -111,23 +113,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -139,7 +141,7 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // Invoker is used by ContractReader to call various safe methods. @@ -162,14 +164,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -237,7 +239,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -246,14 +248,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -263,13 +265,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -306,10 +308,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -319,7 +321,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -331,7 +333,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -341,13 +343,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -357,7 +359,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -381,7 +383,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -391,7 +393,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -428,10 +430,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -441,7 +443,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -453,7 +455,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -463,13 +465,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -479,7 +481,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -503,7 +505,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -513,7 +515,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -525,7 +527,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -535,7 +537,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -566,10 +568,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -579,7 +581,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -597,7 +599,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -607,7 +609,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -662,10 +664,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -675,7 +677,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -687,14 +689,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -704,26 +706,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -733,19 +735,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -758,7 +760,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -789,7 +791,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -829,7 +831,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -869,10 +871,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -885,13 +887,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -904,7 +906,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -935,7 +937,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -950,7 +952,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -960,7 +962,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1003,10 +1005,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1015,13 +1017,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1034,7 +1036,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1065,10 +1067,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1078,7 +1080,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1115,10 +1117,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1127,13 +1129,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1146,20 +1148,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1168,11 +1170,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1181,27 +1183,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1210,13 +1212,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1228,7 +1230,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1241,20 +1243,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1264,13 +1266,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1307,10 +1309,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1319,13 +1321,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1338,7 +1340,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1387,10 +1389,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1399,7 +1401,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1436,10 +1438,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1449,20 +1451,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1471,13 +1473,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } diff --git a/rpc/reputation/rpcbinding.go b/rpc/reputation/rpcbinding.go index f445216c..6d5383b8 100644 --- a/rpc/reputation/rpcbinding.go +++ b/rpc/reputation/rpcbinding.go @@ -1,4 +1,6 @@ // Package reputation contains RPC wrappers for NeoFS Reputation contract. +// +// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. package reputation import ( @@ -17,89 +19,89 @@ import ( // CommonBallot is a contract-specific common.Ballot type used by its methods. type CommonBallot struct { - ID []byte + ID []byte Voters keys.PublicKeys Height *big.Int } // LedgerBlock is a contract-specific ledger.Block type used by its methods. type LedgerBlock struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int } // LedgerBlockSR is a contract-specific ledger.BlockSR type used by its methods. type LedgerBlockSR struct { - Hash util.Uint256 - Version *big.Int - PrevHash util.Uint256 - MerkleRoot util.Uint256 - Timestamp *big.Int - Nonce *big.Int - Index *big.Int - NextConsensus util.Uint160 + Hash util.Uint256 + Version *big.Int + PrevHash util.Uint256 + MerkleRoot util.Uint256 + Timestamp *big.Int + Nonce *big.Int + Index *big.Int + NextConsensus util.Uint160 TransactionsLength *big.Int - PrevStateRoot util.Uint256 + PrevStateRoot util.Uint256 } // LedgerTransaction is a contract-specific ledger.Transaction type used by its methods. type LedgerTransaction struct { - Hash util.Uint256 - Version *big.Int - Nonce *big.Int - Sender util.Uint160 - SysFee *big.Int - NetFee *big.Int + Hash util.Uint256 + Version *big.Int + Nonce *big.Int + Sender util.Uint160 + SysFee *big.Int + NetFee *big.Int ValidUntilBlock *big.Int - Script []byte + Script []byte } // LedgerTransactionSigner is a contract-specific ledger.TransactionSigner type used by its methods. type LedgerTransactionSigner struct { - Account util.Uint160 - Scopes *big.Int + Account util.Uint160 + Scopes *big.Int AllowedContracts []util.Uint160 - AllowedGroups keys.PublicKeys - Rules []*LedgerWitnessRule + AllowedGroups keys.PublicKeys + Rules []*LedgerWitnessRule } // LedgerWitnessCondition is a contract-specific ledger.WitnessCondition type used by its methods. type LedgerWitnessCondition struct { - Type *big.Int + Type *big.Int Value any } // LedgerWitnessRule is a contract-specific ledger.WitnessRule type used by its methods. type LedgerWitnessRule struct { - Action *big.Int + Action *big.Int Condition *LedgerWitnessCondition } // ManagementABI is a contract-specific management.ABI type used by its methods. type ManagementABI struct { Methods []*ManagementMethod - Events []*ManagementEvent + Events []*ManagementEvent } // ManagementContract is a contract-specific management.Contract type used by its methods. type ManagementContract struct { - ID *big.Int + ID *big.Int UpdateCounter *big.Int - Hash util.Uint160 - NEF []byte - Manifest *ManagementManifest + Hash util.Uint160 + NEF []byte + Manifest *ManagementManifest } // ManagementEvent is a contract-specific management.Event type used by its methods. type ManagementEvent struct { - Name string + Name string Params []*ManagementParameter } @@ -111,23 +113,23 @@ type ManagementGroup struct { // ManagementManifest is a contract-specific management.Manifest type used by its methods. type ManagementManifest struct { - Name string - Groups []*ManagementGroup - Features map[string]string + Name string + Groups []*ManagementGroup + Features map[string]string SupportedStandards []string - ABI *ManagementABI - Permissions []*ManagementPermission - Trusts []util.Uint160 - Extra any + ABI *ManagementABI + Permissions []*ManagementPermission + Trusts []util.Uint160 + Extra any } // ManagementMethod is a contract-specific management.Method type used by its methods. type ManagementMethod struct { - Name string - Params []*ManagementParameter + Name string + Params []*ManagementParameter ReturnType *big.Int - Offset *big.Int - Safe bool + Offset *big.Int + Safe bool } // ManagementParameter is a contract-specific management.Parameter type used by its methods. @@ -139,7 +141,7 @@ type ManagementParameter struct { // ManagementPermission is a contract-specific management.Permission type used by its methods. type ManagementPermission struct { Contract util.Uint160 - Methods []string + Methods []string } // Invoker is used by ContractReader to call various safe methods. @@ -162,14 +164,14 @@ type Actor interface { // ContractReader implements safe contract methods. type ContractReader struct { invoker Invoker - hash util.Uint160 + hash util.Uint160 } // Contract implements all contract methods. type Contract struct { ContractReader actor Actor - hash util.Uint160 + hash util.Uint160 } // NewReader creates an instance of ContractReader using provided contract hash and the given Invoker. @@ -286,7 +288,7 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryBytes() @@ -295,14 +297,14 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { } index++ - res.Voters, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.Voters, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -312,13 +314,13 @@ func (res *CommonBallot) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Voters: %w", err) } @@ -355,10 +357,10 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -368,7 +370,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -380,7 +382,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -390,13 +392,13 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -406,7 +408,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -430,7 +432,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -440,7 +442,7 @@ func (res *LedgerBlock) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -477,10 +479,10 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -490,7 +492,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -502,7 +504,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevHash, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevHash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -512,13 +514,13 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevHash: %w", err) } index++ - res.MerkleRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.MerkleRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -528,7 +530,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field MerkleRoot: %w", err) } @@ -552,7 +554,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.NextConsensus, err = func (item stackitem.Item) (util.Uint160, error) { + res.NextConsensus, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -562,7 +564,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field NextConsensus: %w", err) } @@ -574,7 +576,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { } index++ - res.PrevStateRoot, err = func (item stackitem.Item) (util.Uint256, error) { + res.PrevStateRoot, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -584,7 +586,7 @@ func (res *LedgerBlockSR) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PrevStateRoot: %w", err) } @@ -615,10 +617,10 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Hash, err = func (item stackitem.Item) (util.Uint256, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint256, error) { b, err := item.TryBytes() if err != nil { return util.Uint256{}, err @@ -628,7 +630,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint256{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -646,7 +648,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { } index++ - res.Sender, err = func (item stackitem.Item) (util.Uint160, error) { + res.Sender, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -656,7 +658,7 @@ func (res *LedgerTransaction) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Sender: %w", err) } @@ -711,10 +713,10 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Account, err = func (item stackitem.Item) (util.Uint160, error) { + res.Account, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -724,7 +726,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Account: %w", err) } @@ -736,14 +738,14 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } index++ - res.AllowedContracts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.AllowedContracts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -753,26 +755,26 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedContracts: %w", err) } index++ - res.AllowedGroups, err = func (item stackitem.Item) (keys.PublicKeys, error) { + res.AllowedGroups, err = func(item stackitem.Item) (keys.PublicKeys, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make(keys.PublicKeys, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (*keys.PublicKey, error) { + res[i], err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -782,19 +784,19 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field AllowedGroups: %w", err) } index++ - res.Rules, err = func (item stackitem.Item) ([]*LedgerWitnessRule, error) { + res.Rules, err = func(item stackitem.Item) ([]*LedgerWitnessRule, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -807,7 +809,7 @@ func (res *LedgerTransactionSigner) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Rules: %w", err) } @@ -838,7 +840,7 @@ func (res *LedgerWitnessCondition) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Type, err = arr[index].TryInteger() @@ -878,7 +880,7 @@ func (res *LedgerWitnessRule) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.Action, err = arr[index].TryInteger() @@ -918,10 +920,10 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Methods, err = func (item stackitem.Item) ([]*ManagementMethod, error) { + res.Methods, err = func(item stackitem.Item) ([]*ManagementMethod, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -934,13 +936,13 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } index++ - res.Events, err = func (item stackitem.Item) ([]*ManagementEvent, error) { + res.Events, err = func(item stackitem.Item) ([]*ManagementEvent, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -953,7 +955,7 @@ func (res *ManagementABI) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Events: %w", err) } @@ -984,7 +986,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ res.ID, err = arr[index].TryInteger() @@ -999,7 +1001,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { } index++ - res.Hash, err = func (item stackitem.Item) (util.Uint160, error) { + res.Hash, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1009,7 +1011,7 @@ func (res *ManagementContract) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Hash: %w", err) } @@ -1052,10 +1054,10 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1064,13 +1066,13 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1083,7 +1085,7 @@ func (res *ManagementEvent) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1114,10 +1116,10 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.PublicKey, err = func (item stackitem.Item) (*keys.PublicKey, error) { + res.PublicKey, err = func(item stackitem.Item) (*keys.PublicKey, error) { b, err := item.TryBytes() if err != nil { return nil, err @@ -1127,7 +1129,7 @@ func (res *ManagementGroup) FromStackItem(item stackitem.Item) error { return nil, err } return k, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field PublicKey: %w", err) } @@ -1164,10 +1166,10 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1176,13 +1178,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Groups, err = func (item stackitem.Item) ([]*ManagementGroup, error) { + res.Groups, err = func(item stackitem.Item) ([]*ManagementGroup, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1195,20 +1197,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Groups: %w", err) } index++ - res.Features, err = func (item stackitem.Item) (map[string]string, error) { + res.Features, err = func(item stackitem.Item) (map[string]string, error) { m, ok := item.Value().([]stackitem.MapElement) if !ok { return nil, fmt.Errorf("%s is not a map", item.Type().String()) } res := make(map[string]string) for i := range m { - k, err := func (item stackitem.Item) (string, error) { + k, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1217,11 +1219,11 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Key) + }(m[i].Key) if err != nil { return nil, fmt.Errorf("key %d: %w", i, err) } - v, err := func (item stackitem.Item) (string, error) { + v, err := func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1230,27 +1232,27 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (m[i].Value) + }(m[i].Value) if err != nil { return nil, fmt.Errorf("value %d: %w", i, err) } res[k] = v } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Features: %w", err) } index++ - res.SupportedStandards, err = func (item stackitem.Item) ([]string, error) { + res.SupportedStandards, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1259,13 +1261,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field SupportedStandards: %w", err) } @@ -1277,7 +1279,7 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } index++ - res.Permissions, err = func (item stackitem.Item) ([]*ManagementPermission, error) { + res.Permissions, err = func(item stackitem.Item) ([]*ManagementPermission, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1290,20 +1292,20 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Permissions: %w", err) } index++ - res.Trusts, err = func (item stackitem.Item) ([]util.Uint160, error) { + res.Trusts, err = func(item stackitem.Item) ([]util.Uint160, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]util.Uint160, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (util.Uint160, error) { + res[i], err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1313,13 +1315,13 @@ func (res *ManagementManifest) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Trusts: %w", err) } @@ -1356,10 +1358,10 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1368,13 +1370,13 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } index++ - res.Params, err = func (item stackitem.Item) ([]*ManagementParameter, error) { + res.Params, err = func(item stackitem.Item) ([]*ManagementParameter, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") @@ -1387,7 +1389,7 @@ func (res *ManagementMethod) FromStackItem(item stackitem.Item) error { } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Params: %w", err) } @@ -1436,10 +1438,10 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Name, err = func (item stackitem.Item) (string, error) { + res.Name, err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1448,7 +1450,7 @@ func (res *ManagementParameter) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Name: %w", err) } @@ -1485,10 +1487,10 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { var ( index = -1 - err error + err error ) index++ - res.Contract, err = func (item stackitem.Item) (util.Uint160, error) { + res.Contract, err = func(item stackitem.Item) (util.Uint160, error) { b, err := item.TryBytes() if err != nil { return util.Uint160{}, err @@ -1498,20 +1500,20 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return util.Uint160{}, err } return u, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Contract: %w", err) } index++ - res.Methods, err = func (item stackitem.Item) ([]string, error) { + res.Methods, err = func(item stackitem.Item) ([]string, error) { arr, ok := item.Value().([]stackitem.Item) if !ok { return nil, errors.New("not an array") } res := make([]string, len(arr)) for i := range res { - res[i], err = func (item stackitem.Item) (string, error) { + res[i], err = func(item stackitem.Item) (string, error) { b, err := item.TryBytes() if err != nil { return "", err @@ -1520,13 +1522,13 @@ func (res *ManagementPermission) FromStackItem(item stackitem.Item) error { return "", errors.New("not a UTF-8 string") } return string(b), nil - } (arr[i]) + }(arr[i]) if err != nil { return nil, fmt.Errorf("item %d: %w", i, err) } } return res, nil - } (arr[index]) + }(arr[index]) if err != nil { return fmt.Errorf("field Methods: %w", err) } From 6eeea6a85337f021f0cb5fa58e82802619033ea3 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 10 Nov 2023 17:37:37 +0300 Subject: [PATCH 3/3] *: replace interface{} with any Should've been done with 1.18 update, but better now than never. Signed-off-by: Roman Khimov --- alphabet/alphabet_contract.go | 12 ++++++------ alphabet/migration_test.go | 6 +++--- audit/audit_contract.go | 16 ++++++++-------- balance/balance_contract.go | 10 +++++----- common/storage.go | 4 ++-- common/transfer.go | 2 +- common/version.go | 6 +++--- common/vote.go | 2 +- container/container_contract.go | 20 ++++++++++---------- neofs/neofs_contract.go | 14 +++++++------- neofsid/neofsid_contract.go | 8 ++++---- netmap/migration_test.go | 6 +++--- netmap/netmap_contract.go | 10 +++++----- nns/nns_contract.go | 14 +++++++------- processing/processing_contract.go | 8 ++++---- proxy/proxy_contract.go | 8 ++++---- reputation/reputation_contract.go | 8 ++++---- tests/alphabet_test.go | 8 ++++---- tests/balance_test.go | 2 +- tests/container_test.go | 14 +++++++------- tests/migration/storage.go | 14 +++++++------- tests/migration/util.go | 2 +- tests/neofs_test.go | 10 +++++----- tests/neofsid_test.go | 14 +++++++------- tests/netmap_test.go | 10 +++++----- tests/nns_test.go | 10 +++++----- tests/processing_test.go | 2 +- tests/proxy_test.go | 2 +- tests/reputation_test.go | 2 +- tests/util.go | 2 +- 30 files changed, 123 insertions(+), 123 deletions(-) diff --git a/alphabet/alphabet_contract.go b/alphabet/alphabet_contract.go index 97a10874..2f701076 100644 --- a/alphabet/alphabet_contract.go +++ b/alphabet/alphabet_contract.go @@ -27,7 +27,7 @@ const ( // OnNEP17Payment is a callback for NEP-17 compatible native GAS and NEO // contracts. -func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { +func OnNEP17Payment(from interop.Hash160, amount int, data any) { caller := runtime.GetCallingScriptHash() if !caller.Equals(gas.Hash) && !caller.Equals(neo.Hash) { common.AbortWithMessage("alphabet contract accepts GAS and NEO only") @@ -35,10 +35,10 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { } // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - args := data.([]interface{}) + args := data.([]any) version := args[len(args)-1].(int) common.CheckVersion(version) @@ -98,7 +98,7 @@ func _deploy(data interface{}, isUpdate bool) { // switchToNotary removes value stored by 'notary' key. // // nolint:unused -func switchToNotary(ctx storage.Context, args []interface{}) { +func switchToNotary(ctx storage.Context, args []any) { const notaryDisabledKey = "notary" // non-notary legacy contractName := args[3].(string) @@ -185,7 +185,7 @@ func switchToNotary(ctx storage.Context, args []interface{}) { // see https://github.com/nspcc-dev/neo-go/blob/v0.101.0/docs/notary.md#1-notary-deposit const lockInterval = 6 * 30 * 24 * 60 * 4 // 6 months blocks of 15s - notaryTransferData := []interface{}{ + notaryTransferData := []any{ nil, // receiver account (set in loop) ledger.CurrentIndex() + lockInterval, // till } @@ -227,7 +227,7 @@ func switchToNotary(ctx storage.Context, args []interface{}) { // Update method updates contract source code and manifest. It can be invoked // only by committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { if !common.HasUpdateAccess() { panic("only committee can update contract") } diff --git a/alphabet/migration_test.go b/alphabet/migration_test.go index 0459603b..950fbeee 100644 --- a/alphabet/migration_test.go +++ b/alphabet/migration_test.go @@ -24,8 +24,8 @@ func TestMigration(t *testing.T) { require.NoError(t, err) } -func replaceArgI(vs []interface{}, i int, v interface{}) []interface{} { - res := make([]interface{}, len(vs)) +func replaceArgI(vs []any, i int, v any) []any { + res := make([]any, len(vs)) copy(res, vs) res[i] = v return res @@ -77,7 +77,7 @@ func testMigrationFromDump(t *testing.T, d *dump.Reader) { // try to update the contract proxyContract := randUint160() - updPrm := []interface{}{ + updPrm := []any{ false, // non-notary mode randUint160(), // unused []byte{}, // Proxy contract (custom) diff --git a/audit/audit_contract.go b/audit/audit_contract.go index 451447eb..360e14bb 100644 --- a/audit/audit_contract.go +++ b/audit/audit_contract.go @@ -28,7 +28,7 @@ type ( const maxKeySize = 24 // 24 + 32 (container ID length) + 8 (epoch length) = 64 func (a AuditHeader) ID() []byte { - var buf interface{} = a.Epoch + var buf any = a.Epoch hashedKey := crypto.Sha256(a.From) shortedKey := hashedKey[:maxKeySize] @@ -37,10 +37,10 @@ func (a AuditHeader) ID() []byte { } // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - args := data.([]interface{}) + args := data.([]any) version := args[len(args)-1].(int) common.CheckVersion(version) @@ -89,7 +89,7 @@ func switchToNotary(ctx storage.Context) { // Update method updates contract source code and manifest. It can be invoked // only by committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { if !common.HasUpdateAccess() { panic("only committee can update contract") } @@ -150,7 +150,7 @@ func List() [][]byte { // the specified epoch. func ListByEpoch(epoch int) [][]byte { ctx := storage.GetReadOnlyContext() - var buf interface{} = epoch + var buf any = epoch it := storage.Find(ctx, buf.([]byte), storage.KeysOnly) return list(it) @@ -161,7 +161,7 @@ func ListByEpoch(epoch int) [][]byte { func ListByCID(epoch int, cid []byte) [][]byte { ctx := storage.GetReadOnlyContext() - var buf interface{} = epoch + var buf any = epoch prefix := append(buf.([]byte), cid...) it := storage.Find(ctx, prefix, storage.KeysOnly) @@ -202,7 +202,7 @@ func Version() int { // readNext reads the length from the first byte, and then reads data (max 127 bytes). func readNext(input []byte) ([]byte, int) { - var buf interface{} = input[0] + var buf any = input[0] ln := buf.(int) return input[1 : 1+ln], 1 + ln @@ -213,7 +213,7 @@ func newAuditHeader(input []byte) AuditHeader { offset := int(input[1]) offset = 2 + offset + 1 // version prefix + version len + epoch prefix - var buf interface{} = input[offset : offset+8] // [ 8 integer bytes ] + var buf any = input[offset : offset+8] // [ 8 integer bytes ] epoch := buf.(int) offset = offset + 8 diff --git a/balance/balance_contract.go b/balance/balance_contract.go index 78ab249a..bbb45864 100644 --- a/balance/balance_contract.go +++ b/balance/balance_contract.go @@ -55,10 +55,10 @@ func init() { } // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - args := data.([]interface{}) + args := data.([]any) version := args[len(args)-1].(int) common.CheckVersion(version) @@ -114,7 +114,7 @@ func switchToNotary(ctx storage.Context) { // Update method updates contract source code and manifest. It can be invoked // only by committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { if !common.HasUpdateAccess() { panic("only committee can update contract") } @@ -154,7 +154,7 @@ func BalanceOf(account interop.Hash160) int { // // It produces Transfer and TransferX notifications. TransferX notification // will have empty details field. -func Transfer(from, to interop.Hash160, amount int, data interface{}) bool { +func Transfer(from, to interop.Hash160, amount int, data any) bool { ctx := storage.GetContext() return token.transfer(ctx, from, to, amount, false, nil) } @@ -399,7 +399,7 @@ func isUsableAddress(addr interop.Hash160) bool { return false } -func getAccount(ctx storage.Context, key interface{}) Account { +func getAccount(ctx storage.Context, key any) Account { data := storage.Get(ctx, key) if data != nil { return std.Deserialize(data.([]byte)).(Account) diff --git a/common/storage.go b/common/storage.go index caf7ca90..13c1458f 100644 --- a/common/storage.go +++ b/common/storage.go @@ -5,7 +5,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/interop/storage" ) -func GetList(ctx storage.Context, key interface{}) [][]byte { +func GetList(ctx storage.Context, key any) [][]byte { data := storage.Get(ctx, key) if data != nil { return std.Deserialize(data.([]byte)).([][]byte) @@ -15,7 +15,7 @@ func GetList(ctx storage.Context, key interface{}) [][]byte { } // SetSerialized serializes data and puts it into contract storage. -func SetSerialized(ctx storage.Context, key interface{}, value interface{}) { +func SetSerialized(ctx storage.Context, key any, value any) { data := std.Serialize(value) storage.Put(ctx, key, data) } diff --git a/common/transfer.go b/common/transfer.go index b3eebdc2..14a0129f 100644 --- a/common/transfer.go +++ b/common/transfer.go @@ -31,7 +31,7 @@ func LockTransferDetails(txDetails []byte) []byte { } func UnlockTransferDetails(epoch int) []byte { - var buf interface{} = epoch + var buf any = epoch return append(unlockPrefix, buf.([]byte)...) } diff --git a/common/version.go b/common/version.go index 8968055d..e695d2af 100644 --- a/common/version.go +++ b/common/version.go @@ -42,9 +42,9 @@ func CheckVersion(from int) { } // AppendVersion appends current contract version to the list of deploy arguments. -func AppendVersion(data interface{}) []interface{} { +func AppendVersion(data any) []any { if data == nil { - return []interface{}{Version} + return []any{Version} } - return append(data.([]interface{}), Version) + return append(data.([]any), Version) } diff --git a/common/vote.go b/common/vote.go index d89be163..f0e02449 100644 --- a/common/vote.go +++ b/common/vote.go @@ -134,7 +134,7 @@ func BytesEqual(a []byte, b []byte) bool { // InvokeID returns hashed value of prefix and args concatenation. Iy is used to // identify different ballots. -func InvokeID(args []interface{}, prefix []byte) []byte { +func InvokeID(args []any, prefix []byte) []byte { for i := range args { arg := args[i].([]byte) prefix = append(prefix, arg...) diff --git a/container/container_contract.go b/container/container_contract.go index f6825020..0b8f961b 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -95,14 +95,14 @@ var ( ) // OnNEP11Payment is needed for registration with contract as the owner to work. -func OnNEP11Payment(a interop.Hash160, b int, c []byte, d interface{}) { +func OnNEP11Payment(a interop.Hash160, b int, c []byte, d any) { } // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - args := data.([]interface{}) + args := data.([]any) version := args[len(args)-1].(int) common.CheckVersion(version) @@ -215,7 +215,7 @@ func registerNiceNameTLD(addrNNS interop.Hash160, nnsRoot string) { // Update method updates contract source code and manifest. It can be invoked // by committee only. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { if !common.HasUpdateAccess() { panic("only committee can update contract") } @@ -382,7 +382,7 @@ func Delete(containerID []byte, signature interop.Signature, token []byte) { // and inability to delete a container. We should also check if we own the record in case. nnsContractAddr := storage.Get(ctx, nnsContractKey).(interop.Hash160) res := contract.Call(nnsContractAddr, "getRecords", contract.ReadStates|contract.AllowCall, domain, 16 /* TXT */) - if res != nil && std.Base58Encode(containerID) == string(res.([]interface{})[0].(string)) { + if res != nil && std.Base58Encode(containerID) == string(res.([]any)[0].(string)) { contract.Call(nnsContractAddr, "deleteRecords", contract.All, domain, 16 /* TXT */) } } @@ -607,7 +607,7 @@ func GetContainerSize(id []byte) ContainerSizes { func ListContainerSizes(epoch int) [][]byte { ctx := storage.GetReadOnlyContext() - var buf interface{} = epoch + var buf any = epoch key := []byte(estimateKeyPrefix) key = append(key, buf.([]byte)...) @@ -644,7 +644,7 @@ func IterateContainerSizes(epoch int, cid interop.Hash256) iterator.Iterator { ctx := storage.GetReadOnlyContext() - var buf interface{} = epoch + var buf any = epoch key := []byte(estimateKeyPrefix) key = append(key, buf.([]byte)...) @@ -660,7 +660,7 @@ func IterateContainerSizes(epoch int, cid interop.Hash256) iterator.Iterator { func IterateAllContainerSizes(epoch int) iterator.Iterator { ctx := storage.GetReadOnlyContext() - var buf interface{} = epoch + var buf any = epoch key := []byte(estimateKeyPrefix) key = append(key, buf.([]byte)...) @@ -771,7 +771,7 @@ func ownerFromBinaryContainer(container []byte) []byte { } func estimationKey(epoch int, cid []byte, key interop.PublicKey) []byte { - var buf interface{} = epoch + var buf any = epoch hash := crypto.Ripemd160(key) @@ -849,7 +849,7 @@ func cleanupContainers(ctx storage.Context, epoch int) { // V2 format nbytes := k[len(estimateKeyPrefix) : len(k)-containerIDSize-estimatePostfixSize] - var n interface{} = nbytes + var n any = nbytes if epoch-n.(int) > TotalCleanupDelta { storage.Delete(ctx, k) diff --git a/neofs/neofs_contract.go b/neofs/neofs_contract.go index dbbdd108..a3982351 100644 --- a/neofs/neofs_contract.go +++ b/neofs/neofs_contract.go @@ -46,11 +46,11 @@ var ( // _deploy sets up initial alphabet node keys. // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - args := data.([]interface{}) + args := data.([]any) common.CheckVersion(args[len(args)-1].(int)) return } @@ -106,7 +106,7 @@ func _deploy(data interface{}, isUpdate bool) { // Update method updates contract source code and manifest. It can be invoked // only by sidechain committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { blockHeight := ledger.CurrentIndex() alphabetKeys := roles.GetDesignatedByRole(roles.NeoFSAlphabet, uint32(blockHeight+1)) alphabetCommittee := common.Multiaddress(alphabetKeys, true) @@ -234,7 +234,7 @@ func InnerRingCandidateAdd(key interop.PublicKey) { // It takes no more than 9000.0 GAS. Native GAS has precision 8, and // NeoFS balance contract has precision 12. Values bigger than 9000.0 can // break JSON limits for integers when precision is converted. -func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { +func OnNEP17Payment(from interop.Hash160, amount int, data any) { rcv := data.(interop.Hash160) if rcv.Equals(ignoreDepositNotification) { return @@ -463,7 +463,7 @@ func AlphabetUpdate(id []byte, args []interop.PublicKey) { // Config returns configuration value of NeoFS configuration. If the key does // not exist, returns nil. -func Config(key []byte) interface{} { +func Config(key []byte) any { ctx := storage.GetReadOnlyContext() return getConfig(ctx, key) } @@ -544,7 +544,7 @@ func getAlphabetNodes(ctx storage.Context) []interop.PublicKey { } // getConfig returns the installed neofs configuration value or nil if it is not set. -func getConfig(ctx storage.Context, key interface{}) interface{} { +func getConfig(ctx storage.Context, key any) any { postfix := key.([]byte) storageKey := append(configPrefix, postfix...) @@ -552,7 +552,7 @@ func getConfig(ctx storage.Context, key interface{}) interface{} { } // setConfig sets a neofs configuration value in the contract storage. -func setConfig(ctx storage.Context, key, val interface{}) { +func setConfig(ctx storage.Context, key, val any) { postfix := key.([]byte) storageKey := append(configPrefix, postfix...) diff --git a/neofsid/neofsid_contract.go b/neofsid/neofsid_contract.go index f07d3492..4c1e0145 100644 --- a/neofsid/neofsid_contract.go +++ b/neofsid/neofsid_contract.go @@ -26,11 +26,11 @@ const ( ) // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - args := data.([]interface{}) + args := data.([]any) version := args[len(args)-1].(int) common.CheckVersion(version) @@ -101,7 +101,7 @@ func switchToNotary(ctx storage.Context) { // Update method updates contract source code and manifest. It can be invoked // only by committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { if !common.HasUpdateAccess() { panic("only committee can update contract") } @@ -195,7 +195,7 @@ func Version() int { return common.Version } -func getUserInfo(ctx storage.Context, key interface{}) UserInfo { +func getUserInfo(ctx storage.Context, key any) UserInfo { it := storage.Find(ctx, key, storage.KeysOnly|storage.RemovePrefix) pubs := [][]byte{} for iterator.Next(it) { diff --git a/netmap/migration_test.go b/netmap/migration_test.go index eb38c4f3..f4d4c10f 100644 --- a/netmap/migration_test.go +++ b/netmap/migration_test.go @@ -31,12 +31,12 @@ func testMigrationFromDump(t *testing.T, d *dump.Reader) { c := migration.NewContract(t, d, "netmap", migration.ContractOptions{}) var notary bool - updPrm := []interface{}{ + updPrm := []any{ !notary, util.Uint160{}, // Balance contract util.Uint160{}, // Container contract - []interface{}{}, // Key list, unused - []interface{}{}, // Config + []any{}, // Key list, unused + []any{}, // Config } migration.SkipUnsupportedVersions(t, c, updPrm...) diff --git a/netmap/netmap_contract.go b/netmap/netmap_contract.go index 0fae62a5..afba3320 100644 --- a/netmap/netmap_contract.go +++ b/netmap/netmap_contract.go @@ -90,7 +90,7 @@ var ( // _deploy function sets up initial list of inner ring public keys. // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() var args = data.(struct { @@ -217,7 +217,7 @@ func switchToNotary(ctx storage.Context) { // Update method updates contract source code and manifest. It can be invoked // only by committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { if !common.HasUpdateAccess() { panic("only committee can update contract") } @@ -557,7 +557,7 @@ func SnapshotByEpoch(epoch int) []Node { // Config returns configuration value of NeoFS configuration. If key does // not exist, returns nil. -func Config(key []byte) interface{} { +func Config(key []byte) any { ctx := storage.GetReadOnlyContext() return getConfig(ctx, key) } @@ -670,14 +670,14 @@ func getSnapshot(ctx storage.Context, key string) []Node { return []Node{} } -func getConfig(ctx storage.Context, key interface{}) interface{} { +func getConfig(ctx storage.Context, key any) any { postfix := key.([]byte) storageKey := append(configPrefix, postfix...) return storage.Get(ctx, storageKey) } -func setConfig(ctx storage.Context, key, val interface{}) { +func setConfig(ctx storage.Context, key, val any) { postfix := key.([]byte) storageKey := append(configPrefix, postfix...) diff --git a/nns/nns_contract.go b/nns/nns_contract.go index 5cee4170..36316754 100644 --- a/nns/nns_contract.go +++ b/nns/nns_contract.go @@ -84,7 +84,7 @@ type nsIteratorValue struct { } // Update updates NameService contract. -func Update(nef []byte, manifest string, data interface{}) { +func Update(nef []byte, manifest string, data any) { checkCommittee() // Calculating keys and serializing requires calling // std and crypto contracts. This can be helpful on update @@ -97,9 +97,9 @@ func Update(nef []byte, manifest string, data interface{}) { // _deploy initializes defaults (total supply and registration price) on contract deploy. // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { if isUpdate { - args := data.([]interface{}) + args := data.([]any) version := args[len(args)-1].(int) common.CheckVersion(version) @@ -190,7 +190,7 @@ func OwnerOf(tokenID []byte) interop.Hash160 { // Properties returns a domain name and an expiration date of the specified domain. // The tokenID MUST NOT be a TLD. -func Properties(tokenID []byte) map[string]interface{} { +func Properties(tokenID []byte) map[string]any { fragments := std.StringSplit(string(tokenID), ".") if len(fragments) == 1 { panic("token not found") @@ -198,7 +198,7 @@ func Properties(tokenID []byte) map[string]interface{} { ctx := storage.GetReadOnlyContext() ns := getFragmentedNameState(ctx, tokenID, fragments) - return map[string]interface{}{ + return map[string]any{ "name": ns.Name, "expiration": ns.Expiration, } @@ -234,7 +234,7 @@ func TokensOf(owner interop.Hash160) iterator.Iterator { // Transfer transfers the domain with the specified name to a new owner. // The tokenID MUST NOT be a TLD. -func Transfer(to interop.Hash160, tokenID []byte, data interface{}) bool { +func Transfer(to interop.Hash160, tokenID []byte, data any) bool { if !isValid(to) { panic(`invalid receiver`) } @@ -640,7 +640,7 @@ func updateBalance(ctx storage.Context, tokenId []byte, acc interop.Hash160, dif // postTransfer sends Transfer notification to the network and calls onNEP11Payment // method. -func postTransfer(from, to interop.Hash160, tokenID []byte, data interface{}) { +func postTransfer(from, to interop.Hash160, tokenID []byte, data any) { runtime.Notify("Transfer", from, to, 1, tokenID) if management.GetContract(to) != nil { contract.Call(to, "onNEP11Payment", contract.All, from, 1, tokenID, data) diff --git a/processing/processing_contract.go b/processing/processing_contract.go index 8678e41b..c7120b9d 100644 --- a/processing/processing_contract.go +++ b/processing/processing_contract.go @@ -19,7 +19,7 @@ const ( ) // OnNEP17Payment is a callback for NEP-17 compatible native GAS contract. -func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { +func OnNEP17Payment(from interop.Hash160, amount int, data any) { caller := runtime.GetCallingScriptHash() if !caller.Equals(gas.Hash) { common.AbortWithMessage("processing contract accepts GAS only") @@ -27,9 +27,9 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { } // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { if isUpdate { - args := data.([]interface{}) + args := data.([]any) common.CheckVersion(args[len(args)-1].(int)) return } @@ -51,7 +51,7 @@ func _deploy(data interface{}, isUpdate bool) { // Update method updates contract source code and manifest. It can be invoked // only by the sidechain committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { blockHeight := ledger.CurrentIndex() alphabetKeys := roles.GetDesignatedByRole(roles.NeoFSAlphabet, uint32(blockHeight+1)) alphabetCommittee := common.Multiaddress(alphabetKeys, true) diff --git a/proxy/proxy_contract.go b/proxy/proxy_contract.go index e30b0be2..1b0a5353 100644 --- a/proxy/proxy_contract.go +++ b/proxy/proxy_contract.go @@ -11,7 +11,7 @@ import ( ) // OnNEP17Payment is a callback for NEP-17 compatible native GAS contract. -func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { +func OnNEP17Payment(from interop.Hash160, amount int, data any) { caller := runtime.GetCallingScriptHash() if !caller.Equals(gas.Hash) { common.AbortWithMessage("proxy contract accepts GAS only") @@ -19,9 +19,9 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { } // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { if isUpdate { - args := data.([]interface{}) + args := data.([]any) common.CheckVersion(args[len(args)-1].(int)) return } @@ -31,7 +31,7 @@ func _deploy(data interface{}, isUpdate bool) { // Update method updates contract source code and manifest. It can be invoked // only by committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { if !common.HasUpdateAccess() { panic("only committee can update contract") } diff --git a/reputation/reputation_contract.go b/reputation/reputation_contract.go index 60c2f2d1..83a62b7a 100644 --- a/reputation/reputation_contract.go +++ b/reputation/reputation_contract.go @@ -17,11 +17,11 @@ const ( ) // nolint:deadcode,unused -func _deploy(data interface{}, isUpdate bool) { +func _deploy(data any, isUpdate bool) { ctx := storage.GetContext() if isUpdate { - args := data.([]interface{}) + args := data.([]any) version := args[len(args)-1].(int) common.CheckVersion(version) @@ -74,7 +74,7 @@ func switchToNotary(ctx storage.Context) { // Update method updates contract source code and manifest. It can be invoked // only by committee. -func Update(script []byte, manifest []byte, data interface{}) { +func Update(script []byte, manifest []byte, data any) { if !common.HasUpdateAccess() { panic("only committee can update contract") } @@ -160,7 +160,7 @@ func Version() int { } func storageID(epoch int, peerID []byte) []byte { - var buf interface{} = epoch + var buf any = epoch return append(buf.([]byte), peerID...) } diff --git a/tests/alphabet_test.go b/tests/alphabet_test.go index c1d76570..742d7b4e 100644 --- a/tests/alphabet_test.go +++ b/tests/alphabet_test.go @@ -20,7 +20,7 @@ const alphabetPath = "../alphabet" func deployAlphabetContract(t *testing.T, e *neotest.Executor, addrNetmap, addrProxy util.Uint160, name string, index, total int64) util.Uint160 { c := neotest.CompileFile(t, e.CommitteeHash, alphabetPath, path.Join(alphabetPath, "config.yml")) - args := make([]interface{}, 6) + args := make([]any, 6) args[0] = false args[1] = addrNetmap args[2] = addrProxy @@ -87,8 +87,8 @@ func TestVote(t *testing.T) { require.True(t, ok) cNewAlphabet := c.WithSigners(newAlphabet) - cNewAlphabet.InvokeFail(t, common.ErrAlphabetWitnessFailed, method, int64(0), []interface{}{newAlphabetPub}) - c.InvokeFail(t, "invalid epoch", method, int64(1), []interface{}{newAlphabetPub}) + cNewAlphabet.InvokeFail(t, common.ErrAlphabetWitnessFailed, method, int64(0), []any{newAlphabetPub}) + c.InvokeFail(t, "invalid epoch", method, int64(1), []any{newAlphabetPub}) setAlphabetRole(t, e, newAlphabetPub) transferNeoToContract(t, c) @@ -108,7 +108,7 @@ func TestVote(t *testing.T) { newInvoker := neoInvoker.WithSigners(newAlphabet) newInvoker.Invoke(t, stackitem.NewBool(true), "registerCandidate", newAlphabetPub) - c.Invoke(t, stackitem.Null{}, method, int64(0), []interface{}{newAlphabetPub}) + c.Invoke(t, stackitem.Null{}, method, int64(0), []any{newAlphabetPub}) // wait one block util // a new committee is accepted diff --git a/tests/balance_test.go b/tests/balance_test.go index 03b076e4..2dd9924b 100644 --- a/tests/balance_test.go +++ b/tests/balance_test.go @@ -14,7 +14,7 @@ const balancePath = "../balance" func deployBalanceContract(t *testing.T, e *neotest.Executor, addrNetmap, addrContainer util.Uint160) util.Uint160 { c := neotest.CompileFile(t, e.CommitteeHash, balancePath, path.Join(balancePath, "config.yml")) - args := make([]interface{}, 3) + args := make([]any, 3) args[0] = false args[1] = addrNetmap args[2] = addrContainer diff --git a/tests/container_test.go b/tests/container_test.go index 80ba3031..8750dcfb 100644 --- a/tests/container_test.go +++ b/tests/container_test.go @@ -27,7 +27,7 @@ const ( ) func deployContainerContract(t *testing.T, e *neotest.Executor, addrNetmap, addrBalance, addrNNS util.Uint160) util.Uint160 { - args := make([]interface{}, 6) + args := make([]any, 6) args[0] = int64(0) args[1] = addrNetmap args[2] = addrBalance @@ -167,7 +167,7 @@ func TestContainerPut(t *testing.T) { acc := c.NewAccount(t) cnt := dummyContainer(acc) - putArgs := []interface{}{cnt.value, cnt.sig, cnt.pub, cnt.token} + putArgs := []any{cnt.value, cnt.sig, cnt.pub, cnt.token} c.InvokeFail(t, "insufficient balance to create container", "put", putArgs...) balanceMint(t, cBal, acc, containerFee*1, []byte{}) @@ -184,7 +184,7 @@ func TestContainerPut(t *testing.T) { balanceMint(t, cBal, acc, containerFee*1, []byte{}) - putArgs := []interface{}{cnt.value, cnt.sig, cnt.pub, cnt.token, "mycnt", ""} + putArgs := []any{cnt.value, cnt.sig, cnt.pub, cnt.token, "mycnt", ""} t.Run("no fee for alias", func(t *testing.T) { c.InvokeFail(t, "insufficient balance to create container", "putNamed", putArgs...) }) @@ -219,7 +219,7 @@ func TestContainerPut(t *testing.T) { balanceMint(t, cBal, acc, (containerFee+containerAliasFee)*1, []byte{}) - putArgs := []interface{}{cnt.value, cnt.sig, cnt.pub, cnt.token, "domain", "cdn"} + putArgs := []any{cnt.value, cnt.sig, cnt.pub, cnt.token, "domain", "cdn"} c2 := c.WithSigners(c.Committee, acc) c2.Invoke(t, stackitem.Null{}, "putNamed", putArgs...) @@ -324,7 +324,7 @@ func TestContainerSetEACL(t *testing.T) { }) e := dummyEACL(cnt.id) - setArgs := []interface{}{e.value, e.sig, e.pub, e.token} + setArgs := []any{e.value, e.sig, e.pub, e.token} cAcc := c.WithSigners(acc) cAcc.InvokeFail(t, common.ErrAlphabetWitnessFailed, "setEACL", setArgs...) @@ -338,8 +338,8 @@ func TestContainerSetEACL(t *testing.T) { }) c.Invoke(t, expected, "eACL", cnt.id[:]) - replaceEACLArg := func(eACL []byte) []interface{} { - res := make([]interface{}, len(setArgs)) + replaceEACLArg := func(eACL []byte) []any { + res := make([]any, len(setArgs)) copy(res, setArgs) res[0] = eACL return res diff --git a/tests/migration/storage.go b/tests/migration/storage.go index 1c0c8895..853340d3 100644 --- a/tests/migration/storage.go +++ b/tests/migration/storage.go @@ -169,8 +169,8 @@ func NewContract(tb testing.TB, d *dump.Reader, name string, opts ContractOption } // Testing non-NNS. deploy it then. exec.DeployContract(tb, nnsCtr, - []interface{}{ - []interface{}{[]interface{}{"neofs", "ops@morphbits.io"}}, + []any{ + []any{[]any{"neofs", "ops@morphbits.io"}}, }, ) @@ -196,7 +196,7 @@ func NewContract(tb testing.TB, d *dump.Reader, name string, opts ContractOption } } -func (x *Contract) checkUpdate(tb testing.TB, faultException string, args ...interface{}) { +func (x *Contract) checkUpdate(tb testing.TB, faultException string, args ...any) { const updateMethod = "update" if faultException != "" { @@ -211,7 +211,7 @@ func (x *Contract) checkUpdate(tb testing.TB, faultException string, args ...int // CheckUpdateSuccess tests that contract update with given arguments succeeds. // Contract executable (NEF and manifest) is compiled from source code (see // NewContract for details). -func (x *Contract) CheckUpdateSuccess(tb testing.TB, args ...interface{}) { +func (x *Contract) CheckUpdateSuccess(tb testing.TB, args ...any) { x.checkUpdate(tb, "", args...) } @@ -219,11 +219,11 @@ func (x *Contract) CheckUpdateSuccess(tb testing.TB, args ...interface{}) { // exception. // // See also CheckUpdateSuccess. -func (x *Contract) CheckUpdateFail(tb testing.TB, faultException string, args ...interface{}) { +func (x *Contract) CheckUpdateFail(tb testing.TB, faultException string, args ...any) { x.checkUpdate(tb, faultException, args...) } -func makeTestInvoke(tb testing.TB, inv *neotest.ContractInvoker, method string, args ...interface{}) stackitem.Item { +func makeTestInvoke(tb testing.TB, inv *neotest.ContractInvoker, method string, args ...any) stackitem.Item { vmStack, err := inv.TestInvoke(tb, method, args...) require.NoError(tb, err, "method '%s'", method) @@ -243,7 +243,7 @@ func makeTestInvoke(tb testing.TB, inv *neotest.ContractInvoker, method string, // // Note that Call doesn't change the chain state, so only read (aka safe) // methods should be used. -func (x *Contract) Call(tb testing.TB, method string, args ...interface{}) stackitem.Item { +func (x *Contract) Call(tb testing.TB, method string, args ...any) stackitem.Item { return makeTestInvoke(tb, x.ContractInvoker, method, args...) } diff --git a/tests/migration/util.go b/tests/migration/util.go index 5caaa7e0..1e34cb7c 100644 --- a/tests/migration/util.go +++ b/tests/migration/util.go @@ -37,7 +37,7 @@ func (x nopCloseStore) Close() error { // 'version' method and checks can the Contract be updated similar to // common.CheckVersion. If not, SkipUnsupportedVersions skips corresponding // test. -func SkipUnsupportedVersions(tb testing.TB, c *Contract, updPrms ...interface{}) { +func SkipUnsupportedVersions(tb testing.TB, c *Contract, updPrms ...any) { n, err := c.Call(tb, "version").TryInteger() require.NoError(tb, err, "version response must be integer-convertible") diff --git a/tests/neofs_test.go b/tests/neofs_test.go index 0d09bde2..250525f5 100644 --- a/tests/neofs_test.go +++ b/tests/neofs_test.go @@ -21,24 +21,24 @@ import ( const neofsPath = "../neofs" func deployNeoFSContract(t *testing.T, e *neotest.Executor, addrProc util.Uint160, - pubs keys.PublicKeys, config ...interface{}) util.Uint160 { - args := make([]interface{}, 5) + pubs keys.PublicKeys, config ...any) util.Uint160 { + args := make([]any, 5) args[0] = false args[1] = addrProc - arr := make([]interface{}, len(pubs)) + arr := make([]any, len(pubs)) for i := range pubs { arr[i] = pubs[i].Bytes() } args[2] = arr - args[3] = append([]interface{}{}, config...) + args[3] = append([]any{}, config...) c := neotest.CompileFile(t, e.CommitteeHash, neofsPath, path.Join(neofsPath, "config.yml")) e.DeployContract(t, c, args) return c.Hash } -func newNeoFSInvoker(t *testing.T, n int, config ...interface{}) (*neotest.ContractInvoker, neotest.Signer, keys.PublicKeys) { +func newNeoFSInvoker(t *testing.T, n int, config ...any) (*neotest.ContractInvoker, neotest.Signer, keys.PublicKeys) { e := newExecutor(t) accounts := make([]*wallet.Account, n) diff --git a/tests/neofsid_test.go b/tests/neofsid_test.go index 6118b499..e892b28c 100644 --- a/tests/neofsid_test.go +++ b/tests/neofsid_test.go @@ -19,7 +19,7 @@ import ( const neofsidPath = "../neofsid" func deployNeoFSIDContract(t *testing.T, e *neotest.Executor, addrNetmap, addrContainer util.Uint160) util.Uint160 { - args := make([]interface{}, 5) + args := make([]any, 5) args[0] = false args[1] = addrNetmap args[2] = addrContainer @@ -59,7 +59,7 @@ func TestNeoFSID_AddKey(t *testing.T) { acc := e.NewAccount(t) owner, _ := base58.Decode(address.Uint160ToString(acc.ScriptHash())) e.Invoke(t, stackitem.Null{}, "addKey", owner, - []interface{}{pubs[0], pubs[1]}) + []any{pubs[0], pubs[1]}) sort.Slice(pubs[:2], func(i, j int) bool { return bytes.Compare(pubs[i], pubs[j]) == -1 @@ -71,8 +71,8 @@ func TestNeoFSID_AddKey(t *testing.T) { e.Invoke(t, stackitem.NewArray(arr), "key", owner) t.Run("multiple addKey per block", func(t *testing.T) { - tx1 := e.PrepareInvoke(t, "addKey", owner, []interface{}{pubs[2]}) - tx2 := e.PrepareInvoke(t, "addKey", owner, []interface{}{pubs[3], pubs[4]}) + tx1 := e.PrepareInvoke(t, "addKey", owner, []any{pubs[2]}) + tx2 := e.PrepareInvoke(t, "addKey", owner, []any{pubs[3], pubs[4]}) e.AddNewBlock(t, tx1, tx2) e.CheckHalt(t, tx1.Hash(), stackitem.Null{}) e.CheckHalt(t, tx2.Hash(), stackitem.Null{}) @@ -91,7 +91,7 @@ func TestNeoFSID_AddKey(t *testing.T) { }) e.Invoke(t, stackitem.Null{}, "removeKey", owner, - []interface{}{pubs[1], pubs[5]}) + []any{pubs[1], pubs[5]}) arr = []stackitem.Item{ stackitem.NewBuffer(pubs[0]), stackitem.NewBuffer(pubs[2]), @@ -101,8 +101,8 @@ func TestNeoFSID_AddKey(t *testing.T) { e.Invoke(t, stackitem.NewArray(arr), "key", owner) t.Run("multiple removeKey per block", func(t *testing.T) { - tx1 := e.PrepareInvoke(t, "removeKey", owner, []interface{}{pubs[2]}) - tx2 := e.PrepareInvoke(t, "removeKey", owner, []interface{}{pubs[0], pubs[4]}) + tx1 := e.PrepareInvoke(t, "removeKey", owner, []any{pubs[2]}) + tx2 := e.PrepareInvoke(t, "removeKey", owner, []any{pubs[0], pubs[4]}) e.AddNewBlock(t, tx1, tx2) e.CheckHalt(t, tx1.Hash(), stackitem.Null{}) e.CheckHalt(t, tx2.Hash(), stackitem.Null{}) diff --git a/tests/netmap_test.go b/tests/netmap_test.go index be794e6f..abb3f98f 100644 --- a/tests/netmap_test.go +++ b/tests/netmap_test.go @@ -21,23 +21,23 @@ import ( const netmapPath = "../netmap" -func deployNetmapContract(t *testing.T, e *neotest.Executor, addrBalance, addrContainer util.Uint160, config ...interface{}) util.Uint160 { +func deployNetmapContract(t *testing.T, e *neotest.Executor, addrBalance, addrContainer util.Uint160, config ...any) util.Uint160 { _, pubs, ok := vm.ParseMultiSigContract(e.Committee.Script()) require.True(t, ok) - args := make([]interface{}, 5) + args := make([]any, 5) args[0] = false args[1] = addrBalance args[2] = addrContainer - args[3] = []interface{}{pubs[0]} - args[4] = append([]interface{}{}, config...) + args[3] = []any{pubs[0]} + args[4] = append([]any{}, config...) c := neotest.CompileFile(t, e.CommitteeHash, netmapPath, path.Join(netmapPath, "config.yml")) e.DeployContract(t, c, args) return c.Hash } -func newNetmapInvoker(t *testing.T, config ...interface{}) *neotest.ContractInvoker { +func newNetmapInvoker(t *testing.T, config ...any) *neotest.ContractInvoker { e := newExecutor(t) ctrNNS := neotest.CompileFile(t, e.CommitteeHash, nnsPath, path.Join(nnsPath, "config.yml")) diff --git a/tests/nns_test.go b/tests/nns_test.go index 27267a3f..1142f4ea 100644 --- a/tests/nns_test.go +++ b/tests/nns_test.go @@ -25,11 +25,11 @@ func newNNSInvoker(t *testing.T, addRoot bool, tldSet ...string) *neotest.Contra e := newExecutor(t) ctr := neotest.CompileFile(t, e.CommitteeHash, nnsPath, path.Join(nnsPath, "config.yml")) if len(tldSet) > 0 { - _tldSet := make([]interface{}, len(tldSet)) + _tldSet := make([]any, len(tldSet)) for i := range tldSet { - _tldSet[i] = []interface{}{tldSet[i], "user@domain.org"} + _tldSet[i] = []any{tldSet[i], "user@domain.org"} } - e.DeployContract(t, ctr, []interface{}{_tldSet}) + e.DeployContract(t, ctr, []any{_tldSet}) } else { e.DeployContract(t, ctr, nil) } @@ -130,8 +130,8 @@ func TestNNSRegister(t *testing.T) { func TestNNSRegisterMulti(t *testing.T) { c := newNNSInvoker(t, true) - newArgs := func(domain string, account neotest.Signer) []interface{} { - return []interface{}{ + newArgs := func(domain string, account neotest.Signer) []any { + return []any{ domain, account.ScriptHash(), "doesnt@matter.com", int64(101), int64(102), int64(103), int64(104), } diff --git a/tests/processing_test.go b/tests/processing_test.go index 248eef89..b903f125 100644 --- a/tests/processing_test.go +++ b/tests/processing_test.go @@ -14,7 +14,7 @@ const processingPath = "../processing" func deployProcessingContract(t *testing.T, e *neotest.Executor, addrNeoFS util.Uint160) util.Uint160 { c := neotest.CompileFile(t, e.CommitteeHash, processingPath, path.Join(processingPath, "config.yml")) - args := make([]interface{}, 1) + args := make([]any, 1) args[0] = addrNeoFS e.DeployContract(t, c, args) diff --git a/tests/proxy_test.go b/tests/proxy_test.go index 67b363c0..845fb16e 100644 --- a/tests/proxy_test.go +++ b/tests/proxy_test.go @@ -12,7 +12,7 @@ import ( const proxyPath = "../proxy" func deployProxyContract(t *testing.T, e *neotest.Executor, addrNetmap util.Uint160) util.Uint160 { - args := make([]interface{}, 1) + args := make([]any, 1) args[0] = addrNetmap c := neotest.CompileFile(t, e.CommitteeHash, proxyPath, path.Join(proxyPath, "config.yml")) diff --git a/tests/reputation_test.go b/tests/reputation_test.go index 8b09a25b..d9bbb6d6 100644 --- a/tests/reputation_test.go +++ b/tests/reputation_test.go @@ -16,7 +16,7 @@ func deployReputationContract(t *testing.T, e *neotest.Executor) util.Uint160 { c := neotest.CompileFile(t, e.CommitteeHash, reputationPath, path.Join(reputationPath, "config.yml")) - args := make([]interface{}, 1) + args := make([]any, 1) args[0] = false e.DeployContract(t, c, args) diff --git a/tests/util.go b/tests/util.go index 099dc01b..abc12f6d 100644 --- a/tests/util.go +++ b/tests/util.go @@ -75,7 +75,7 @@ func setAlphabetRole(tb testing.TB, e *neotest.Executor, key []byte) { } func _setAlphabetRole(tb testing.TB, e *neotest.Executor, _keys [][]byte) { - keysArg := make([]interface{}, len(_keys)) + keysArg := make([]any, len(_keys)) for i := range _keys { keysArg[i] = _keys[i] }