2020-06-15 18:13:32 +00:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2020-11-23 11:09:00 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/internal/random"
|
2021-01-21 12:05:15 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/internal/testchain"
|
2020-12-14 09:18:59 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/interop"
|
2020-06-15 18:13:32 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/native"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestFeePerByte(t *testing.T) {
|
|
|
|
chain := newTestChain(t)
|
|
|
|
|
|
|
|
t.Run("get, internal method", func(t *testing.T) {
|
|
|
|
n := chain.contracts.Policy.GetFeePerByteInternal(chain.dao)
|
|
|
|
require.Equal(t, 1000, int(n))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-12-14 09:18:59 +00:00
|
|
|
func TestExecFeeFactor(t *testing.T) {
|
|
|
|
chain := newTestChain(t)
|
|
|
|
|
|
|
|
t.Run("get, internal method", func(t *testing.T) {
|
|
|
|
n := chain.contracts.Policy.GetExecFeeFactorInternal(chain.dao)
|
|
|
|
require.EqualValues(t, interop.DefaultBaseExecFee, n)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-12-14 09:41:23 +00:00
|
|
|
func TestStoragePrice(t *testing.T) {
|
|
|
|
chain := newTestChain(t)
|
|
|
|
|
|
|
|
t.Run("get, internal method", func(t *testing.T) {
|
|
|
|
n := chain.contracts.Policy.GetStoragePriceInternal(chain.dao)
|
2021-02-02 15:46:43 +00:00
|
|
|
require.Equal(t, int64(native.DefaultStoragePrice), n)
|
2020-12-14 09:41:23 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-06-15 18:13:32 +00:00
|
|
|
func TestBlockedAccounts(t *testing.T) {
|
|
|
|
chain := newTestChain(t)
|
2021-01-21 12:05:15 +00:00
|
|
|
transferTokenFromMultisigAccount(t, chain, testchain.CommitteeScriptHash(),
|
|
|
|
chain.contracts.GAS.Hash, 100_00000000)
|
|
|
|
|
2020-10-21 12:51:59 +00:00
|
|
|
t.Run("isBlocked, internal method", func(t *testing.T) {
|
|
|
|
isBlocked := chain.contracts.Policy.IsBlockedInternal(chain.dao, random.Uint160())
|
|
|
|
require.Equal(t, false, isBlocked)
|
2020-06-15 18:13:32 +00:00
|
|
|
})
|
|
|
|
}
|