mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-05 13:06:20 +00:00
transaction: unmarshal Witness properly
Both verification and invocation scripts need to be unmarshaled from hex. Also fix failing RPC tests: block contains non-pointer `transaction.Witness` field and (*Witness).MarshalJSON method is not called.
This commit is contained in:
parent
33f99104e8
commit
634e9483d3
2 changed files with 19 additions and 1 deletions
|
@ -185,6 +185,10 @@ func TestMarshalUnmarshalJSON(t *testing.T) {
|
|||
ScriptHash: util.Uint160{7, 8, 9, 10},
|
||||
Position: 13,
|
||||
}}
|
||||
tx.Scripts = []Witness{{
|
||||
InvocationScript: []byte{5, 3, 1},
|
||||
VerificationScript: []byte{2, 4, 6},
|
||||
}}
|
||||
data, err := json.Marshal(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue