From 71948d903b2bf77202820545bf372d360e3ed0b4 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 17 May 2021 12:08:40 +0300 Subject: [PATCH] cli: use non-native NNS instead of native NNS in NEP-related tests --- cli/nep11_test.go | 8 ++++++-- cli/nep17_test.go | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cli/nep11_test.go b/cli/nep11_test.go index 99fbeabbe..3c19036b1 100644 --- a/cli/nep11_test.go +++ b/cli/nep11_test.go @@ -34,8 +34,8 @@ func TestNEP11Import(t *testing.T) { walletPath := path.Join(tmpDir, "walletForImport.json") defer os.Remove(walletPath) - nnsContractHash, err := e.Chain.GetNativeContractScriptHash(nativenames.NameService) - require.NoError(t, err) + // deploy NFT NeoNameService contract + nnsContractHash := deployNNSContract(t, e) neoContractHash, err := e.Chain.GetNativeContractScriptHash(nativenames.Neo) require.NoError(t, err) e.Run(t, "neo-go", "wallet", "init", "--wallet", walletPath) @@ -325,3 +325,7 @@ func TestNEP11_OwnerOf_BalanceOf_Transfer(t *testing.T) { func deployNFTContract(t *testing.T, e *executor) util.Uint160 { return deployContract(t, e, "../examples/nft-nd/nft.go", "../examples/nft-nd/nft.yml", nftOwnerWallet, nftOwnerAddr, nftOwnerPass) } + +func deployNNSContract(t *testing.T, e *executor) util.Uint160 { + return deployContract(t, e, "../examples/nft-nd-nns/", "../examples/nft-nd-nns/nns.yml", validatorWallet, validatorAddr, "one") +} diff --git a/cli/nep17_test.go b/cli/nep17_test.go index 5f94c344f..1c6984814 100644 --- a/cli/nep17_test.go +++ b/cli/nep17_test.go @@ -268,8 +268,7 @@ func TestNEP17ImportToken(t *testing.T) { require.NoError(t, err) gasContractHash, err := e.Chain.GetNativeContractScriptHash(nativenames.Gas) require.NoError(t, err) - nnsContractHash, err := e.Chain.GetNativeContractScriptHash(nativenames.NameService) - require.NoError(t, err) + nnsContractHash := deployNNSContract(t, e) e.Run(t, "neo-go", "wallet", "init", "--wallet", walletPath) // missing token hash