scripts raw message
@@ -20,9 +20,11 @@ package scripts
import (
"bytes"
+ "encoding/json"
"fmt"
"github.com/onflow/cadence"
+ jsonCadence "github.com/onflow/cadence/encoding/json"
"github.com/spf13/cobra"
"github.com/onflow/flow-cli/pkg/flowcli/util"
@@ -44,7 +46,9 @@ type ScriptResult struct {
// JSON convert result to JSON
func (r *ScriptResult) JSON() interface{} {
- return r.Value
+ return json.RawMessage(
+ jsonCadence.MustEncode(r.Value),
+ )
}
// String convert result to string
