rpc/smartcontract: merge contract parameter types

Merged two types:
	- smartcontract.ParamType
	- rpc.StackParamType
into single one:
	- smartcontract.ParamType
as they duplicated the functionality.

NOTE: type smartcontract.MapType was added (as in C# implementation).

From now, list of supported smartcontract parameter types:
	UnknownType
	SignatureType
	BoolType
	IntegerType
	Hash160Type
	Hash256Type
	ByteArrayType
	PublicKeyType
	StringType
	ArrayType
	MapType
	InteropInterfaceType
	VoidType
This commit is contained in:
Anna Shaleva 2020-02-21 17:34:18 +03:00
parent 5d4dfbfa1a
commit 648e0bb242
13 changed files with 979 additions and 1001 deletions

View file

@ -6,6 +6,7 @@ import (
"testing"
"github.com/CityOfZion/neo-go/pkg/encoding/address"
"github.com/CityOfZion/neo-go/pkg/smartcontract"
"github.com/CityOfZion/neo-go/pkg/util"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -41,7 +42,7 @@ func TestParam_UnmarshalJSON(t *testing.T) {
{
Type: FuncParamT,
Value: FuncParam{
Type: String,
Type: smartcontract.StringType,
Value: Param{
Type: StringT,
Value: "jajaja",
@ -146,7 +147,7 @@ func TestParamGetUint160FromAddress(t *testing.T) {
func TestParamGetFuncParam(t *testing.T) {
fp := FuncParam{
Type: String,
Type: smartcontract.StringType,
Value: Param{
Type: StringT,
Value: "jajaja",