mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-09 03:13:13 +00:00
parent
13336f9dba
commit
c647f8e4ed
3 changed files with 124 additions and 1 deletions
|
@ -113,6 +113,52 @@ func TestFeePerByte(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestBlockSystemFee(t *testing.T) {
|
||||
chain := newTestChain(t)
|
||||
defer chain.Close()
|
||||
|
||||
t.Run("get, internal method", func(t *testing.T) {
|
||||
n := chain.contracts.Policy.GetMaxBlockSystemFeeInternal(chain.dao)
|
||||
require.Equal(t, 9000*native.GASFactor, int(n))
|
||||
})
|
||||
|
||||
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,
|
||||
})
|
||||
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,
|
||||
})
|
||||
})
|
||||
|
||||
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,
|
||||
})
|
||||
require.NoError(t, chain.persist())
|
||||
res, err = invokeNativePolicyMethod(chain, "getMaxBlockSystemFee")
|
||||
require.NoError(t, err)
|
||||
checkResult(t, res, smartcontract.Parameter{
|
||||
Type: smartcontract.IntegerType,
|
||||
Value: 100000000,
|
||||
})
|
||||
require.NoError(t, chain.persist())
|
||||
})
|
||||
}
|
||||
|
||||
func TestBlockedAccounts(t *testing.T) {
|
||||
chain := newTestChain(t)
|
||||
defer chain.Close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue