native: allow to set candidate register price

This commit is contained in:
Evgeniy Stratonikov 2021-03-05 14:17:58 +03:00
parent b780a64b4d
commit 27fc28bd69
5 changed files with 84 additions and 1 deletions

View file

@ -1,6 +1,7 @@
package core
import (
"math/big"
"testing"
"github.com/nspcc-dev/neo-go/internal/random"
@ -46,7 +47,10 @@ func testGetSet(t *testing.T, chain *Blockchain, hash util.Uint160, name string,
if maxValue != 0 {
t.Run("set, too large value", func(t *testing.T) {
res, err := invokeContractMethodGeneric(chain, 100000000, hash, setName, true, maxValue+1)
// use big.Int because max can be `math.MaxInt64`
max := big.NewInt(maxValue)
max.Add(max, big.NewInt(1))
res, err := invokeContractMethodGeneric(chain, 100000000, hash, setName, true, max)
require.NoError(t, err)
checkFAULTState(t, res)
})