Merge pull request #1722 from nspcc-dev/fix/nep11
smartcontract: add NEP-11 standard check
This commit is contained in:
commit
abee3b5b05
12 changed files with 491 additions and 106 deletions
|
@ -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))
|
||||
}
|
||||
|
|
14
pkg/core/native/nonfungible_test.go
Normal file
14
pkg/core/native/nonfungible_test.go
Normal 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))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue