Skip to content

Commit 874d211

Browse files
authored
Golang 1.23 support (#662)
1 parent 49e7904 commit 874d211

16 files changed

+112
-57
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
go: circleci/go@1.11.0
4+
go: circleci/go@1.12.0
55

66
workflows:
77
circleci_build_and_test:
@@ -10,7 +10,7 @@ workflows:
1010
name: 'test_go_<< matrix.go_version >>'
1111
matrix:
1212
parameters:
13-
go_version: ['1.21.10']
13+
go_version: ['1.23.3']
1414

1515
jobs:
1616
test:

.github/workflows/codegen.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out repository
13-
uses: actions/checkout@v3.5.3
13+
uses: actions/checkout@v4
1414
- name: Generate and PR
1515
uses: algorand/generator/.github/actions/sdk-codegen/@master
1616
with:

.github/workflows/create-release-pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
fi
4444
4545
- name: Checkout
46-
uses: actions/checkout@v3.5.3
46+
uses: actions/checkout@v4
4747
with:
4848
fetch-depth: 0
4949

@@ -159,7 +159,7 @@ jobs:
159159
160160
- name: Send Slack Message
161161
id: slack
162-
uses: slackapi/slack-github-action@v1.24.0
162+
uses: slackapi/slack-github-action@v1.27.0
163163
env:
164164
RELEASE_TAG: ${{ steps.set-release.outputs.release-tag }}
165165
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/pr-type-category.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Check PR Category and Type
1111
steps:
1212
- name: Checking for correct number of required github pr labels
13-
uses: mheap/github-action-required-labels@v2
13+
uses: mheap/github-action-required-labels@v5
1414
with:
1515
mode: exactly
1616
count: 1

.github/workflows/reviewdog.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Check out code into the Go module directory
9-
uses: actions/checkout@v3.5.3
9+
uses: actions/checkout@v4
1010
with:
1111
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
1212
- name: Install specific golang
13-
uses: actions/setup-go@v4.0.1
13+
uses: actions/setup-go@v5
1414
with:
15-
go-version: '1.21.10'
15+
go-version: '1.23.3'
1616
- name: Check format
1717
run: test -z `go fmt ./...`
1818
- name: Vet
1919
run: go vet ./...
2020
- name: reviewdog-golangci-lint
21-
uses: reviewdog/action-golangci-lint@v2.6.1
21+
uses: reviewdog/action-golangci-lint@v2.6.2
2222
with:
23-
golangci_lint_version: "v1.58.0"
23+
golangci_lint_version: "v1.62.0"
2424
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
25-
go_version: "1.21.10"
25+
go_version: "1.23.3"
2626
reporter: "github-pr-review"
2727
tool_name: "Lint Errors"
2828
level: "error"

.golangci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
run:
22
timeout: 5m
33
tests: false
4-
skip-dirs:
5-
# Don't run linter on generated files
6-
- client/v2
74

85
linters:
96
disable-all: true
107
enable:
118
- errcheck
12-
- exportloopref
9+
- copyloopvar
1310
- gci
1411
- gofmt
1512
- gosimple
@@ -66,7 +63,11 @@ issues:
6663
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
6764
# "EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore"
6865
- ineffective break statement. Did you mean to break out of the outer loop
69-
66+
67+
exclude-dirs:
68+
# Don't run linter on generated files
69+
- client/v2
70+
7071
exclude-rules:
7172
# Test utilities and helpers may have code that look unused, but is being used in another file
7273
- path: test/helpers.go

go.mod

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
module github.com/algorand/go-algorand-sdk/v2
22

3-
go 1.21
3+
go 1.23
44

5-
toolchain go1.21.10
5+
toolchain go1.23.3
66

77
require (
8-
github.com/algorand/avm-abi v0.1.1
8+
github.com/algorand/avm-abi v0.2.0
99
github.com/algorand/go-codec/codec v1.1.10
10-
github.com/cucumber/godog v0.8.1
11-
github.com/google/go-querystring v1.0.0
12-
github.com/stretchr/testify v1.7.1
13-
golang.org/x/crypto v0.17.0
10+
github.com/cucumber/godog v0.14.1
11+
github.com/google/go-querystring v1.1.0
12+
github.com/stretchr/testify v1.9.0
13+
golang.org/x/crypto v0.29.0
1414
)
1515

1616
require (
17+
github.com/cucumber/gherkin/go/v26 v26.2.0 // indirect
18+
github.com/cucumber/messages/go/v21 v21.0.1 // indirect
1719
github.com/davecgh/go-spew v1.1.1 // indirect
20+
github.com/gofrs/uuid v4.3.1+incompatible // indirect
21+
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
22+
github.com/hashicorp/go-memdb v1.3.4 // indirect
23+
github.com/hashicorp/golang-lru v0.5.4 // indirect
1824
github.com/pmezard/go-difflib v1.0.0 // indirect
19-
gopkg.in/yaml.v3 v3.0.0 // indirect
25+
github.com/spf13/pflag v1.0.5 // indirect
26+
gopkg.in/yaml.v3 v3.0.1 // indirect
2027
)

go.sum

+52-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,64 @@
1-
github.com/algorand/avm-abi v0.1.1 h1:dbyQKzXiyaEbzpmqXFB30yAhyqseBsyqXTyZbNbkh2Y=
2-
github.com/algorand/avm-abi v0.1.1/go.mod h1:+CgwM46dithy850bpTeHh9MC99zpn2Snirb3QTl2O/g=
1+
github.com/algorand/avm-abi v0.2.0 h1:bkjsG+BOEcxUcnGSALLosmltE0JZdg+ZisXKx0UDX2k=
2+
github.com/algorand/avm-abi v0.2.0/go.mod h1:+CgwM46dithy850bpTeHh9MC99zpn2Snirb3QTl2O/g=
33
github.com/algorand/go-codec/codec v1.1.10 h1:zmWYU1cp64jQVTOG8Tw8wa+k0VfwgXIPbnDfiVa+5QA=
44
github.com/algorand/go-codec/codec v1.1.10/go.mod h1:YkEx5nmr/zuCeaDYOIhlDg92Lxju8tj2d2NrYqP7g7k=
55
github.com/chrismcguire/gobberish v0.0.0-20150821175641-1d8adb509a0e h1:CHPYEbz71w8DqJ7DRIq+MXyCQsdibK08vdcQTY4ufas=
66
github.com/chrismcguire/gobberish v0.0.0-20150821175641-1d8adb509a0e/go.mod h1:6Xhs0ZlsRjXLIiSMLKafbZxML/j30pg9Z1priLuha5s=
7-
github.com/cucumber/godog v0.8.1 h1:lVb+X41I4YDreE+ibZ50bdXmySxgRviYFgKY6Aw4XE8=
8-
github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA=
7+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
8+
github.com/cucumber/gherkin/go/v26 v26.2.0 h1:EgIjePLWiPeslwIWmNQ3XHcypPsWAHoMCz/YEBKP4GI=
9+
github.com/cucumber/gherkin/go/v26 v26.2.0/go.mod h1:t2GAPnB8maCT4lkHL99BDCVNzCh1d7dBhCLt150Nr/0=
10+
github.com/cucumber/godog v0.14.1 h1:HGZhcOyyfaKclHjJ+r/q93iaTJZLKYW6Tv3HkmUE6+M=
11+
github.com/cucumber/godog v0.14.1/go.mod h1:FX3rzIDybWABU4kuIXLZ/qtqEe1Ac5RdXmqvACJOces=
12+
github.com/cucumber/messages/go/v21 v21.0.1 h1:wzA0LxwjlWQYZd32VTlAVDTkW6inOFmSM+RuOwHZiMI=
13+
github.com/cucumber/messages/go/v21 v21.0.1/go.mod h1:zheH/2HS9JLVFukdrsPWoPdmUtmYQAQPLk7w5vWsk5s=
14+
github.com/cucumber/messages/go/v22 v22.0.0/go.mod h1:aZipXTKc0JnjCsXrJnuZpWhtay93k7Rn3Dee7iyPJjs=
915
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1016
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1117
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
12-
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
13-
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
18+
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
19+
github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI=
20+
github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
21+
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
22+
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
23+
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
24+
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
25+
github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
26+
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
27+
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
28+
github.com/hashicorp/go-memdb v1.3.4 h1:XSL3NR682X/cVk2IeV0d70N4DZ9ljI885xAEU8IoK3c=
29+
github.com/hashicorp/go-memdb v1.3.4/go.mod h1:uBTr1oQbtuMgd1SSGoR8YV27eT3sBHbYiNm53bMpgSg=
30+
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
31+
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
32+
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
33+
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
34+
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
35+
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
36+
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
37+
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
38+
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
39+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
40+
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
41+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
1442
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1543
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
44+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
45+
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
46+
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
47+
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
1648
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
17-
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
49+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
50+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
1851
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
52+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
53+
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
54+
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
55+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
56+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1957
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
2058
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
2159
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
22-
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
23-
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
60+
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
61+
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
2462
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
2563
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
2664
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
@@ -42,9 +80,11 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
4280
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
4381
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
4482
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
83+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
4584
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
46-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
4785
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
86+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
87+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
4888
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
49-
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
50-
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
89+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
90+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

test/algodclientv2_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/cucumber/godog"
1414
)
1515

16-
func AlgodClientV2Context(s *godog.Suite) {
16+
func AlgodClientV2Context(s *godog.ScenarioContext) {
1717
s.Step(`^mock http responses in "([^"]*)" loaded from "([^"]*)"$`, mockHttpResponsesInLoadedFrom)
1818
s.Step(`^expect error string to contain "([^"]*)"$`, expectErrorStringToContain)
1919
s.Step(`^we make any Pending Transaction Information call$`, weMakeAnyPendingTransactionInformationCall)
@@ -66,8 +66,9 @@ func AlgodClientV2Context(s *godog.Suite) {
6666
s.Step(`^we make a TransactionGroupLedgerStateDeltaForRoundResponse call for round (\d+)$`, weMakeATransactionGroupLedgerStateDeltaForRoundResponseCallForRound)
6767
s.Step(`^we make a GetBlockTxids call against block number (\d+)$`, weMakeAGetBlockTxidsCallAgainstBlockNumber)
6868

69-
s.BeforeScenario(func(interface{}) {
69+
s.Before(func(ctx context.Context, sc *godog.Scenario) (context.Context, error) {
7070
globalErrForExamination = nil
71+
return ctx, nil
7172
})
7273
}
7374

test/applications_integration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ func indexerSaysCurrentAppShouldHaveTheseBoxes(max int, next string, encodedBoxe
969969
}
970970

971971
// @applications.verified and @applications.boxes
972-
func ApplicationsContext(s *godog.Suite) {
972+
func ApplicationsContext(s *godog.ScenarioContext) {
973973
s.Step(`^an algod v(\d+) client connected to "([^"]*)" port (\d+) with token "([^"]*)"$`, anAlgodVClientConnectedToPortWithToken)
974974
s.Step(`^I create a new transient account and fund it with (\d+) microalgos\.$`, iCreateANewTransientAccountAndFundItWithMicroalgos)
975975
s.Step(`^I build an application transaction with the transient account, the current application, suggested params, operation "([^"]*)", approval-program "([^"]*)", clear-program "([^"]*)", global-bytes (\d+), global-ints (\d+), local-bytes (\d+), local-ints (\d+), app-args "([^"]*)", foreign-apps "([^"]*)", foreign-assets "([^"]*)", app-accounts "([^"]*)", extra-pages (\d+), boxes "([^"]*)"$`, iBuildAnApplicationTransaction)

test/applications_unit_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func weMakeALookupApplicationsCall(applicationID int) error {
7171
return nil
7272
}
7373

74-
func ApplicationsUnitContext(s *godog.Suite) {
74+
func ApplicationsUnitContext(s *godog.ScenarioContext) {
7575
// @unit.transactions
7676
s.Step(`^fee field is in txn$`, feeFieldIsInTxn)
7777
s.Step(`^fee field not in txn$`, feeFieldNotInTxn)

test/docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_IMAGE=golang:1.21.10
1+
ARG GO_IMAGE=golang:1.23.3
22
FROM $GO_IMAGE
33

44
# Copy SDK code into the container

test/indexer_unit_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/cucumber/godog"
1111
)
1212

13-
func IndexerUnitTestContext(s *godog.Suite) {
13+
func IndexerUnitTestContext(s *godog.ScenarioContext) {
1414
s.Step(`^we make any LookupAssetBalances call$`, weMakeAnyLookupAssetBalancesCall)
1515
s.Step(`^the parsed LookupAssetBalances response should be valid on round (\d+), and contain an array of len (\d+) and element number (\d+) should have address "([^"]*)" amount (\d+) and frozen state "([^"]*)"$`, theParsedResponseShouldEqualTheMockResponse)
1616
s.Step(`^we make any LookupAssetTransactions call$`, weMakeAnyLookupAssetTransactionsCall)
@@ -56,8 +56,9 @@ func IndexerUnitTestContext(s *godog.Suite) {
5656
s.Step(`^we make a Lookup Block call against round (\d+) and header "([^"]*)"$`, weMakeALookupBlockCallAgainstRoundAndHeader)
5757
s.Step(`^we make a LookupApplicationBoxByIDandName call with applicationID (\d+) with encoded box name "([^"]*)"$`, weMakeALookupApplicationBoxByIDandName)
5858
s.Step(`^we make a SearchForApplicationBoxes call with applicationID (\d+) with max (\d+) nextToken "([^"]*)"$`, weMakeASearchForApplicationBoxes)
59-
s.BeforeScenario(func(interface{}) {
59+
s.Before(func(ctx context.Context, sc *godog.Scenario) (context.Context, error) {
6060
globalErrForExamination = nil
61+
return ctx, nil
6162
})
6263
}
6364

test/responses_unit_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func theParsedResponseShouldEqualTheMockResponse() error {
235235
return VerifyResponse(baselinePath, responseJson)
236236
}
237237

238-
func ResponsesContext(s *godog.Suite) {
238+
func ResponsesContext(s *godog.ScenarioContext) {
239239
s.Step(`^mock http responses in "([^"]*)" loaded from "([^"]*)" with status (\d+)\.$`, mockHttpResponsesInLoadedFromWithStatus)
240240
s.Step(`^we make any "([^"]*)" call to "([^"]*)"\.$`, weMakeAnyCallTo)
241241
s.Step(`^the parsed response should equal the mock response\.$`, theParsedResponseShouldEqualTheMockResponse)

test/steps_test.go

+16-11
Original file line numberDiff line numberDiff line change
@@ -206,23 +206,27 @@ func TestMain(m *testing.M) {
206206
flag.Parse()
207207
opt.Paths = flag.Args()
208208

209-
status := godog.RunWithOptions("godogs", func(s *godog.Suite) {
210-
FeatureContext(s)
211-
AlgodClientV2Context(s)
212-
IndexerUnitTestContext(s)
213-
TransactionsUnitContext(s)
214-
ApplicationsContext(s)
215-
ApplicationsUnitContext(s)
216-
ResponsesContext(s)
217-
}, opt)
209+
status := godog.TestSuite{
210+
Name: "godogs",
211+
ScenarioInitializer: func(s *godog.ScenarioContext) {
212+
FeatureContext(s)
213+
AlgodClientV2Context(s)
214+
IndexerUnitTestContext(s)
215+
TransactionsUnitContext(s)
216+
ApplicationsContext(s)
217+
ApplicationsUnitContext(s)
218+
ResponsesContext(s)
219+
},
220+
Options: &opt,
221+
}.Run()
218222

219223
if st := m.Run(); st > status {
220224
status = st
221225
}
222226
os.Exit(status)
223227
}
224228

225-
func FeatureContext(s *godog.Suite) {
229+
func FeatureContext(s *godog.ScenarioContext) {
226230
s.Step("I create a wallet", createWallet)
227231
s.Step("the wallet should exist", walletExist)
228232
s.Step("I get the wallet handle", getHandle)
@@ -387,10 +391,11 @@ func FeatureContext(s *godog.Suite) {
387391
s.Step(`^I prepare the transaction without signatures for simulation$`, iPrepareTheTransactionWithoutSignaturesForSimulation)
388392
s.Step(`^the simulation should report a failure at group "([^"]*)", path "([^"]*)" with message "([^"]*)"$`, theSimulationShouldReportAFailureAtGroupPathWithMessage)
389393

390-
s.BeforeScenario(func(interface{}) {
394+
s.Before(func(ctx context.Context, sc *godog.Scenario) (context.Context, error) {
391395
stxObj = types.SignedTxn{}
392396
abiMethods = nil
393397
kcl.RenewWalletHandle(handle)
398+
return ctx, nil
394399
})
395400
}
396401

test/transactions_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func buildLegacyAppCallTransaction(
183183

184184
}
185185

186-
func TransactionsUnitContext(s *godog.Suite) {
186+
func TransactionsUnitContext(s *godog.ScenarioContext) {
187187
// @unit.transactions
188188
s.Step(`^a signing account with address "([^"]*)" and mnemonic "([^"]*)"$`, aSigningAccountWithAddressAndMnemonic)
189189
s.Step(`^sign the transaction$`, signTheTransaction)

0 commit comments

Comments
 (0)