Test framework invocation panic #1583

Open
opened 2025-12-28 17:16:54 +00:00 by sami · 1 comment
Owner

Originally created by @cthulhu-rider on GitHub (Nov 24, 2025).

following code does not work as expected

bc, committee := chain.NewSingle(t)
exec := neotest.NewExecutor(t, bc, committee, committee)

// contract := deploy()

inv := exec.NewInvoker(contract.Hash)

inv.Invoke(t, 0, "totalSupply")

Current Behavior

panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0

goroutine 33 [running]:
testing.tRunner.func1.2({0xf84200, 0xc001327e78})
	/home/ll/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/testing/testing.go:1734 +0x21c
testing.tRunner.func1()
	/home/ll/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/testing/testing.go:1737 +0x35e
panic({0xf84200?, 0xc001327e78?})
	/home/ll/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/runtime/panic.go:787 +0x132
github.com/nspcc-dev/neo-go/pkg/core/mempool.(*Pool).checkTxConflicts(0x7d35ba20939b124?, 0xdf88b57eaca21ce5?, {0x1243350?, 0xc0003a4808?})
	/home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/core/mempool/mem_pool.go:531 +0xdd8
github.com/nspcc-dev/neo-go/pkg/core/mempool.(*Pool).Add(0xc0002a5740, 0xc0009f7340, {0x1243350, 0xc0003a4808}, {0x0, 0x0, 0x0?})
	/home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/core/mempool/mem_pool.go:215 +0x153
github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).verifyAndPoolTx(0xc0003a4808, 0xc0009f7340, 0xc0002a5740, {0x1243350, 0xc0003a4808}, {0x0, 0x0, 0x0})
	/home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/core/blockchain.go:2969 +0x810
github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).AddBlock(0xc0003a4808, 0xc0005fd560)
	/home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/core/blockchain.go:1868 +0xb35
github.com/nspcc-dev/neo-go/pkg/neotest.(*Executor).AddNewBlock(0xc0003a8640, {0x1254a60, 0xc0003761c0}, {0xc0013056d0?, 0x0?, 0x0?})
	/home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/neotest/basic.go:372 +0x4f
github.com/nspcc-dev/neo-go/pkg/neotest.(*ContractInvoker).Invoke(0xc000e61eb8, {0x1254a60, 0xc0003761c0}, {0xe53540, 0x126b840}, {0x100ae66?, 0x0?}, {0x0, 0x0, 0x0})
	/home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/neotest/client.go:115 +0x145

Expected Behavior

test failure with clear reason instead

Regression

unlikely

Your Environment

Originally created by @cthulhu-rider on GitHub (Nov 24, 2025). following code does not work as expected ```go bc, committee := chain.NewSingle(t) exec := neotest.NewExecutor(t, bc, committee, committee) // contract := deploy() inv := exec.NewInvoker(contract.Hash) inv.Invoke(t, 0, "totalSupply") ``` ## Current Behavior ``` panic: runtime error: index out of range [0] with length 0 [recovered] panic: runtime error: index out of range [0] with length 0 goroutine 33 [running]: testing.tRunner.func1.2({0xf84200, 0xc001327e78}) /home/ll/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/testing/testing.go:1734 +0x21c testing.tRunner.func1() /home/ll/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/testing/testing.go:1737 +0x35e panic({0xf84200?, 0xc001327e78?}) /home/ll/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/runtime/panic.go:787 +0x132 github.com/nspcc-dev/neo-go/pkg/core/mempool.(*Pool).checkTxConflicts(0x7d35ba20939b124?, 0xdf88b57eaca21ce5?, {0x1243350?, 0xc0003a4808?}) /home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/core/mempool/mem_pool.go:531 +0xdd8 github.com/nspcc-dev/neo-go/pkg/core/mempool.(*Pool).Add(0xc0002a5740, 0xc0009f7340, {0x1243350, 0xc0003a4808}, {0x0, 0x0, 0x0?}) /home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/core/mempool/mem_pool.go:215 +0x153 github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).verifyAndPoolTx(0xc0003a4808, 0xc0009f7340, 0xc0002a5740, {0x1243350, 0xc0003a4808}, {0x0, 0x0, 0x0}) /home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/core/blockchain.go:2969 +0x810 github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).AddBlock(0xc0003a4808, 0xc0005fd560) /home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/core/blockchain.go:1868 +0xb35 github.com/nspcc-dev/neo-go/pkg/neotest.(*Executor).AddNewBlock(0xc0003a8640, {0x1254a60, 0xc0003761c0}, {0xc0013056d0?, 0x0?, 0x0?}) /home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/neotest/basic.go:372 +0x4f github.com/nspcc-dev/neo-go/pkg/neotest.(*ContractInvoker).Invoke(0xc000e61eb8, {0x1254a60, 0xc0003761c0}, {0xe53540, 0x126b840}, {0x100ae66?, 0x0?}, {0x0, 0x0, 0x0}) /home/ll/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.114.0/pkg/neotest/client.go:115 +0x145 ``` ## Expected Behavior test failure with clear reason instead ## Regression unlikely ## Your Environment * Version of the product used: https://github.com/nspcc-dev/neo-go/releases/tag/v0.114.0
Author
Owner

@cthulhu-rider commented on GitHub (Nov 24, 2025):

fixed on my side by replacing NewInvoker() with CommitteeInvoker()

@cthulhu-rider commented on GitHub (Nov 24, 2025): fixed on my side by replacing `NewInvoker()` with `CommitteeInvoker()`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#1583
No description provided.