Merge pull request #1722 from nspcc-dev/fix/nep11

smartcontract: add NEP-11 standard check
This commit is contained in:
Roman Khimov 2021-02-22 22:27:09 +03:00 committed by GitHub
commit abee3b5b05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 491 additions and 106 deletions

View file

@ -3,6 +3,8 @@ package native
import (
"testing"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest/standard"
"github.com/stretchr/testify/require"
)
@ -86,3 +88,8 @@ func TestNameService_CheckName(t *testing.T) {
}
}
}
func TestNameService_NEP11(t *testing.T) {
ns := newNameService()
require.NoError(t, standard.Check(&ns.Manifest, manifest.NEP11StandardName))
}

View file

@ -0,0 +1,14 @@
package native
import (
"testing"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest/standard"
"github.com/stretchr/testify/require"
)
func TestNonfungibleNEP11(t *testing.T) {
n := newNonFungible("NFToken", -100, "SYM", 1)
require.NoError(t, standard.Check(&n.ContractMD.Manifest, manifest.NEP11StandardName))
}