Skip to content

Test framework invocation panic #4098

@cthulhu-rider

Description

@cthulhu-rider

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    I4No visible changesS4RoutineU2Seriously plannedbugSomething isn't workingneotestNeotest framework and coverage tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions