forked from TrueCloudLab/neoneo-go
Merge pull request #1265 from nspcc-dev/native/policy/test_fix
core: fix native policy tests
This commit is contained in:
commit
e9d41c78c9
1 changed files with 4 additions and 16 deletions
|
@ -109,36 +109,24 @@ func TestBlockSystemFee(t *testing.T) {
|
|||
t.Run("get", func(t *testing.T) {
|
||||
res, err := invokeNativePolicyMethod(chain, "getMaxBlockSystemFee")
|
||||
require.NoError(t, err)
|
||||
checkResult(t, res, smartcontract.Parameter{
|
||||
Type: smartcontract.IntegerType,
|
||||
Value: 9000 * native.GASFactor,
|
||||
})
|
||||
checkResult(t, res, stackitem.NewBigInteger(big.NewInt(9000*native.GASFactor)))
|
||||
require.NoError(t, chain.persist())
|
||||
})
|
||||
|
||||
t.Run("set, too low fee", func(t *testing.T) {
|
||||
res, err := invokeNativePolicyMethod(chain, "setMaxBlockSystemFee", bigint.ToBytes(big.NewInt(4007600)))
|
||||
require.NoError(t, err)
|
||||
checkResult(t, res, smartcontract.Parameter{
|
||||
Type: smartcontract.BoolType,
|
||||
Value: false,
|
||||
})
|
||||
checkResult(t, res, stackitem.NewBool(false))
|
||||
})
|
||||
|
||||
t.Run("set, success", func(t *testing.T) {
|
||||
res, err := invokeNativePolicyMethod(chain, "setMaxBlockSystemFee", bigint.ToBytes(big.NewInt(100000000)))
|
||||
require.NoError(t, err)
|
||||
checkResult(t, res, smartcontract.Parameter{
|
||||
Type: smartcontract.BoolType,
|
||||
Value: true,
|
||||
})
|
||||
checkResult(t, res, stackitem.NewBool(true))
|
||||
require.NoError(t, chain.persist())
|
||||
res, err = invokeNativePolicyMethod(chain, "getMaxBlockSystemFee")
|
||||
require.NoError(t, err)
|
||||
checkResult(t, res, smartcontract.Parameter{
|
||||
Type: smartcontract.IntegerType,
|
||||
Value: 100000000,
|
||||
})
|
||||
checkResult(t, res, stackitem.NewBigInteger(big.NewInt(100000000)))
|
||||
require.NoError(t, chain.persist())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue