[#421] morph/client: Support native.Role type as contract argument

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-09 17:47:13 +03:00 committed by Alex Vanin
parent 28fb8c971c
commit b6ca7f1f87

View file

@ -4,6 +4,7 @@ import (
"context" "context"
"time" "time"
"github.com/nspcc-dev/neo-go/pkg/core/native"
"github.com/nspcc-dev/neo-go/pkg/core/transaction" "github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neo-go/pkg/rpc/client" "github.com/nspcc-dev/neo-go/pkg/rpc/client"
@ -219,6 +220,9 @@ func toStackParameter(value interface{}) (sc.Parameter, error) {
case util.Uint160: case util.Uint160:
result.Type = sc.ByteArrayType result.Type = sc.ByteArrayType
result.Value = v.BytesBE() result.Value = v.BytesBE()
case native.Role:
result.Type = sc.IntegerType
result.Value = int64(v)
default: default:
return result, errors.Errorf("chain/client: unsupported parameter %v", value) return result, errors.Errorf("chain/client: unsupported parameter %v", value)
} }