Merge pull request #2739 from nspcc-dev/fix-sc-conversion

smartcontract: fix underlying PublicKey parameter value
This commit is contained in:
Roman Khimov 2022-10-11 18:06:19 +07:00 committed by GitHub
commit 44df4b9dbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View file

@ -387,8 +387,6 @@ func NewParametersFromValues(values ...interface{}) ([]Parameter, error) {
func ExpandParameterToEmitable(param Parameter) (interface{}, error) {
var err error
switch t := param.Type; t {
case PublicKeyType:
return param.Value.(*keys.PublicKey).Bytes(), nil
case ArrayType:
arr := param.Value.([]Parameter)
res := make([]interface{}, len(arr))

View file

@ -477,7 +477,7 @@ func TestExpandParameterToEmitable(t *testing.T) {
Expected: util.Uint256{1, 2, 3},
},
{
In: Parameter{Type: PublicKeyType, Value: pk.PublicKey()},
In: Parameter{Type: PublicKeyType, Value: pk.PublicKey().Bytes()},
Expected: pk.PublicKey().Bytes(),
},
{