smartcontract: accept Parameter in NewParameterFromValue
While it makes little sense, there can be a situation where this function will get predefined Parameters in some way.
This commit is contained in:
parent
c0705e45c9
commit
aa2dbe9caf
2 changed files with 24 additions and 0 deletions
|
@ -616,6 +616,16 @@ func TestParameterFromValue(t *testing.T) {
|
|||
expType: IntegerType,
|
||||
expVal: big.NewInt(100),
|
||||
},
|
||||
{
|
||||
value: Parameter{ByteArrayType, []byte{1, 2, 3}},
|
||||
expType: ByteArrayType,
|
||||
expVal: []byte{1, 2, 3},
|
||||
},
|
||||
{
|
||||
value: &Parameter{ByteArrayType, []byte{1, 2, 3}},
|
||||
expType: ByteArrayType,
|
||||
expVal: []byte{1, 2, 3},
|
||||
},
|
||||
{
|
||||
value: util.Uint160{1, 2, 3},
|
||||
expType: Hash160Type,
|
||||
|
@ -641,6 +651,11 @@ func TestParameterFromValue(t *testing.T) {
|
|||
expType: ArrayType,
|
||||
expVal: []Parameter{{ByteArrayType, []byte{1, 2, 3}}, {ByteArrayType, []byte{3, 2, 1}}},
|
||||
},
|
||||
{
|
||||
value: []Parameter{{ByteArrayType, []byte{1, 2, 3}}, {ByteArrayType, []byte{3, 2, 1}}},
|
||||
expType: ArrayType,
|
||||
expVal: []Parameter{{ByteArrayType, []byte{1, 2, 3}}, {ByteArrayType, []byte{3, 2, 1}}},
|
||||
},
|
||||
{
|
||||
value: []*keys.PublicKey{pk1.PublicKey(), pk2.PublicKey()},
|
||||
expType: ArrayType,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue