2020-12-13 15:26:35 +00:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2020-12-15 10:53:35 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/storage"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
2020-12-13 15:26:35 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2020-12-15 10:53:35 +00:00
|
|
|
type memoryStore struct {
|
|
|
|
*storage.MemoryStore
|
|
|
|
}
|
|
|
|
|
|
|
|
func (memoryStore) Close() error { return nil }
|
|
|
|
|
2021-07-23 12:52:30 +00:00
|
|
|
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())
|
|
|
|
})
|
|
|
|
}
|