Skip to content

Commit

Permalink
core: add unit tests for HF-based native contracts update
Browse files Browse the repository at this point in the history
A part of #3213.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
  • Loading branch information
AnnaShaleva committed Apr 25, 2024
1 parent 36e1285 commit 9b8d579
Show file tree
Hide file tree
Showing 2 changed files with 294 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/core/native/native_test/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"math/big"
"testing"

"github.com/nspcc-dev/neo-go/pkg/config"
"github.com/nspcc-dev/neo-go/pkg/core/native"
"github.com/nspcc-dev/neo-go/pkg/core/native/noderoles"
"github.com/nspcc-dev/neo-go/pkg/core/state"
Expand All @@ -19,7 +20,11 @@ import (
)

func newNativeClient(t *testing.T, name string) *neotest.ContractInvoker {
bc, acc := chain.NewSingle(t)
return newCustomNativeClient(t, name, nil)
}

func newCustomNativeClient(t *testing.T, name string, f func(cfg *config.Blockchain)) *neotest.ContractInvoker {
bc, acc := chain.NewSingleWithCustomConfig(t, f)
e := neotest.NewExecutor(t, bc, acc, acc)

return e.CommitteeInvoker(e.NativeHash(t, name))
Expand Down
Loading

0 comments on commit 9b8d579

Please sign in to comment.