neoneo-go/pkg/core/native_management_test.go

40 lines
1.1 KiB
Go
Raw Normal View History

package core
import (
"testing"
"github.com/nspcc-dev/neo-go/pkg/core/storage"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/stretchr/testify/require"
)
type memoryStore struct {
*storage.MemoryStore
}
func (memoryStore) Close() error { return nil }
2020-12-16 13:11:12 +00:00
func TestMinimumDeploymentFee(t *testing.T) {
chain := newTestChain(t)
t.Run("get, internal method", func(t *testing.T) {
n := chain.contracts.Management.GetMinimumDeploymentFee(chain.dao)
require.Equal(t, 10_00000000, int(n))
})
}
func TestManagement_GetNEP17Contracts(t *testing.T) {
t.Run("empty chain", func(t *testing.T) {
chain := newTestChain(t)
require.ElementsMatch(t, []util.Uint160{chain.contracts.NEO.Hash, chain.contracts.GAS.Hash}, chain.contracts.Management.GetNEP17Contracts())
})
t.Run("test chain", func(t *testing.T) {
chain := newTestChain(t)
initBasicChain(t, chain)
rublesHash, err := chain.GetContractScriptHash(1)
require.NoError(t, err)
require.ElementsMatch(t, []util.Uint160{chain.contracts.NEO.Hash, chain.contracts.GAS.Hash, rublesHash}, chain.contracts.Management.GetNEP17Contracts())
})
}