forked from TrueCloudLab/neoneo-go
rpc: bug with empty stack marshalling in getapplicationlog
Problem: cannot marshall empty raw message from appExecResult.Stack Solution: add handler for case when appExecResult.Stack is an empty string
This commit is contained in:
parent
d9a83373ed
commit
784bac0b38
1 changed files with 7 additions and 1 deletions
|
@ -46,12 +46,18 @@ func NewApplicationLog(appExecRes *state.AppExecResult, scriptHash util.Uint160)
|
||||||
|
|
||||||
triggerString := appExecRes.Trigger.String()
|
triggerString := appExecRes.Trigger.String()
|
||||||
|
|
||||||
|
var rawStack json.RawMessage
|
||||||
|
if len(appExecRes.Stack) != 0 {
|
||||||
|
rawStack = json.RawMessage(appExecRes.Stack)
|
||||||
|
} else {
|
||||||
|
rawStack = json.RawMessage("[]")
|
||||||
|
}
|
||||||
executions := []Execution{{
|
executions := []Execution{{
|
||||||
Trigger: triggerString,
|
Trigger: triggerString,
|
||||||
ScriptHash: scriptHash,
|
ScriptHash: scriptHash,
|
||||||
VMState: appExecRes.VMState,
|
VMState: appExecRes.VMState,
|
||||||
GasConsumed: appExecRes.GasConsumed,
|
GasConsumed: appExecRes.GasConsumed,
|
||||||
Stack: json.RawMessage(appExecRes.Stack),
|
Stack: rawStack,
|
||||||
Events: events,
|
Events: events,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue